1️⃣ Install Node.js (Skip if already installed)
Ensure Node.js version ≥ 18.0
bash
# Ubuntu / Debian users
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo bash -
sudo apt-get install -y nodejs
node --version
# macOS users
sudo xcode-select --install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install node
node --version
🧭 Uninstall Other Proxy Client CLI First (Optional)
Step 1: Check Installation Location
Check if installed in local project
bash
npm ls @anthropic-ai/claude-code
Check if installed globally
bash
npm ls -g @anthropic-ai/claude-code
🧹 Step 2: Execute Uninstallation
Uninstall locally installed package
bash
npm uninstall @anthropic-ai/claude-code
Uninstall globally installed package
bash
npm uninstall -g @anthropic-ai/claude-code
2️⃣ Install Claude Code
Claude Code Native Version Installation
bash
# Install with Homebrew on macOS, Linux
brew install --cask claude-code
# Install via script on macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash
# Install on Windows
PowerShellirm https://claude.ai/install.psliex
Claude Code npm Installation
bash
npm install -g @anthropic-ai/claude-code
claude --version
3️⃣ Getting Started
Obtain Auth Token: ANTHROPIC_AUTH_TOKEN: Will be sent to you separately, format like: "cr_..."
API Address: ANTHROPIC_BASE_URL: The connection URL given to you is this site's API service address, same as the main site address
Run in your project directory:
bash
cd your-project-folder
export ANTHROPIC_AUTH_TOKEN=cr_...
export ANTHROPIC_BASE_URL=your-connection-url
claude what AI model are you
After running: Select your preferred theme + Enter Confirm security notice + Enter Use default Terminal configuration + Enter Trust working directory + Enter
Start coding with your AI programming partner in the terminal! 🚀
4️⃣ Configure Environment Variables (Recommended)
Environment Variables
bash
# Mac and Linux environment variables
export ANTHROPIC_BASE_URL="connection-url"
export ANTHROPIC_AUTH_TOKEN="your-key"
cd your-project-folder
claude
Windows CMD Environment Variables
bash
set ANTHROPIC_BASE_URL=connection-url
set ANTHROPIC_AUTH_TOKEN=your-key
cd your-project-folder
claude
Windows PowerShell Environment Variables
bash
$env:ANTHROPIC_BASE_URL="connection-url";
$env:ANTHROPIC_AUTH_TOKEN="your-key"
cd your-project-folder
claude
You can now use Claude Code
To avoid repeating input every time, add environment variables to bash_profile and bashrc:
Mac or Linux - Add to configuration files:
bash
echo -e '\n export ANTHROPIC_AUTH_TOKEN=your-key' >> ~/.bash_profile
echo -e '\n export ANTHROPIC_BASE_URL=connection-url' >> ~/.bash_profile
echo -e '\n export ANTHROPIC_AUTH_TOKEN=your-key' >> ~/.bashrc
echo -e '\n export ANTHROPIC_BASE_URL=connection-url' >> ~/.bashrc
echo -e '\n export ANTHROPIC_AUTH_TOKEN=your-key' >> ~/.zshrc
echo -e '\n export ANTHROPIC_BASE_URL=connection-url' >> ~/.zshrc
After restarting the terminal, directly use:
bash
cd your-project-folder
claude
You can now use Claude Code
