返回工具箱
AI Coding CLI

AI 编程客户端安装命令合集

Codex、Claude Code、OpenCode、Gemini CLI、Qwen Code 等常用 AI 编程工具一页整理。按工具和系统分类,复制后即可安装或检查版本。

12

客户端

73

可复制命令

3

系统分类

install.sh
$codexready
$claudeready
$opencodeready
$geminiready
$qwenready
$cursor-agentready
执行前检查

先确认来源,再复制命令;任何密钥、Token、Cookie 都不要交给陌生脚本。

快速选择

先选工具,再复制对应系统命令。

12 个客户端
只复制官方文档、官方 GitHub 或可信来源提供的安装命令。
不要把 API Key、Token、Cookie、Session Key 粘贴给陌生脚本或网页。
不要让 AI 在不可信项目目录里自动执行命令;先看清它准备做什么。

安装方式

按系统选择复制;不确定时优先看官方来源。

OpenAI GitHub
macOS / Linux
1
macOS / Linux
curl -fsSL https://chatgpt.com/codex/install.sh | sh
Windows
1
Windows PowerShell
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
其他方式
2
npm
npm install -g @openai/codex
Homebrew
brew install --cask codex

安装方式

按系统选择复制;不确定时优先看官方来源。

Claude Code Docs
macOS / Linux
1
macOS / Linux / WSL
curl -fsSL https://claude.ai/install.sh | bash
Windows
2
Windows PowerShell
irm https://claude.ai/install.ps1 | iex
Windows CMD
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
其他方式
2
Homebrew
brew install --cask claude-code
WinGet
winget install Anthropic.ClaudeCode

安装方式

按系统选择复制;不确定时优先看官方来源。

OpenCode Docs
macOS / Linux
1
安装脚本
curl -fsSL https://opencode.ai/install | bash
Windows
3
Chocolatey
choco install opencode
Scoop
scoop install opencode
npm
npm install -g opencode-ai
其他方式
5
npm
npm install -g opencode-ai
Bun
bun install -g opencode-ai
pnpm
pnpm install -g opencode-ai
Yarn
yarn global add opencode-ai
Homebrew
brew install anomalyco/tap/opencode

安装方式

按系统选择复制;不确定时优先看官方来源。

Gemini CLI GitHub
macOS / Linux
3
npm
npm install -g @google/gemini-cli
Homebrew
brew install gemini-cli
MacPorts
sudo port install gemini-cli
Windows
1
npm
npm install -g @google/gemini-cli
其他方式
1
无需安装,直接运行
npx @google/gemini-cli

安装方式

按系统选择复制;不确定时优先看官方来源。

Qwen Code GitHub
macOS / Linux
1
Linux / macOS
curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen-standalone.sh | bash
Windows
1
Windows PowerShell
irm https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen-standalone.ps1 | iex
其他方式
3
npm
npm install -g @qwen-code/qwen-code@latest

需要 Node.js 22+

Homebrew
brew install qwen-code
登录配置
/auth

安装方式

按系统选择复制;不确定时优先看官方来源。

Cursor Docs
macOS / Linux
1
macOS / Linux
curl https://cursor.com/install -fsS | bash
Windows
1
Windows
https://docs.cursor.com/en/cli/installation

Windows 安装方式请以官方 CLI 文档为准。

其他方式
1
检查版本
cursor-agent --version

安装方式

按系统选择复制;不确定时优先看官方来源。

Aider Docs
macOS / Linux
1
macOS / Linux
curl -LsSf https://aider.chat/install.sh | sh
Windows
1
Windows PowerShell
powershell -ExecutionPolicy ByPass -c "irm https://aider.chat/install.ps1 | iex"
其他方式
3
uv
python -m pip install uv
uv tool install --force --python python3.12 --with pip aider-chat@latest
pipx
python -m pip install pipx
pipx install aider-chat
pip
python -m pip install -U --upgrade-strategy only-if-needed aider-chat

安装方式

按系统选择复制;不确定时优先看官方来源。

Goose Docs
macOS / Linux
1
macOS / Linux
curl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh | bash
Windows
2
Git Bash / MSYS2 / PowerShell
curl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh | bash
PowerShell 脚本
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/block/goose/main/download_cli.ps1" -OutFile "download_cli.ps1"
.\download_cli.ps1
其他方式
3
非交互安装
curl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh | CONFIGURE=false bash
Homebrew
brew install block-goose-cli
更新
goose update

安装方式

按系统选择复制;不确定时优先看官方来源。

Continue Docs
macOS / Linux
1
macOS / Linux
curl -fsSL https://raw.githubusercontent.com/continuedev/continue/main/extensions/cli/scripts/install.sh | bash
Windows
1
Windows
https://docs.continue.dev/cli/quickstart

Windows 安装请以官方 CLI 快速开始页面为准。

其他方式
3
检查版本
cn --version
登录
cn login
Headless 示例
cn -p "Generate a conventional commit name for the current git changes"

安装方式

按系统选择复制;不确定时优先看官方来源。

Amp Manual
macOS / Linux
1
Mac / Linux / WSL
curl -fsSL https://ampcode.com/install.sh | bash
Windows
1
Windows PowerShell
powershell -c "irm https://ampcode.com/install.ps1 | iex"
其他方式
3
Homebrew
brew install ampcode/tap/ampcode
npm
npm install -g @ampcode/cli

官方说明中 npm 方式不作为首选。

更新
amp update

安装方式

按系统选择复制;不确定时优先看官方来源。

Crush GitHub
macOS / Linux
3
Homebrew
brew install charmbracelet/tap/crush
npm
npm install -g @charmland/crush
Arch Linux
yay -S crush-bin
Windows
2
WinGet
winget install charmbracelet.crush
Scoop
scoop bucket add charm https://github.com/charmbracelet/scoop-bucket.git
scoop install crush
其他方式
1
Nix
nix run github:numtide/nix-ai-tools#crush

安装方式

按系统选择复制;不确定时优先看官方来源。

Cline Docs
macOS / Linux
1
npm
npm i -g cline
Windows
1
npm
npm i -g cline
其他方式
1
启动
cline

通用检查命令

安装完成后,可以逐个检查版本或命令是否已加入 PATH。

version checks
codex --version
claude --version
opencode --version
gemini --version
qwen --version
cursor-agent --version
aider --version
goose --version
cn --version
amp --version
crush --version
cline --version

安全提醒

安装脚本会在本机执行命令。复制前先确认来源,执行前看清命令内容,涉及密钥、Token、Cookie 的内容不要随意粘贴给网页或陌生脚本。

更新时间:2026-06-19