📖 Introduction
Claude Code is a command-line interface (CLI) tool with agentic capabilities developed by Anthropic, running directly in your terminal environment. Its core design philosophy is to work seamlessly with your preferred IDE and toolchain rather than replacing them.
The tool can understand the context of your entire codebase, execute daily development tasks through natural language instructions, explain complex code logic, and even handle Git workflows.
⚙️ System Requirements
| Component | Requirement | Verify Command |
|---|---|---|
| Operating System | macOS 10.15+ / Ubuntu 20.04+ / Windows 10+ (supports CMD / PowerShell) | uname -a or winver |
| Node.js | v18.0 or higher | node -v |
| npm | Included with Node.js | npm -v |
| Memory | At least 4GB RAM | - |
🖥️ Choose Your Platform
Install Node.js (skip if already installed)
We recommend using Homebrew to install Node.js:
# If Homebrew is not installed, run this first
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Node.js
brew install node
# Verify installation
node --versionInstall Claude Code
npm install -g @anthropic-ai/claude-code
# Verify installation
claude --versionDo not use sudo to execute the installation command, as this may cause permission issues and security risks. If you encounter permission errors, please fix your npm permission configuration.
Configure API Key
On first run, Claude Code will prompt you for an API key. You can use BeeHears unified access service:
# Set API Base URL (using BeeHears service)
export ANTHROPIC_BASE_URL="https://api.beehears.com"
# Set API key
export ANTHROPIC_AUTH_TOKEN="your-api-key-here"
# Run Claude Code
claudeYou can add the environment variables to ~/.zshrc or ~/.bash_profile for permanent configuration.
Claude Code now supports running directly in native Windows CMD and PowerShell. If you prefer a Unix-like shell, Git Bash or WSL are still optional choices.
Install Node.js
Download and install the latest LTS version from the official Node.js website (18+ required, 20+ recommended), then reopen CMD or PowerShell.
# Verify Node.js and npm
node --version
npm --versionInstall Claude Code
npm install -g @anthropic-ai/claude-code
# Verify installation
claude --versionIf you hit global install permissions or execution policy issues, first try running an elevated PowerShell or fixing your Node.js/npm environment. WSL is no longer required for Windows installs.
Configure API Key
# Set API Base URL (using BeeHears service)
$env:ANTHROPIC_BASE_URL="https://api.beehears.com"
# Set API key
$env:ANTHROPIC_AUTH_TOKEN="***"
# Run Claude Code
claudeset ANTHROPIC_BASE_URL=https://api.beehears.com
set ANTHROPIC_AUTH_TOKEN=***
claudeIf your team still prefers Git Bash or WSL, Claude Code can continue to run there as well, but they are no longer prerequisites on Windows.
Install Node.js
# Use NodeSource to install Node.js 20.x
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
# Verify installation
node --version# Install using pacman
sudo pacman -S nodejs npm
# Verify installation
node --versionInstall Claude Code
npm install -g @anthropic-ai/claude-code
# Verify installation
claude --versionDo not use sudo to execute the installation command. If you encounter permission errors (like EACCES), please fix your npm permission configuration.
Configure API Key
# Set API Base URL (using BeeHears service)
export ANTHROPIC_BASE_URL="https://api.beehears.com"
# Set API key
export ANTHROPIC_AUTH_TOKEN="your-api-key-here"
# Run Claude Code
claudeYou can add the environment variables to ~/.bashrc or ~/.zshrc for permanent configuration:
echo 'export ANTHROPIC_BASE_URL="https://api.beehears.com"' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN="your-api-key-here"' >> ~/.bashrc
source ~/.bashrc🚀 Basic Usage
After installation, navigate to your project directory and run Claude Code:
cd /path/to/your/project
claudeCommon Commands
claude- Start an interactive sessionclaude "your prompt"- Send a prompt directly and get a responseclaude --help- View help informationclaude --version- View version information
Common Operations in Interactive Sessions
- Enter natural language directly to describe the task you want to accomplish
- Claude Code can read, modify, and create files
- Supports executing terminal commands (will request your confirmation)
- Can analyze the structure and logic of your entire codebase