diff --git a/docs/cherry-studio-nanobana.md b/docs/cherry-studio-nanobana.md index f46f60d..405c345 100644 --- a/docs/cherry-studio-nanobana.md +++ b/docs/cherry-studio-nanobana.md @@ -72,13 +72,11 @@ Cherry Studio 是一款支持多服务商集成的 AI 对话客户端,目前 > 💡 **提示:** > > - `aspectRatio` 可选值:`16:9`、`4:3`、`1:1` 等 -> - `imageSize` 可选值:`4K`、`2K`、`1K` 等(K必须是大写) +> - `imageSize` 可选值:`4K`、`2K`、`1K` 等(K 必须是大写) > - 详情请参考:[Google Gemini API 文档](https://ai.google.dev/gemini-api/docs/image-generation?hl=zh-cn#aspect_ratios_and_image_size)  - - --- ## 六、提醒 @@ -99,4 +97,4 @@ Cherry Studio 是一款支持多服务商集成的 AI 对话客户端,目前 2. 添加提供商:名称填 `XCodeCLI`,类型选 `Gemini` 3. 填写 API Key 和地址 `https://api2.xcodecli.com` 4. 生成高清图时:关闭流式输出 + 配置自定义参数 -5. 优先使用 Gemini 系列模型,避开天价的 Claude 和 GPT 系列 +5. 优先使用 Gemini 系列模型,暂不支持 Claude、GPT 系列模型 diff --git a/docs/guide/claude-code.md b/docs/guide/claude-code.md new file mode 100644 index 0000000..9484b7e --- /dev/null +++ b/docs/guide/claude-code.md @@ -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。 diff --git a/docs/guide/codex.md b/docs/guide/codex.md new file mode 100644 index 0000000..1311f9a --- /dev/null +++ b/docs/guide/codex.md @@ -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 配置。 diff --git a/docs/guide/gemini-cli.md b/docs/guide/gemini-cli.md new file mode 100644 index 0000000..b7730f6 --- /dev/null +++ b/docs/guide/gemini-cli.md @@ -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 端点。 diff --git a/docs/guide/index.md b/docs/guide/index.md index 6f77258..b00ce47 100644 --- a/docs/guide/index.md +++ b/docs/guide/index.md @@ -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. 显示最终配置结果 +### 脚本执行流程 -
你的密钥 替换为你的 API 密钥
-运行一条命令,自动安装并配置 Claude Code、Gemini CLI、Codex
+适用于 Claude Code、Gemini CLI 和 Codex 的自动化配置。
{{ commands[activeTab] }}
+ {{ commands[activeTab] }}
-💡 提示:运行前请将命令中的 你的密钥 替换为实际 API Key
💡 提示:将命令中的 你的密钥 替换为你的实际 API 密钥
在 Cherry Studio 中使用 XCodeCLI 服务,享受可视化的对话体验。
+ +::: danger ⚠️ 重要提示:模型兼容性 +**Cherry Studio 仅支持 Gemini 系列模型!** + +- ❌ **Claude 模型**:暂不支持在 Cherry Studio 中使用(请在 Claude Code 内使用) +- ❌ **GPT 模型**:暂不支持在 Cherry Studio 中使用(请在 Codex 内使用) +- ✅ **Gemini 模型**:完美支持 + ::: + +### 配置参数 + +请在 Cherry Studio 设置中添加 **自定义提供商**: + +| 配置项 | 值 | 说明 | +| :------------- | :-------------------------- | :----------------------- | +| **提供商类型** | `Gemini` | **必选** (不要选 OpenAI) | +| **API 密钥** | `sk-...` | 你的 XCodeCLI 密钥 | +| **API 地址** | `https://api2.xcodecli.com` | Base URL | + +::: tip 📝 详细教程 +查看完整的 [Cherry Studio 图文配置指南](/cherry-studio-nanobana) +::: + +