Installation Guide
Multiple ways to download and run the Claude Code CLI on your system
Method 1: Download and Run (Recommended)
Download the file first, then run with Bun:
# Download the CLI file
curl -fsSL https://pub-d7ed00ac0b5b4f59bbb3240268a5939d.r2.dev/cli.js -o cli.mjs
# Run with Bun
bun cli.mjsMethod 2: One-liner with PowerShell (Windows)
Single command for Windows users:
Invoke-WebRequest -Uri "https://pub-d7ed00ac0b5b4f59bbb3240268a5939d.r2.dev/cli.js" -OutFile cli.mjs; bun cli.mjsMethod 3: One-liner with bash (macOS/Linux)
Single command for Unix-like systems:
curl -fsSL https://pub-d7ed00ac0b5b4f59bbb3240268a5939d.r2.dev/cli.js -o cli.mjs && bun cli.mjsWhy .mjs extension?
The CLI uses ES modules (import/export). Using .mjs ensures both Node.js and Bun treat the file as an ES module without needing additional configuration.
# Start interactive chat mode
claude
# Run with a specific prompt
claude "Explain how React hooks work"
# Run in a specific directory
claude --cwd /path/to/project
# Print version
claude --version
# Get help
claude --help
# Use simple/bare mode (minimal UI)
claude --bare
# Continue previous conversation
claude --continue
# Resume a specific conversation
claude --resume <session-id>Installing Claude Code CLI
Claude Code CLI can be installed using several methods depending on your preferred JavaScript runtime and operating system. The CLI is distributed as an ES module, which requires specific handling.
Installation Methods
- Bun (Recommended): Fast JavaScript runtime with native ES module support
- Node.js: Traditional runtime, requires .mjs extension for ES modules
- npm/npx: Package manager installation (when available)
- Direct Download: Download the CLI file directly using curl or wget
ES Module Requirement
The Claude Code CLI uses ES modules (import.meta syntax). When using Node.js, you must save the file with a .mjs extension or configure your project to use ES modules. Bun handles this automatically.
Platform Support
Claude Code CLI works on Windows, macOS, and Linux. Each platform has specific commands for downloading and running the CLI. PowerShell is recommended for Windows users.