# 安装指南

### 前置要求 <a href="#qian-zhi-yao-qiu" id="qian-zhi-yao-qiu"></a>

#### 安装 Node.js <a href="#an-zhuang-nodejs" id="an-zhuang-nodejs"></a>

CC Switch 管理的 CLI 工具（Claude Code、Codex、Gemini CLI）需要 Node.js 环境。

**推荐版本**：Node.js 18 LTS 或更高版本

**Windows**

1. 访问 [Node.js 官网](https://nodejs.org/)
2. 下载 LTS 版本安装包
3. 运行安装程序，按提示完成安装
4. 验证安装：

bash

```bash
node --version
npm --version
```

**macOS**

bash

```bash
# 使用 Homebrew 安装
brew install node

# 或使用 nvm（推荐）
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install --lts
```

**Linux**

bash

```bash
# Ubuntu/Debian
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs

# 或使用 nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install --lts
```

#### 安装 CLI 工具 <a href="#an-zhuang-cli-gong-ju" id="an-zhuang-cli-gong-ju"></a>

**Claude Code**

**方式一：Homebrew（macOS 推荐）**

bash

```bash
brew install claude-code
```

**方式二：npm**

bash

```bash
npm install -g @anthropic-ai/claude-code

# 国内用户如下载慢，使用镜像源
npm install -g @anthropic-ai/claude-code --registry=https://registry.npmmirror.com
```

**Codex**

**方式一：Homebrew（macOS 推荐）**

bash

```bash
brew install codex
```

**方式二：npm**

bash

```bash
npm install -g @openai/codex

# 国内用户如下载慢，使用镜像源
npm install -g @openai/codex --registry=https://registry.npmmirror.com
```

**Gemini CLI**

**方式一：Homebrew（macOS 推荐）**

bash

```bash
brew install gemini-cli
```

**方式二：npm**

bash

```bash
npm install -g @google/gemini-cli

# 国内用户如下载慢，使用镜像源
npm install -g @google/gemini-cli --registry=https://registry.npmmirror.com
```

> 💡 **提示**：如果经常遇到下载慢的问题，可以全局设置镜像源：
>
> bash
>
> ```bash
> npm config set registry https://registry.npmmirror.com
> ```

***

### Windows <a href="#windows" id="windows"></a>

#### 安装包方式 <a href="#an-zhuang-bao-fang-shi" id="an-zhuang-bao-fang-shi"></a>

1. 访问 [Releases 页面](https://github.com/farion1231/cc-switch/releases)
2. 下载 `CC-Switch-v{版本号}-Windows.msi`
3. 双击运行安装程序
4. 按提示完成安装

#### 绿色版（免安装） <a href="#l-se-ban-mian-an-zhuang" id="l-se-ban-mian-an-zhuang"></a>

1. 下载 `CC-Switch-v{版本号}-Windows-Portable.zip`
2. 解压到任意目录
3. 运行 `CC-Switch.exe`

### macOS <a href="#macos" id="macos"></a>

#### 方式一：Homebrew（推荐） <a href="#fang-shi-yi-homebrew-tui-jian" id="fang-shi-yi-homebrew-tui-jian"></a>

bash

```bash
# 添加 tap
brew tap farion1231/ccswitch

# 安装
brew install --cask cc-switch
```

更新到最新版本：

bash

```bash
brew upgrade --cask cc-switch
```

#### 方式二：手动下载 <a href="#fang-shi-er-shou-dong-xia-zai" id="fang-shi-er-shou-dong-xia-zai"></a>

1. 下载 `CC-Switch-v{版本号}-macOS.zip`
2. 解压得到 `CC Switch.app`
3. 拖动到「应用程序」文件夹

#### 已签名并公证 <a href="#yi-qian-ming-bing-gong-zheng" id="yi-qian-ming-bing-gong-zheng"></a>

CC Switch macOS 版本已通过 Apple 代码签名和公证，可直接安装打开，无需额外操作。

### Linux <a href="#linux" id="linux"></a>

#### ArchLinux <a href="#archlinux" id="archlinux"></a>

使用 AUR 助手安装：

bash

```bash
# 使用 paru
paru -S cc-switch-bin

# 或使用 yay
yay -S cc-switch-bin
```

#### Debian / Ubuntu <a href="#debian-ubuntu" id="debian-ubuntu"></a>

1. 下载 `CC-Switch-v{版本号}-Linux.deb`
2. 安装：

bash

```bash
sudo dpkg -i CC-Switch-v{版本号}-Linux.deb

# 如果有依赖问题
sudo apt-get install -f
```

#### AppImage（通用） <a href="#appimage-tong-yong" id="appimage-tong-yong"></a>

1. 下载 `CC-Switch-v{版本号}-Linux.AppImage`
2. 添加执行权限：

bash

```bash
chmod +x CC-Switch-v{版本号}-Linux.AppImage
```

1. 运行：

bash

```bash
./CC-Switch-v{版本号}-Linux.AppImage
```

### 验证安装 <a href="#yan-zheng-an-zhuang" id="yan-zheng-an-zhuang"></a>

安装完成后，启动 CC Switch：

1. 应用窗口正常显示
2. 系统托盘出现 CC Switch 图标
3. 能够切换 Claude / Codex / Gemini 三个应用

### 自动更新 <a href="#zi-dong-geng-xin" id="zi-dong-geng-xin"></a>

CC Switch 内置自动更新功能：

* 启动时自动检查更新
* 有新版本时在界面显示更新提示
* 点击即可下载并安装

也可以在「设置 → 关于」中手动检查更新。

### 卸载 <a href="#xie-zai" id="xie-zai"></a>

#### Windows <a href="#windows" id="windows"></a>

* 通过「设置 → 应用」卸载
* 或运行安装目录下的卸载程序

#### macOS <a href="#macos" id="macos"></a>

* 将 `CC Switch.app` 移到废纸篓
* 可选：删除配置目录 `~/.cc-switch/`

#### Linux <a href="#linux" id="linux"></a>

bash

```bash
# Debian/Ubuntu
sudo apt remove cc-switch

# ArchLinux
paru -R cc-switch-bin
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.flytoken.vip/documentation/ccswitch-jiao-cheng/an-zhuang-zhi-nan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
