更新首页与指南文档
All checks were successful
Deploy to Cloudflare Pages / deploy (push) Successful in 33s
All checks were successful
Deploy to Cloudflare Pages / deploy (push) Successful in 33s
This commit is contained in:
44
docs/guide/claude-code.md
Normal file
44
docs/guide/claude-code.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# Claude Code 配置指南
|
||||
|
||||
Claude Code 是 Anthropic 推出的 AI 编码助手。通过 XCodeCLI,你可以将其连接到自定义 API 端点。
|
||||
|
||||
## 快速安装与配置
|
||||
|
||||
使用下面的单一行命令即可自动完成安装和配置。
|
||||
|
||||
::: code-group
|
||||
|
||||
```bash [macOS / Linux]
|
||||
API_KEY='你的密钥' bash -c "$(curl -fsSL https://gitea.sususu.cf/sususu/xcodecli-shells/raw/branch/main/ClaudeCode/setup-claude-code.sh)"
|
||||
```
|
||||
|
||||
```powershell [Windows]
|
||||
$key='你的密钥'; iwr -useb https://gitea.sususu.cf/sususu/xcodecli-shells/raw/branch/main/ClaudeCode/setup-claude-code.ps1 | iex
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
> 请将命令中的 `你的密钥` 替换为你的实际 API 密钥。
|
||||
|
||||
## 手动配置说明
|
||||
|
||||
如果你想手动配置,Claude Code 的配置文件位于:
|
||||
|
||||
- **macOS / Linux**: `~/.claude/settings.json`
|
||||
- **Windows**: `~/.claude/settings.json` (位于用户主目录下)
|
||||
|
||||
配置内容示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"apiBaseUrl": "https://api2.xcodecli.com",
|
||||
"apiKey": "sk-your-key-here"
|
||||
}
|
||||
```
|
||||
|
||||
## 常见问题
|
||||
|
||||
- **Q: 安装后无法使用?**
|
||||
- A: 确保你已安装 Node.js (推荐 v18+)。
|
||||
- **Q: 权限错误?**
|
||||
- A: 在 macOS/Linux 上可能需要 `sudo` 权限来安装全局 npm 包,但我们的脚本尝试使用非 root 方式或引导安装 fnm。
|
||||
41
docs/guide/codex.md
Normal file
41
docs/guide/codex.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# Codex 配置指南
|
||||
|
||||
Codex 是一个强大的代码生成和补全工具。
|
||||
|
||||
## 快速安装与配置
|
||||
|
||||
使用下面的单一行命令即可自动完成安装和配置。
|
||||
|
||||
::: code-group
|
||||
|
||||
```bash [macOS / Linux]
|
||||
API_KEY='你的密钥' bash -c "$(curl -fsSL https://gitea.sususu.cf/sususu/xcodecli-shells/raw/branch/main/codex/setup-codex.sh)"
|
||||
```
|
||||
|
||||
```powershell [Windows]
|
||||
$key='你的密钥'; iwr -useb https://gitea.sususu.cf/sususu/xcodecli-shells/raw/branch/main/codex/setup-codex.ps1 | iex
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
> 请将命令中的 `你的密钥` 替换为你的实际 API 密钥。
|
||||
|
||||
## 手动配置说明
|
||||
|
||||
Codex 的配置文件通常位于 `~/.codex/config.toml`。
|
||||
|
||||
配置示例 (TOML):
|
||||
|
||||
```toml
|
||||
[server]
|
||||
url = "https://api2.xcodecli.com"
|
||||
token = "sk-your-key-here"
|
||||
|
||||
[editor]
|
||||
completion = true
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
- Codex 需要支持 TOML 格式的配置文件。
|
||||
- 确保你的编辑器插件已正确指向本地的 Codex 配置。
|
||||
37
docs/guide/gemini-cli.md
Normal file
37
docs/guide/gemini-cli.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# Gemini CLI 配置指南
|
||||
|
||||
Gemini CLI 是 Google 的 AI 命令行工具。通过 XCodeCLI,你可以无缝切换到自定义 API 源。
|
||||
|
||||
## 快速安装与配置
|
||||
|
||||
使用下面的单一行命令即可自动完成安装和配置。
|
||||
|
||||
::: code-group
|
||||
|
||||
```bash [macOS / Linux]
|
||||
API_KEY='你的密钥' bash -c "$(curl -fsSL https://gitea.sususu.cf/sususu/xcodecli-shells/raw/branch/main/GeminiCLI/setup-gemini.sh)"
|
||||
```
|
||||
|
||||
```powershell [Windows]
|
||||
$key='你的密钥'; iwr -useb https://gitea.sususu.cf/sususu/xcodecli-shells/raw/branch/main/GeminiCLI/setup-gemini.ps1 | iex
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
> 请将命令中的 `你的密钥` 替换为你的实际 API 密钥。
|
||||
|
||||
## 手动配置说明
|
||||
|
||||
Gemini CLI 通常使用环境变量或 `.env` 文件进行配置。XCodeCLI 脚本配置的位置通常为 `~/.gemini/.env`。
|
||||
|
||||
关键环境变量:
|
||||
|
||||
```env
|
||||
GEMINI_API_KEY=sk-your-key-here
|
||||
GEMINI_API_BASE=https://api2.xcodecli.com
|
||||
```
|
||||
|
||||
## 使用技巧
|
||||
|
||||
- 使用 `gemini` 开始对话。
|
||||
- 确保你的网络环境可以连接到配置的 API 端点。
|
||||
@@ -1,14 +1,22 @@
|
||||
# 快速开始
|
||||
|
||||
欢迎使用 **XCodeCLI** 配置工具。本指南将帮助你快速配置常用的 AI CLI 工具,使其连接到 XCodeCLI 的 API 端点。
|
||||
|
||||
## 前置要求
|
||||
|
||||
- 有效的 XCodeCLI API 密钥
|
||||
- macOS / Linux: `curl` 和 `bash`
|
||||
- Windows: PowerShell 5.1+
|
||||
在开始之前,请确保你拥有:
|
||||
|
||||
## 一键安装配置(推荐)
|
||||
- **有效的 XCodeCLI API 密钥** (通常以 `sk-` 开头)
|
||||
- **网络连接**:能够访问我们的 API 端点 (`https://api2.xcodecli.com` 或 `https://api.xcodecli.com`)
|
||||
|
||||
运行一条命令,自动安装并配置全部三个工具:
|
||||
对于操作系统环境:
|
||||
|
||||
- **macOS / Linux**: 需要 `curl` 和 `bash` 环境。
|
||||
- **Windows**: 需要 PowerShell 5.1 或更高版本。
|
||||
|
||||
## 全自动一键配置(推荐)
|
||||
|
||||
这是最简单的方法。运行一条命令,脚本会自动检测、安装并配置 **Claude Code**、**Gemini CLI** 和 **Codex**。
|
||||
|
||||
::: code-group
|
||||
|
||||
@@ -22,59 +30,29 @@ $key='你的密钥'; iwr -useb https://gitea.sususu.cf/sususu/xcodecli-shells/ra
|
||||
|
||||
:::
|
||||
|
||||
脚本会自动:
|
||||
> 💡 **提示**:请将命令中的 `你的密钥` 替换为你的实际 API 密钥。
|
||||
|
||||
1. 检测 Node.js / Bun 包管理器,缺失时引导安装 Bun
|
||||
2. 显示三个工具的安装状态
|
||||
3. 依次安装并配置 Claude Code、Gemini CLI、Codex
|
||||
4. 显示最终配置结果
|
||||
### 脚本执行流程
|
||||
|
||||
<div class="tip custom-block" style="padding-top: 8px">
|
||||
将命令中的 <code>你的密钥</code> 替换为你的 API 密钥
|
||||
</div>
|
||||
1. **环境检测**:检查 Node.js 等必要运行时。如果缺失,脚本会尝试引导安装(如 fnm)。
|
||||
2. **工具状态检查**:显示当前已安装的工具及其版本。
|
||||
3. **自动化配置**:依次为检测到的或默认的工具写入配置文件(备份原有配置)。
|
||||
4. **验证连接**:简单的 API 连接测试(部分脚本支持)。
|
||||
5. **结果汇总**:显示所有配置文件的路径和最终状态。
|
||||
|
||||
## 单独配置某个工具
|
||||
## 单独配置
|
||||
|
||||
如果只需要配置其中一个工具,可以使用单独的脚本:
|
||||
如果你只需要配置特定的工具,或者想了解每个工具的详细配置参数,请参考以下指南:
|
||||
|
||||
### Claude Code
|
||||
- [Claude Code 配置指南](/guide/claude-code)
|
||||
- [Gemini CLI 配置指南](/guide/gemini-cli)
|
||||
- [Codex 配置指南](/guide/codex)
|
||||
|
||||
::: code-group
|
||||
## API 端点说明
|
||||
|
||||
```bash [macOS / Linux]
|
||||
API_KEY='你的密钥' bash -c "$(curl -fsSL https://gitea.sususu.cf/sususu/xcodecli-shells/raw/branch/main/ClaudeCode/setup-claude-code.sh)"
|
||||
```
|
||||
我们的配置脚本会自动测试并选择最快的可用端点:
|
||||
|
||||
```powershell [Windows]
|
||||
$key='你的密钥'; iwr -useb https://gitea.sususu.cf/sususu/xcodecli-shells/raw/branch/main/ClaudeCode/setup-claude-code.ps1 | iex
|
||||
```
|
||||
1. `https://api2.xcodecli.com` (主要,优先尝试)
|
||||
2. `https://api.xcodecli.com` (备用)
|
||||
|
||||
:::
|
||||
|
||||
### Gemini CLI
|
||||
|
||||
::: code-group
|
||||
|
||||
```bash [macOS / Linux]
|
||||
API_KEY='你的密钥' bash -c "$(curl -fsSL https://gitea.sususu.cf/sususu/xcodecli-shells/raw/branch/main/GeminiCLI/setup-gemini.sh)"
|
||||
```
|
||||
|
||||
```powershell [Windows]
|
||||
$key='你的密钥'; iwr -useb https://gitea.sususu.cf/sususu/xcodecli-shells/raw/branch/main/GeminiCLI/setup-gemini.ps1 | iex
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
### Codex
|
||||
|
||||
::: code-group
|
||||
|
||||
```bash [macOS / Linux]
|
||||
API_KEY='你的密钥' bash -c "$(curl -fsSL https://gitea.sususu.cf/sususu/xcodecli-shells/raw/branch/main/codex/setup-codex.sh)"
|
||||
```
|
||||
|
||||
```powershell [Windows]
|
||||
$key='你的密钥'; iwr -useb https://gitea.sususu.cf/sususu/xcodecli-shells/raw/branch/main/codex/setup-codex.ps1 | iex
|
||||
```
|
||||
|
||||
:::
|
||||
所有的工具都会统一配置使用同一个有效的 API 端点。
|
||||
|
||||
Reference in New Issue
Block a user