主题
安装指南
本页提供 Claude Code 和 Codex CLI 的详细安装教程,包括国内网络优化建议。
快速开始
在控制台一键配置里选好客户端与系统平台,安装、配置与验证命令会一次生成。
Claude Code
选择下载源
国内网络请用「本站下载」:脚本已做断点续传、下载进度和离线收尾,全程不访问 downloads.claude.ai。
国内网络请用「本站下载」。 官方脚本要访问 downloads.claude.ai 取版本并验签名,墙内会失败;能直连的用户再用「官方下载」。
已针对国内网络优化:断点续传、下载进度、离线收尾;客户端装有 zstd 时只需下载约 80MB。
Linux / macOS
curl -fsSL https://download.entropicecho.com/downloads/claude-code/scripts/install.sh | bashWindows PowerShell
Invoke-WebRequest -Uri "https://download.entropicecho.com/downloads/claude-code/scripts/install.ps1" | Invoke-ExpressionWindows CMD
curl -fsSL https://download.entropicecho.com/downloads/claude-code/scripts/install.cmd -o install.cmd && install.cmd && del install.cmd需要能直连 claude.ai。命令与官方文档一致,安装后由官方脚本自行保持更新。
Linux / macOS
curl -fsSL https://claude.ai/install.sh | bashWindows PowerShell
irm https://claude.ai/install.ps1 | iexWindows CMD
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd其他安装方式
Homebrew (macOS/Linux):
bash
# 稳定版
brew install --cask claude-code
# 最新版
brew install --cask claude-code@latest1
2
3
4
5
2
3
4
5
npm (跨平台):
bash
# 默认源
npm install -g @anthropic-ai/claude-code
# 国内可换淘宝 npm 镜像源
npm install -g @anthropic-ai/claude-code --registry=https://registry.npmmirror.com1
2
3
4
5
2
3
4
5
WinGet (Windows):
powershell
winget install Anthropic.ClaudeCode1
验证安装
bash
claude --version1
成功安装后会显示版本号,例如:2.1.274 (Claude Code)
Codex CLI
Codex 是 OpenAI 推出的命令行编程助手。
选择下载源
国内网络请用「本站下载」:脚本内所有下载地址都指向本站镜像,全程不访问 chatgpt.com。
国内网络请用「本站下载」。 官方脚本要访问 chatgpt.com 取版本并验签名,墙内会失败;能直连的用户再用「官方下载」。
已针对国内网络优化:断点续传、下载进度;脚本内所有下载地址都指向本站镜像。
Linux / macOS
curl -fsSL https://download.entropicecho.com/downloads/codex/scripts/install.sh | shWindows PowerShell
Invoke-WebRequest -Uri "https://download.entropicecho.com/downloads/codex/scripts/install.ps1" | Invoke-Expression需要能直连 chatgpt.com。官方没有提供 Windows CMD 脚本,Windows 用 PowerShell。
Linux / macOS
curl -fsSL https://chatgpt.com/codex/install.sh | shWindows PowerShell
irm https://chatgpt.com/codex/install.ps1 | iex其他安装方式
Homebrew:
bash
brew install --cask codex1
npm:
bash
# 默认源
npm install -g @openai/codex
# 国内可换淘宝 npm 镜像源
npm install -g @openai/codex --registry=https://registry.npmmirror.com1
2
3
4
5
2
3
4
5
验证安装
bash
codex --version1
常见问题
安装失败:网络超时
问题:curl: (7) Failed to connect to ... Connection timed out
解决方法:
- 检查网络连接
- 换用上文本站下载的命令:官方脚本要访问
downloads.claude.ai/chatgpt.com,墙内会直接失败 - 尝试使用 npm 安装方式
- 换个时间段重试
权限错误
问题:Permission denied 或 EACCES
解决方法:
bash
# 不要使用 sudo!这些工具会自动安装到用户目录
# 如果之前使用了 sudo,先清理:
sudo rm -rf ~/.claude ~/.codex
sudo rm -f ~/.local/bin/claude ~/.local/bin/codex
# 然后正常安装(本站下载)
curl -fsSL https://download.entropicecho.com/downloads/claude-code/scripts/install.sh | bash1
2
3
4
5
6
7
2
3
4
5
6
7
macOS 安全提示
问题:macOS 提示"无法验证开发者"
解决方法:
bash
# 允许运行
xattr -d com.apple.quarantine ~/.local/bin/claude1
2
2
Windows Defender 警告
问题:Windows Defender 拦截下载
解决方法:
- 临时禁用实时保护
- 将
.claude目录添加到排除列表 - 下载完成后重新启用保护
配置说明
安装完成后,请访问:
更新与卸载
更新
国内网络
claude update / codex update 会访问官方域名(硬编码在二进制里),墙内会失败。国内用户更新请直接重跑本站的安装脚本,脚本会检测到已安装并升级到镜像版本。
Claude Code:
bash
# 自动更新(推荐)
claude update
# Homebrew
brew upgrade claude-code
# npm
npm install -g @anthropic-ai/claude-code@latest1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Codex:
bash
# 自动更新
codex update
# Homebrew
brew upgrade codex
# npm
npm install -g @openai/codex@latest1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
卸载
Claude Code:
bash
# 删除二进制文件
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
# 删除配置(可选)
rm -rf ~/.claude1
2
3
4
5
6
2
3
4
5
6
Codex:
bash
# 删除二进制文件
rm -f ~/.local/bin/codex
rm -rf ~/.codex1
2
3
2
3