Claude Code

Anthropic 的 AI 编程工具。在终端中编辑文件、运行命令、管理 Git。Anthropic agentic coding tool. Edit files, run commands, manage git from your terminal.

安装Install

macOS
Linux
Windows
# Homebrew (推荐recommended)
brew install --cask claude-code

# 或使用脚本Or shell script
curl -fsSL https://claude.ai/install.sh | bash
# 脚本安装Shell script
curl -fsSL https://claude.ai/install.sh | bash

# 或使用 npmOr npm
npm install -g @anthropic-ai/claude-code
# PowerShell
irm https://claude.ai/install.ps1 | iex

# 或使用 wingetOr winget
winget install Anthropic.ClaudeCode

配置 OrcAIConfigure for OrcAI

方法 1: settings.json (推荐)Method 1: settings.json (Recommended)

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.orcai.cc",
    "ANTHROPIC_AUTH_TOKEN": "sk-your-key"
  }
}
热重载Hot-Reload: Claude Code 会自动加载更改,无需重启。Claude Code picks up changes automatically. No restart needed.

方法 2: 环境变量Method 2: Environment Variables

macOS / Linux
Windows
export ANTHROPIC_BASE_URL="https://api.orcai.cc"
export ANTHROPIC_AUTH_TOKEN="sk-your-key"
source ~/.zshrc
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.orcai.cc", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "sk-your-key", "User")

配置文件路径Config Paths

系统OS路径Path
macOS / Linux~/.claude/settings.json
Windows%USERPROFILE%\.claude\settings.json
项目级Per-project.claude/settings.json

模型Models

模型ModelID适用Best For
Claude Opus 4.7claude-opus-4-7复杂推理Complex reasoning
Claude Sonnet 4.6claude-sonnet-4-6均衡 (默认)Balanced (default)
Claude Haiku 4.5claude-haiku-4-5快速、低成本Fast, cheap