This section covers the complete installation process for Claude Code CLI on macOS and Windows, and how to connect to the DDShub relay node.
Mac Installation
Install Node.js via Brew
Claude Code requires Node.js. We recommend using Homebrew to manage Node.js versions.
Install Homebrew
# Download and install Homebrew
curl -o- https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | bashInstall Node.js
# Download and install Node.js
brew install node
# Check Node.js version
node -v
# Check NPM version
npm -vInstall Claude Code
Claude Code is the official AI coding CLI tool from Anthropic, installed globally via npm.
Install Claude Code CLI globally
npm install -g @anthropic-ai/claude-codeVerify installation
claude --version
# Claude Code x.x.xIf you encounter permission errors, prefix the command with sudo, or configure the npm global directory to your user directory.
Run health check
claude doctorThis command checks your environment configuration, including API connectivity.
npm config set registry https://registry.npmmirror.comv2.1.68 or above is required.Configure AUTH_TOKEN & BASE_URL
Configure the DDShub API relay so Claude Code connects to Anthropic services through our accelerated endpoint.
Method 1: Environment Variables (Recommended)
Add the following to your shell config (~/.zshrc or ~/.bashrc):
# DDShub - Claude Code relay config
export ANTHROPIC_AUTH_TOKEN="sk-xxxxxxxxxxxxxxxx" # Replace with your API Key
export ANTHROPIC_BASE_URL="https://www.ddshub.cc"After saving, reload the config:
source ~/.zshrc
# Verify config
echo $ANTHROPIC_AUTH_TOKEN
echo $ANTHROPIC_BASE_URLMethod 2: Interactive Login
Run the claude command directly and the CLI will guide you through setup:
claude
# You will be prompted to enter:
# > Enter your API key: sk-xxx
# > Enter API base URL (optional): https://www.ddshub.ccVerify Connection
After configuration, run in any project directory:
claude "Hello, introduce yourself in one sentence"
# Expected output:
# I am Claude, an AI assistant made by Anthropic.Windows Installation
Install Node.js via PowerShell
We recommend installing Node.js via the Chocolatey package manager for easy version management.
Open PowerShell as Administrator
Right-click the Start menu → select "Windows PowerShell (Admin)" or "Terminal (Admin)".
Install Chocolatey and Node.js
# Download and install Chocolatey
powershell -c "irm https://community.chocolatey.org/install.ps1|iex"
# Install Node.js via Chocolatey
choco install nodejs --version="24.13.0"
# Check Node.js version
node -v
# Check NPM version
npm -vInstall Claude Code
Once Node.js is installed, install Claude Code CLI globally via npm.
Install Claude Code CLI globally
npm install -g @anthropic-ai/claude-codeVerify installation
claude --version
# Claude Code x.x.xIf you encounter permission errors, reopen PowerShell as Administrator.
npm config set registry https://registry.npmmirror.comv2.1.68 or above is required.Configure AUTH_TOKEN & BASE_URL
On Windows, we recommend persisting the config via System Environment Variables or a PowerShell Profile.
Method 1: PowerShell Profile (Recommended)
Run the following in PowerShell to open your Profile file:
# Show Profile path
echo $PROFILE
# Edit Profile (creates it if it does not exist)
notepad $PROFILEAdd the following to the end of the file and save:
# DDShub - Claude Code relay config
$env:ANTHROPIC_AUTH_TOKEN = "sk-xxxxxxxxxxxxxxxx" # Replace with your API Key
$env:ANTHROPIC_BASE_URL = "https://www.ddshub.cc"Reopen PowerShell for the config to take effect, or run immediately:
. $PROFILEMethod 2: System Environment Variables (GUI)
Suitable for users who prefer a GUI:
Open System Environment Variables
Right-click "This PC" → "Properties" → "Advanced system settings" → "Environment Variables", or search for "environment variables" in the Start menu.
Create New User Variables
In the "User variables" section, click "New" and add:
Restart terminal and verify
echo $env:ANTHROPIC_AUTH_TOKEN
echo $env:ANTHROPIC_BASE_URLVerify Connection
After configuration, run in any project directory:
claude "Hello, introduce yourself in one sentence"
# Expected output:
# I am Claude, an AI assistant made by Anthropic.