usage.json 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731
  1. {
  2. "pageTitle": "Claude Code Hub 使用文档",
  3. "pageDescription": "完整的 Claude Code、Codex 和 Droid CLI 集成指南",
  4. "skipLinks": {
  5. "mainContent": "跳转到主要内容",
  6. "tableOfContents": "跳转到目录导航"
  7. },
  8. "navigation": {
  9. "tableOfContents": "本页导航",
  10. "tableOfContentsEmpty": "本页暂无可用章节",
  11. "quickLinks": "快速链接",
  12. "backToDashboard": "返回仪表盘",
  13. "backToTop": "回到顶部",
  14. "documentNavigation": "文档导航",
  15. "openTableOfContents": "打开目录导航",
  16. "pageNavigation": "页面导航"
  17. },
  18. "codeExamples": {
  19. "label": "代码示例 - {language}",
  20. "description": "点击代码块可复制到剪贴板"
  21. },
  22. "claudeCode": {
  23. "title": "Claude Code 使用指南",
  24. "description": "Claude Code 是 Anthropic 官方推出的 AI 编程助手,支持通过 cch 代理服务使用。本指南将帮助您在不同操作系统上完成安装和配置。",
  25. "environmentSetup": {
  26. "title": "环境准备:安装 Node.js",
  27. "description": "claude 需要 Node.js 环境才能运行(需 v18 或更高版本)。",
  28. "macos": {
  29. "homebrew": "方法一:使用 Homebrew(推荐)",
  30. "official": "方法二:官网下载",
  31. "officialSteps": [
  32. "访问 https://nodejs.org/",
  33. "下载适合 macOS 的 LTS 版本(需 v18 或更高)",
  34. "打开下载的 .pkg 文件,按照安装向导完成"
  35. ]
  36. },
  37. "windows": {
  38. "official": "方法一:官网下载(推荐)",
  39. "officialSteps": [
  40. "访问 https://nodejs.org/",
  41. "下载 LTS 版本(需 v18 或更高)",
  42. "双击 .msi 文件,按向导安装(保持默认设置)"
  43. ],
  44. "packageManager": "方法二:使用包管理器",
  45. "note": "建议使用 PowerShell 而不是 CMD,以获得更好的体验"
  46. },
  47. "linux": {
  48. "official": "方法一:使用官方仓库(推荐)",
  49. "packageManager": "方法二:使用系统包管理器"
  50. },
  51. "verification": {
  52. "title": "验证 Node.js 安装",
  53. "description": "安装完成后,打开终端/命令行,输入以下命令验证:",
  54. "success": "如果显示版本号,说明安装成功了!",
  55. "command1": "node --version",
  56. "command2": "npm --version"
  57. }
  58. },
  59. "installation": {
  60. "title": "安装 claude",
  61. "nativeInstall": {
  62. "title": "Native Install(推荐)",
  63. "description": "官方推荐使用 Native 安装方式,具有以下优势:",
  64. "advantages": ["单个可执行文件,无需 Node.js 依赖", "自动更新机制更稳定", "启动速度更快"],
  65. "macos": {
  66. "homebrew": "方法一:Homebrew(推荐)",
  67. "autoUpdate": "自动更新说明",
  68. "autoUpdateText": "通过 Homebrew 安装的 Claude Code 会在 brew 目录外自动更新,除非使用 DISABLE_AUTOUPDATER 环境变量显式禁用。",
  69. "curl": "方法二:curl 脚本",
  70. "curls": [
  71. "# 安装稳定版(默认)",
  72. "curl -fsSL https://claude.ai/install.sh | bash",
  73. "",
  74. "# 安装最新版",
  75. "curl -fsSL https://claude.ai/install.sh | bash -s latest",
  76. "",
  77. "# 安装指定版本",
  78. "curl -fsSL https://claude.ai/install.sh | bash -s 1.0.58"
  79. ]
  80. },
  81. "linux": {
  82. "curl": "curl 脚本安装",
  83. "curls": [
  84. "# 安装稳定版(默认)",
  85. "curl -fsSL https://claude.ai/install.sh | bash",
  86. "",
  87. "# 安装最新版",
  88. "curl -fsSL https://claude.ai/install.sh | bash -s latest",
  89. "",
  90. "# 安装指定版本",
  91. "curl -fsSL https://claude.ai/install.sh | bash -s 1.0.58"
  92. ],
  93. "alpine": "Alpine Linux 特殊说明",
  94. "alpineText": "基于 musl/uClibc 的发行版(如 Alpine Linux)需要安装额外依赖:",
  95. "alpineCode": ["apk add libgcc libstdc++ ripgrep", "export USE_BUILTIN_RIPGREP=0"]
  96. },
  97. "windows": {
  98. "powershell": "方法一:PowerShell",
  99. "powershells": [
  100. "# 安装稳定版(默认)",
  101. "irm https://claude.ai/install.ps1 | iex",
  102. "",
  103. "# 安装最新版",
  104. "& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) latest",
  105. "",
  106. "# 安装指定版本",
  107. "& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) 1.0.58"
  108. ],
  109. "cmd": "方法二:CMD",
  110. "cmds": [
  111. "REM 安装稳定版(默认)",
  112. "curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd",
  113. "",
  114. "REM 安装最新版",
  115. "curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd latest && del install.cmd",
  116. "",
  117. "REM 安装指定版本",
  118. "curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd 1.0.58 && del install.cmd"
  119. ]
  120. },
  121. "verification": {
  122. "title": "验证安装",
  123. "description": "安装完成后,运行以下命令验证:",
  124. "success": "如果显示版本号,恭喜!Claude Code 已成功安装。",
  125. "command": "claude --version"
  126. },
  127. "tip": "提示",
  128. "tipText": "安装前请确保移除任何过期的别名或符号链接。使用 claude doctor 命令可以检查安装类型和版本。"
  129. },
  130. "npmInstall": {
  131. "title": "NPM",
  132. "description": "使用 NPM 安装需要先安装 Node.js 18 或更高版本。适合偏好使用 NPM 管理工具的开发者。",
  133. "command": "npm install -g @anthropic-ai/claude-code",
  134. "warning": "警告",
  135. "warningText": "不要使用 sudo npm install -g,这可能导致权限问题和安全风险。如果遇到权限错误,请参考 NPM 官方解决方案。",
  136. "verification": {
  137. "title": "验证安装",
  138. "description": "验证安装",
  139. "success": "如果显示版本号,恭喜!Claude Code 已成功安装。"
  140. },
  141. "migration": {
  142. "title": "迁移到 Native Install",
  143. "description": "如果你已通过 NPM 全局安装,可以使用以下命令迁移到 Native 安装:",
  144. "command": "claude install",
  145. "note": "部分用户可能会被自动迁移到这种安装方式。"
  146. }
  147. }
  148. },
  149. "configuration": {
  150. "title": "连接 cch 服务",
  151. "settingsJson": {
  152. "title": "方法一:settings.json 配置(推荐)",
  153. "description": "配置文件路径:",
  154. "pathNote": "路径说明",
  155. "paths": [
  156. "Windows:C:/Users/你的用户名/.claude",
  157. "Linux 或 macOS:~/.claude",
  158. "如果 settings.json 文件不存在,请自行创建"
  159. ],
  160. "instruction": "编辑 settings.json 文件,添加以下内容:",
  161. "important": "重要提示",
  162. "importantPoints": [
  163. "将 your-api-key-here 替换为您的实际 API 密钥",
  164. "密钥获取方式:登录控制台 → API 密钥管理 → 创建密钥"
  165. ]
  166. },
  167. "envVars": {
  168. "title": "方法二:环境变量配置",
  169. "windows": {
  170. "temporary": "临时设置(当前会话):",
  171. "permanent": "永久设置(用户级):",
  172. "note": "设置后需要重新打开 PowerShell 窗口才能生效。"
  173. },
  174. "unix": {
  175. "temporary": "临时设置(当前会话):",
  176. "permanent": "永久设置:",
  177. "permanentNote": "添加到您的 shell 配置文件({shellConfig}):"
  178. }
  179. },
  180. "verification": {
  181. "title": "验证配置",
  182. "description": "配置完成后,验证环境变量是否设置成功:",
  183. "windowsPowerShell": "在 PowerShell 中执行:",
  184. "windowsCmd": "在 CMD 中执行:",
  185. "expectedOutput": "预期输出示例:",
  186. "note": "注意",
  187. "noteText": "如果输出为空或显示变量名本身,说明环境变量设置失败,请重新按照上述步骤设置。"
  188. }
  189. },
  190. "vsCodeExtension": {
  191. "title": "VS Code 扩展配置",
  192. "steps": [
  193. "在 VS Code 扩展中搜索并安装 Claude Code for VS Code",
  194. "在 ~/.claude 目录下创建 config.json 文件(如果没有)",
  195. "添加以下内容:"
  196. ],
  197. "configPath": "配置文件路径:{path}",
  198. "note": "注意",
  199. "notePoints": [
  200. "是 config.json,不是 settings.json",
  201. "primaryApiKey 字段值可以为任意内容,只要存在即可"
  202. ]
  203. },
  204. "startup": {
  205. "title": "启动 claude",
  206. "description": "在项目目录下运行:",
  207. "initNote": "首次启动时,claude 会进行初始化配置。"
  208. },
  209. "commonIssues": {
  210. "title": "常见问题",
  211. "commandNotFound": "1. 命令未找到",
  212. "commandNotFoundWindows": [
  213. "确保 npm 全局路径(通常是 C:\\Users\\你的用户名\\AppData\\Roaming\\npm)已添加到系统 PATH",
  214. "重新打开 PowerShell 窗口"
  215. ],
  216. "commandNotFoundUnix": "检查 npm 全局安装路径并添加到 PATH(如果不在)",
  217. "connectionFailed": "2. API 连接失败",
  218. "updateCli": "3. 更新 claude",
  219. "updateNote": "重新运行安装脚本即可更新到最新版本。"
  220. }
  221. },
  222. "codex": {
  223. "title": "Codex CLI 使用指南",
  224. "description": "Codex 是 OpenAI 官方的命令行 AI 编程助手,支持通过 cch 代理使用。注意:Codex 使用 OpenAI 兼容格式,端点需要包含 /v1 路径。",
  225. "installation": {
  226. "title": "安装 codex",
  227. "instruction": "执行:",
  228. "adminNote": "以管理员身份运行 PowerShell,",
  229. "verification": "验证安装:",
  230. "command": "codex --version"
  231. },
  232. "configuration": {
  233. "title": "连接 cch 服务",
  234. "configFile": {
  235. "title": "配置文件设置",
  236. "steps": [
  237. "打开文件资源管理器,找到 ${configPath} 文件夹(不存在则创建)",
  238. "创建 config.toml 文件",
  239. "使用文本编辑器打开,添加以下内容:"
  240. ],
  241. "step4": "创建 auth.json 文件,添加:",
  242. "important": "重要提示",
  243. "importantPoints": [
  244. "将 your-api-key-here 替换为您的 cch API 密钥",
  245. "注意:Codex 使用 OpenAI 兼容格式,端点包含 /v1 路径"
  246. ]
  247. },
  248. "authJson": {
  249. "title": "配置文件方式",
  250. "configTomlDescription": "创建 config.toml 文件(使用 auth.json 存储密钥时,无需 env_key 字段):",
  251. "note": "提示",
  252. "noteText": "此方式通过 auth.json 文件存储 API 密钥,config.toml 中无需配置 env_key 字段。"
  253. },
  254. "envVars": {
  255. "title": "环境变量方式",
  256. "configTomlDescription": "创建 config.toml 文件(使用环境变量时,需要配置 env_key 字段):",
  257. "windows": {
  258. "instruction": "在 PowerShell 中运行:",
  259. "note": "设置后需要重新打开 PowerShell 窗口才能生效。"
  260. },
  261. "unix": {
  262. "instruction": "设置环境变量:"
  263. }
  264. }
  265. },
  266. "vsCodeExtension": {
  267. "title": "VS Code 扩展配置",
  268. "steps": [
  269. "在 VS Code 扩展中搜索并安装 Codex – OpenAI's coding agent",
  270. "确保已按照上述步骤配置好 config.toml 和 auth.json",
  271. "设置环境变量 CCH_API_KEY"
  272. ],
  273. "important": "重要",
  274. "importantText": "env_key 只能是环境变量名称(如 CCH_API_KEY),不能是完整的密钥。如果直接填写密钥,会报错找不到令牌或令牌配置错误。"
  275. },
  276. "startup": {
  277. "title": "启动 codex",
  278. "description": "在项目目录下运行:",
  279. "initNote": "首次启动时,codex 会进行初始化配置。"
  280. },
  281. "commonIssues": {
  282. "title": "常见问题",
  283. "commandNotFound": "1. 命令未找到",
  284. "commandNotFoundWindows": [
  285. "确保 npm 全局路径(通常是 C:\\Users\\你的用户名\\AppData\\Roaming\\npm)已添加到系统 PATH",
  286. "重新打开 PowerShell 窗口"
  287. ],
  288. "commandNotFoundUnix": "检查 npm 全局安装路径并添加到 PATH(如果不在)",
  289. "connectionFailed": "2. API 连接失败",
  290. "updateCli": "3. 更新 codex",
  291. "updateCommand": "npm i -g @openai/codex --registry=https://registry.npmmirror.com"
  292. }
  293. },
  294. "gemini": {
  295. "title": "Gemini CLI 使用指南",
  296. "description": "Gemini CLI 是 Google 官方的 AI 编程助手命令行工具,支持通过 cch 代理服务使用。本指南将帮助您在不同操作系统上完成安装和配置。",
  297. "installation": {
  298. "title": "安装 gemini",
  299. "instruction": "确保您已安装 Node.js 18 或更高版本,然后全局安装 Gemini CLI:",
  300. "command": "npm install -g @google/gemini-cli",
  301. "verification": "验证安装:",
  302. "verificationCommand": "gemini --version",
  303. "adminNote": "以管理员身份运行 PowerShell,"
  304. },
  305. "configuration": {
  306. "title": "连接 cch 服务",
  307. "configFile": {
  308. "title": "方法一:配置文件方式(推荐)",
  309. "step1": {
  310. "title": "创建配置目录",
  311. "description": "Gemini CLI 的配置文件位于 ~/.gemini/ 目录。",
  312. "macosLinux": "macOS / Linux:",
  313. "windows": "Windows (PowerShell):"
  314. },
  315. "step2": {
  316. "title": "创建 .env 配置文件",
  317. "description": "在 ~/.gemini/ 目录下创建 .env 文件:",
  318. "macosLinuxInstruction": "macOS / Linux:",
  319. "windowsInstruction": "Windows:在 %USERPROFILE%\\.gemini\\ 目录下创建 .env 文件",
  320. "content": "添加以下内容:"
  321. },
  322. "step3": {
  323. "title": "创建 settings.json 配置文件",
  324. "description": "在 ~/.gemini/ 目录下创建 settings.json 文件:",
  325. "content": "这个配置文件启用了 IDE 集成,并设置认证方式为 API Key。"
  326. },
  327. "parameterNote": "参数说明",
  328. "parameters": [
  329. "GOOGLE_GEMINI_BASE_URL: cch API 基础地址",
  330. "GEMINI_API_KEY: 您在 cch 控制台创建的 API 密钥",
  331. "GEMINI_MODEL: 使用的模型(默认为 gemini-2.5-pro)"
  332. ],
  333. "important": "重要提示",
  334. "importantPoints": [
  335. "将 YOUR_API_KEY_HERE 替换为您的实际 API 密钥",
  336. "密钥获取方式:登录控制台 → API 密钥管理 → 创建密钥"
  337. ]
  338. },
  339. "envVars": {
  340. "title": "方法二:环境变量配置",
  341. "description": "如果您只想临时使用,可以通过环境变量配置:",
  342. "macosLinux": {
  343. "title": "macOS / Linux:",
  344. "note": "环境变量只在当前终端会话中有效。如需持久化配置,请使用配置文件方式。"
  345. },
  346. "windows": {
  347. "powershell": "Windows (PowerShell):",
  348. "cmd": "Windows (CMD):",
  349. "note": "环境变量只在当前终端会话中有效。如需持久化配置,请使用配置文件方式。"
  350. }
  351. }
  352. },
  353. "startup": {
  354. "title": "启动和验证",
  355. "startCli": {
  356. "title": "启动 Gemini CLI",
  357. "description": "进入您的项目目录并启动 Gemini CLI:",
  358. "note": "首次启动时,Gemini CLI 会读取配置文件中的设置。"
  359. },
  360. "verification": {
  361. "title": "验证配置",
  362. "description": "在 Gemini CLI 中尝试发送一个简单的请求测试连接:",
  363. "testCommand": "你好,请帮我创建一个 Python 的 hello world 程序",
  364. "success": "如果 Gemini CLI 正常响应,说明配置成功!"
  365. },
  366. "agentMode": {
  367. "title": "使用 Agent Mode",
  368. "description": "Gemini CLI 支持 Agent Mode,可以自动规划和执行复杂任务:",
  369. "command": "gemini --agent",
  370. "features": "在 Agent Mode 下,Gemini 会:",
  371. "featureList": [
  372. "自动分析任务需求",
  373. "制定执行计划",
  374. "逐步执行并验证结果",
  375. "根据反馈调整策略"
  376. ]
  377. }
  378. },
  379. "commonIssues": {
  380. "title": "常见问题",
  381. "commandNotFound": "1. 命令未找到",
  382. "commandNotFoundWindows": [
  383. "确保 npm 全局路径(通常是 C:\\Users\\你的用户名\\AppData\\Roaming\\npm)已添加到系统 PATH",
  384. "重新打开 PowerShell 窗口"
  385. ],
  386. "commandNotFoundUnix": "检查 npm 全局安装路径并添加到 PATH(如果不在)",
  387. "connectionFailed": "2. API 连接失败",
  388. "connectionSteps": [
  389. "检查环境变量或配置文件中的 GEMINI_API_KEY 是否设置正确",
  390. "验证 GOOGLE_GEMINI_BASE_URL 是否正确",
  391. "测试网络连接"
  392. ],
  393. "updateCli": "3. 更新 gemini",
  394. "updateCommand": "npm install -g @google/gemini-cli"
  395. }
  396. },
  397. "opencode": {
  398. "title": "OpenCode 使用指南",
  399. "description": "OpenCode 是一款在终端中运行的 CLI + TUI AI 编程代理工具,也提供 IDE 插件集成。你可以将 OpenCode 指向 cch 作为统一入口来接入 Claude、GPT 与 Gemini 等模型。",
  400. "installation": {
  401. "title": "安装",
  402. "macos": {
  403. "description": "在 macOS 上可以选择以下任一种方式安装 OpenCode:",
  404. "homebrew": {
  405. "title": "方式二:Homebrew",
  406. "description": "也可以使用 Homebrew 安装:"
  407. }
  408. },
  409. "linux": {
  410. "description": "在 Linux 上可以选择以下任一种方式安装 OpenCode:",
  411. "homebrew": {
  412. "title": "方式二:Homebrew",
  413. "description": "也可以使用 Homebrew 安装:"
  414. },
  415. "paru": {
  416. "title": "方式五:Paru(Arch Linux)",
  417. "description": "如果你使用 Arch Linux,也可以通过 paru(AUR)安装:"
  418. }
  419. },
  420. "script": {
  421. "title": "方式一:官方安装脚本",
  422. "description": "执行以下命令安装最新版:"
  423. },
  424. "npm": {
  425. "title": "方式三:npm",
  426. "description": "也可以通过 npm 全局安装:",
  427. "note": "提示:不建议通过 npm 镜像源/第三方 registry 安装 opencode-ai,可能会导致依赖缺失;如遇问题请改用官方 npm registry。"
  428. },
  429. "bun": {
  430. "title": "方式四:Bun",
  431. "description": "如果你使用 Bun,也可以全局安装:"
  432. },
  433. "windows": {
  434. "description": "Windows 推荐使用包管理器(Chocolatey/Scoop),也可以使用 npm:",
  435. "choco": {
  436. "title": "方式一:Chocolatey",
  437. "description": "使用 Chocolatey 安装:",
  438. "command": "choco install opencode"
  439. },
  440. "scoop": {
  441. "title": "方式二:Scoop",
  442. "description": "使用 Scoop 安装:",
  443. "command": "scoop bucket add extras\nscoop install extras/opencode"
  444. },
  445. "note": "提示:官方说明 Windows 上通过 Bun 安装仍在推进。建议使用 Chocolatey/Scoop/npm,或从 GitHub Releases 下载二进制。"
  446. }
  447. },
  448. "configuration": {
  449. "title": "连接 cch 服务",
  450. "configFile": {
  451. "title": "配置 opencode.json",
  452. "path": "配置文件路径:",
  453. "instruction": "编辑配置文件,写入以下内容(只需一份配置文件即可覆盖全部模型):",
  454. "important": "重要说明",
  455. "importantPoints": [
  456. "请先在 cch 后台创建 API Key,并设置环境变量 CCH_API_KEY",
  457. "cchClaude/openai 使用 ${resolvedOrigin}/v1,cchGemini 使用 ${resolvedOrigin}/v1beta",
  458. "模型选择时使用 provider_id/model_id 格式(例如 openai/gpt-5.2 或 cchClaude/claude-sonnet-4-5-20250929)"
  459. ]
  460. },
  461. "modelSelection": {
  462. "title": "选择模型",
  463. "description": "启动 OpenCode 后,在 TUI 中输入以下命令查看/选择模型:",
  464. "command": "/models"
  465. }
  466. },
  467. "startup": {
  468. "title": "启动 opencode",
  469. "description": "在项目目录下运行:",
  470. "initNote": "首次启动时,opencode 会加载配置并创建会话。"
  471. },
  472. "commonIssues": {
  473. "title": "常见问题",
  474. "commandNotFound": "1. 命令未找到",
  475. "commandNotFoundWindows": [
  476. "如果使用 npm 安装,请确保 npm 全局路径已添加到系统 PATH",
  477. "重新打开终端窗口后再试"
  478. ],
  479. "commandNotFoundUnix": "检查安装路径并添加到 PATH(例如 ~/.local/bin 或 npm 全局目录)",
  480. "connectionFailed": "2. API 连接失败",
  481. "updateCli": "3. 更新 opencode"
  482. }
  483. },
  484. "droid": {
  485. "title": "Droid CLI 使用指南",
  486. "description": "Droid 是 Factory AI 开发的交互式终端 AI 编程助手,支持通过 cch 代理服务使用。使用前必须先注册并登录 Droid 官方账号。",
  487. "installation": {
  488. "title": "安装 droid",
  489. "linux": {
  490. "instruction": "执行:",
  491. "note": "Linux 用户需确保已安装 xdg-utils:",
  492. "command": "sudo apt-get install xdg-utils"
  493. },
  494. "windows": {
  495. "instruction": "在 PowerShell 中执行:"
  496. }
  497. },
  498. "configuration": {
  499. "title": "连接 cch 服务",
  500. "prerequisite": "前置步骤:必须先登录 Droid 官方账号",
  501. "prerequisiteSteps": [
  502. "运行 droid 命令",
  503. "按提示通过浏览器登录 Factory 官方账号",
  504. "登录成功后,才能继续配置自定义模型"
  505. ],
  506. "customModels": {
  507. "title": "配置自定义模型",
  508. "path": "配置文件路径:",
  509. "instruction": "编辑配置文件,添加以下内容:",
  510. "important": "重要说明",
  511. "importantPoints": [
  512. "将 your-api-key-here 替换为您的 cch API 密钥",
  513. "Anthropic 格式:使用 ${resolvedOrigin}(无 /v1)",
  514. "OpenAI 格式:使用 ${resolvedOrigin}/v1(需要 /v1)"
  515. ]
  516. },
  517. "switching": {
  518. "title": "切换模型",
  519. "steps": [
  520. "重启 Droid",
  521. "输入 /model 命令",
  522. "选择 GPT-5-Codex [cch] 或 Sonnet 4.5 [cch]",
  523. "开始使用!"
  524. ]
  525. }
  526. },
  527. "startup": {
  528. "title": "启动 droid",
  529. "description": "在项目目录下运行:",
  530. "initNote": "首次启动时,droid 会进行初始化配置。"
  531. },
  532. "commonIssues": {
  533. "title": "常见问题",
  534. "commandNotFound": "1. 命令未找到",
  535. "commandNotFoundWindows": [
  536. "确保 npm 全局路径(通常是 C:\\Users\\你的用户名\\AppData\\Roaming\\npm)已添加到系统 PATH",
  537. "重新打开 PowerShell 窗口"
  538. ],
  539. "commandNotFoundUnix": "检查 npm 全局安装路径并添加到 PATH(如果不在)",
  540. "updateCli": "2. 更新 droid"
  541. }
  542. },
  543. "commonCommands": {
  544. "title": "常用命令",
  545. "description": "启动 Claude Code 后,您可以使用以下常用命令:",
  546. "commands": [
  547. { "command": "/help", "description": "查看帮助信息" },
  548. { "command": "/clear", "description": "清空对话历史,开启新对话" },
  549. { "command": "/compact", "description": "总结当前对话" },
  550. { "command": "/cost", "description": "查看当前对话已使用的金额" },
  551. { "command": "/model", "description": "切换模型(Droid 专用)" }
  552. ],
  553. "moreCommands": "更多命令查看 官方文档"
  554. },
  555. "troubleshooting": {
  556. "title": "通用故障排查",
  557. "installationFailed": {
  558. "title": "安装失败",
  559. "steps": [
  560. "检查网络连接是否正常",
  561. "确保有管理员权限(Windows)或使用 sudo(macOS / Linux)",
  562. "尝试使用代理或镜像源(npm 可使用 --registry 参数)"
  563. ]
  564. },
  565. "invalidApiKey": {
  566. "title": "API 密钥无效",
  567. "steps": [
  568. "确认密钥已正确复制(无多余空格)",
  569. "检查密钥是否在有效期内",
  570. "验证账户权限是否正常",
  571. "确认使用了正确的端点格式(Anthropic 无 /v1,OpenAI 有 /v1)"
  572. ]
  573. },
  574. "endpointConfigError": {
  575. "title": "端点配置错误",
  576. "points": [
  577. "Claude Code / Droid Anthropic 模型:使用 ${resolvedOrigin}(无 /v1)",
  578. "Codex / Droid OpenAI 模型:使用 ${resolvedOrigin}/v1(必须包含 /v1)"
  579. ]
  580. }
  581. },
  582. "platforms": {
  583. "macos": "macOS",
  584. "windows": "Windows",
  585. "linux": "Linux"
  586. },
  587. "placeholders": {
  588. "windowsUserName": "你的用户名",
  589. "shellConfig": {
  590. "linux": "~/.bashrc",
  591. "macos": "~/.zshrc"
  592. },
  593. "codexVsCodeConfigFiles": "config.toml 和 auth.json"
  594. },
  595. "snippets": {
  596. "comments": {
  597. "updateHomebrew": "# 更新 Homebrew",
  598. "installNodeJs": "# 安装 Node.js",
  599. "usingChocolatey": "# 使用 Chocolatey",
  600. "orUsingScoop": "# 或使用 Scoop",
  601. "addNodeSourceRepo": "# 添加 NodeSource 仓库",
  602. "ubuntuDebian": "# Ubuntu/Debian",
  603. "centosRhelFedora": "# CentOS/RHEL/Fedora",
  604. "addToPathIfMissing": "# 添加到 PATH(如果不在)",
  605. "checkEnvVar": "# 检查环境变量",
  606. "testNetworkConnection": "# 测试网络连接"
  607. }
  608. },
  609. "layout": {
  610. "headerTitle": "使用文档",
  611. "loginConsole": "登录控制台"
  612. },
  613. "ui": {
  614. "mainContent": "文档内容",
  615. "main": "main",
  616. "currentSiteAddress": "当前站点地址"
  617. }
  618. }