| 1 | import type { DocsConfigurationDict } from "../types"; |
| 2 | |
| 3 | /** 「修改设置」页的简体中文词典;与 `en/docs-configuration.ts` 逐段对应。 */ |
| 4 | export const docsConfiguration: DocsConfigurationDict = { |
| 5 | metaTitle: "修改设置 · Codewhale 文档", |
| 6 | metaDescription: |
| 7 | "找到 Codewhale 的配置文件,在会话或 shell 中修改设置,只对单次运行试用某个设置,并了解仓库可以覆盖哪些设置。", |
| 8 | bodyClassName: "text-ink-soft leading-[1.9] tracking-wide", |
| 9 | title: "修改设置", |
| 10 | lede: |
| 11 | "大多数设置无需打开文件就能修改:在会话中用 `/config`,在 shell 中用 `codewhale config`。这一页介绍设置保存在哪里、如何修改,以及仓库能替你改什么、不能改什么。", |
| 12 | sections: [ |
| 13 | { |
| 14 | id: "file", |
| 15 | title: "找到配置文件", |
| 16 | blocks: [ |
| 17 | { p: "你的设置保存在 `~/.codewhale/config.toml`。可以打印确切路径,或直接用编辑器打开:" }, |
| 18 | { code: "codewhale config path\ncodewhale config edit", lang: "终端" }, |
| 19 | { |
| 20 | p: "想使用别的文件,传入 `--config <path>` 或设置 `CODEWHALE_CONFIG_PATH`;两者同时存在时以命令行参数为准。Codewhale 曾名为 DeepSeek-TUI:如果只有旧的 `~/.deepseek/` 文件夹,仍会读取它,而新设置一律写入 `~/.codewhale/`。", |
| 21 | }, |
| 22 | ], |
| 23 | }, |
| 24 | { |
| 25 | id: "change", |
| 26 | title: "修改设置", |
| 27 | blocks: [ |
| 28 | { |
| 29 | p: "在会话中,`/config` 打开设置编辑器,`/settings` 打开设置界面。`/config audit` 会列出哪些设置可以在本次会话中修改、哪些可以保存、哪些要重启后才生效——手动编辑之前先看一下。", |
| 30 | }, |
| 31 | { p: "在 shell 中:" }, |
| 32 | { |
| 33 | code: `codewhale config get tools |
| 34 | codewhale config set telemetry false |
| 35 | codewhale config unset telemetry |
| 36 | codewhale config dump # the settings in effect, secrets redacted |
| 37 | codewhale config doctor # unknown keys, empty secrets, malformed URLs`, |
| 38 | lang: "终端", |
| 39 | }, |
| 40 | { |
| 41 | p: "`config set` 只处理它认识的配置项;遇到其他配置项时,它会告诉你应该去编辑哪个 TOML 表,而不会自作主张。", |
| 42 | }, |
| 43 | ], |
| 44 | }, |
| 45 | { |
| 46 | id: "one-run", |
| 47 | title: "只对一次运行试用设置", |
| 48 | blocks: [ |
| 49 | { |
| 50 | p: "`--set KEY=VALUE` 只在这一次启动中修改设置,不保存任何内容。它支持 `provider`、`model`、`verbosity`、`approval_policy`、`sandbox_mode` 和 `telemetry`,可以重复使用。", |
| 51 | }, |
| 52 | { code: "codewhale --set model=deepseek-v4-pro --set sandbox_mode=read-only", lang: "终端" }, |
| 53 | ], |
| 54 | }, |
| 55 | { |
| 56 | id: "project", |
| 57 | title: "与仓库共享设置", |
| 58 | blocks: [ |
| 59 | { |
| 60 | p: "仓库可以附带 `.codewhale/config.toml`,为所有在其中工作的人建议一些设置。只有少数配置项会生效,而且安全相关的设置只能更严格:", |
| 61 | }, |
| 62 | { |
| 63 | rows: [ |
| 64 | ["model", "这个仓库的默认模型。"], |
| 65 | ["reasoning_effort", "例如为复杂的代码库设置 `\"high\"`。"], |
| 66 | ["approval_policy, sandbox_mode", "只接受比你自己的设置更严格的值。"], |
| 67 | ["allow_shell", "`false` 会关闭 shell 命令;`true` 会被忽略。"], |
| 68 | ["max_subagents", "减少并行子智能体的数量,范围 1 到 128。"], |
| 69 | ["notes_path", "把笔记保存在仓库里。"], |
| 70 | ], |
| 71 | codeTerms: true, |
| 72 | }, |
| 73 | { |
| 74 | p: "密钥、服务端点、提供商选择、MCP 服务器、钩子、技能和额外的说明文件,始终来自你自己的配置,因此克隆下来的仓库无法让 Codewhale 指向它自己的服务器或文件。启动时加上 `--no-project-config`,可以在这一次运行中忽略仓库的配置文件。", |
| 75 | }, |
| 76 | { |
| 77 | p: "项目说明——智能体在这个仓库里应该如何工作——请写在 `AGENTS.md` 中。运行 `/init` 即可生成一份。", |
| 78 | }, |
| 79 | ], |
| 80 | }, |
| 81 | ], |
| 82 | next: [ |
| 83 | { |
| 84 | href: "/docs/auth", |
| 85 | label: "连接模型提供商", |
| 86 | note: "保存密钥,并查看 Codewhale 当前使用的是哪一把。", |
| 87 | }, |
| 88 | { |
| 89 | href: "/docs/modes", |
| 90 | label: "设置模式与审批", |
| 91 | note: "大多数人最先修改的设置。", |
| 92 | }, |
| 93 | { |
| 94 | href: "/docs/hooks", |
| 95 | label: "在事件发生时运行命令", |
| 96 | note: "把你自己的脚本加入 `[hooks]` 表。", |
| 97 | }, |
| 98 | ], |
| 99 | sourceNote: "来源文档:docs/CONFIGURATION.md、docs/LEGACY_PATHS.md · 修改时同步更新 docs-map.ts。", |
| 100 | }; |
| 101 |