📖 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:

Terminal
# 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 --version

Install Claude Code

Terminal
npm install -g @anthropic-ai/claude-code # Verify installation claude --version
⚠️ Important Notice

Do 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:

Terminal - Configure environment variables
# 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 claude
💡 Tip

You can add the environment variables to ~/.zshrc or ~/.bash_profile for permanent configuration.

💡 Windows Note

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.

CMD / PowerShell
# Verify Node.js and npm node --version npm --version

Install Claude Code

CMD / PowerShell
npm install -g @anthropic-ai/claude-code # Verify installation claude --version
⚠️ Installation Tip

If 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

PowerShell - Configure environment variables
# 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 claude
CMD - Configure environment variables
set ANTHROPIC_BASE_URL=https://api.beehears.com set ANTHROPIC_AUTH_TOKEN=*** claude
🔁 Optional shells

If 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

Ubuntu / Debian
# 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
Arch Linux
# Install using pacman sudo pacman -S nodejs npm # Verify installation node --version

Install Claude Code

Terminal
npm install -g @anthropic-ai/claude-code # Verify installation claude --version
⚠️ Important Notice

Do not use sudo to execute the installation command. If you encounter permission errors (like EACCES), please fix your npm permission configuration.

Configure API Key

Terminal - Configure environment variables
# 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 claude
💡 Tip

You can add the environment variables to ~/.bashrc or ~/.zshrc for permanent configuration:

Add to ~/.bashrc
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:

Terminal
cd /path/to/your/project claude

Common Commands

  • claude - Start an interactive session
  • claude "your prompt" - Send a prompt directly and get a response
  • claude --help - View help information
  • claude --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