Skip to content

Commit 309a887

Browse files
docs: restructure translations as _en.md siblings per maintainer request; sync mcp.md with upstream/main
1 parent 0c6b054 commit 309a887

4 files changed

Lines changed: 537 additions & 169 deletions

File tree

docs/configuration.md

Lines changed: 101 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,98 @@
1-
# Deep Code Configuration
1+
# Deep Code 配置
22

3-
## Configuration Hierarchy
3+
## 配置层级
44

5-
Configuration is applied in the following priority order (lower-numbered sources are overridden by higher-numbered ones):
5+
配置按以下优先级顺序应用(数字较小的会被数字较大的覆盖):
66

7-
| Layer | Configuration Source | Description |
8-
| ----- | -------------------- | ---------------------------------------------- |
9-
| 1 | Defaults | Hardcoded defaults within the application |
10-
| 2 | User settings file | Global settings for the current user |
11-
| 3 | Project settings file| Project-specific settings |
12-
| 4 | Environment variables| System-wide or session-specific variables |
7+
| 层级 | 配置来源 | 说明 |
8+
| ---- | ------------ | ------------------------------------------- |
9+
| 1 | 默认值 | 应用程序内硬编码的默认值 |
10+
| 2 | 用户设置文件 | 当前用户的全局设置 |
11+
| 3 | 项目设置文件 | 项目特定的设置 |
12+
| 4 | 环境变量 | 系统范围或会话特定的变量 |
1313

14-
## Settings File
14+
## 设置文件
1515

16-
Deep Code uses the `settings.json` file for persistent configuration, supporting two storage locations:
16+
Deep Code 使用 `settings.json` 设置文件进行持久化配置,支持两个层级的存放位置:
1717

18-
| File Type | Location | Scope |
19-
| ------------------- | ----------------------------------------- | --------------------------------------------------------------------- |
20-
| User settings file | `~/.deepcode/settings.json` | Applies to all Deep Code sessions for the current user. |
21-
| Project settings file | `<project root>/.deepcode/settings.json` | Takes effect only when running Deep Code in that specific project. Project settings override user settings. |
18+
| 文件类型 | 位置 | 作用范围 |
19+
| ------------ | ---------------------------------- | ---------------------------------------------------- |
20+
| 用户设置文件 | `~/.deepcode/settings.json` | 适用于当前用户的所有 Deep Code 会话。 |
21+
| 项目设置文件 | `项目根目录/.deepcode/settings.json` | 仅在该特定项目中运行 Deep Code 时生效。项目设置会覆盖用户设置。 |
2222

23-
### Available Settings in `settings.json`
23+
### `settings.json` 中的可用设置
2424

25-
The following are all the top-level fields supported in `settings.json`, along with the sub-fields inside `env`:
25+
以下是 `settings.json` 支持的全部顶层字段,以及 `env` 内部支持的子字段:
2626

27-
| Field | Type | Description |
28-
| ------------------ | ------- | --------------------------------------------------------------------------- |
29-
| `env` | object | Group of environment variables (see sub-field table below) |
30-
| `model` | string | Model name. Takes precedence over `env.MODEL` |
31-
| `thinkingEnabled` | boolean | Whether to enable thinking mode (enabled by default for DeepSeek V4 series)|
32-
| `reasoningEffort` | string | Reasoning intensity, either `"high"` or `"max"` (default `"max"`) |
33-
| `debugLogEnabled` | boolean | Enable debug log output (default `false`) |
34-
| `notify` | string | Full path to a task-completion notification script (e.g., Slack notification script) |
35-
| `webSearchTool` | string | Full path to a custom web search script |
36-
| `mcpServers` | object | MCP server configurations (keys are service names, values are McpServerConfig objects) |
27+
| 字段 | 类型 | 说明 |
28+
| -------------------- | --------- | ------------------------------------------------------------------- |
29+
| `env` | object | 环境变量分组(见下方子字段表) |
30+
| `model` | string | 模型名称。优先级高于 `env.MODEL` |
31+
| `thinkingEnabled` | boolean | 是否启用思考模式(DeepSeek V4 系列默认启用) |
32+
| `reasoningEffort` | string | 推理强度,可选 `"high"` `"max"`(默认 `"max"` |
33+
| `debugLogEnabled` | boolean | 是否启用调试日志输出(默认 `false` |
34+
| `notify` | string | 任务完成通知脚本的完整路径(如 Slack 通知脚本) |
35+
| `webSearchTool` | string | 自定义联网搜索脚本的完整路径 |
36+
| `mcpServers` | object | MCP 服务器配置(键为服务名,值为 McpServerConfig 对象) |
3737

38-
#### `env` Sub-fields
38+
#### `env` 子字段
3939

40-
| Field | Type | Description |
41-
| ----------------- | ------ | ---------------------------------------------------------------- |
42-
| `MODEL` | string | Model name, e.g. `"deepseek-v4-pro"`, `"deepseek-v4-flash"` |
43-
| `BASE_URL` | string | Base URL for API requests, e.g. `"https://api.deepseek.com"` |
44-
| `API_KEY` | string | API key |
45-
| `THINKING_ENABLED`| string | Enable thinking mode |
46-
| `REASONING_EFFORT`| string | Reasoning intensity |
47-
| `DEBUG_LOG_ENABLED`| string| Enable debug log output |
48-
| `<any other KEY>` | string | Custom environment variable |
40+
| 字段 | 类型 | 说明 |
41+
| ---------- | ------ | ------------------------------------------------------------------ |
42+
| `MODEL` | string | 模型名称。例如 `"deepseek-v4-pro"``"deepseek-v4-flash"` |
43+
| `BASE_URL` | string | API 请求的基础 URL。例如 `"https://api.deepseek.com"` |
44+
| `API_KEY` | string | API 密钥 |
45+
| `THINKING_ENABLED` | string | 是否启用思考模式 |
46+
| `REASONING_EFFORT` | string | 推理强度 |
47+
| `DEBUG_LOG_ENABLED` | string | 是否启用调试日志输出 |
48+
| `<其他任意KEY>` | string | 自定义环境变量 |
4949

50-
#### `thinkingEnabled`Thinking Mode
50+
#### `thinkingEnabled`思考模式
5151

52-
Whether to enable DeepSeek thinking mode. Set to `true` to enable, `false` to disable.
52+
是否启用 DeepSeek 思考模式。设置为 `true` 启用、`false` 禁用。
5353

54-
- For `deepseek-v4-pro` and `deepseek-v4-flash`, thinking mode is **enabled by default**.
55-
- For other models, thinking mode is **disabled by default**.
54+
- 对于 `deepseek-v4-pro` `deepseek-v4-flash`,思考模式**默认启用**
55+
- 对于其他模型,思考模式**默认关闭**
5656

57-
#### `reasoningEffort`Reasoning Intensity
57+
#### `reasoningEffort`推理强度
5858

59-
When thinking mode is enabled, controls the depth of the model’s reasoning:
59+
当思考模式启用时,控制模型思考的深度:
6060

61-
| Value | Description |
62-
| ------ | --------------------------------------------------------- |
63-
| `max` | Maximum reasoning depth (default) |
64-
| `high` | Higher reasoning depth with relatively lower token usage |
61+
| | 说明 |
62+
| ------ | --------------------------------- |
63+
| `max` | 最大推理深度(默认值) |
64+
| `high` | 较高推理深度,token消耗相对较小 |
6565

66-
#### `notify`Task Completion Notification
66+
#### `notify`任务完成通知
6767

68-
Set a full path to a shell script. When the AI assistant finishes a round of tasks, the script is executed automatically, which can be used to send notifications (e.g., a Slack message).
68+
设置一个 Shell 脚本的完整路径。当 AI 助手完成一轮任务后,会自动执行该脚本,可用于发送通知(如 Slack 消息)。
6969

7070
```json
7171
{
7272
"notify": "/path/to/slack-notify.sh"
7373
}
7474
```
7575

76-
#### `webSearchTool`Custom Web Search
76+
#### `webSearchTool`自定义联网搜索
7777

78-
Deep Code has a built-in, free-to-use Web Search tool. If you need custom search logic, set `webSearchTool` to the full path of an executable script:
78+
Deep Code 内置免费可用的 Web Search 工具。如果需要自定义搜索逻辑,可将 `webSearchTool` 设为一个可执行脚本的完整路径:
7979

8080
```json
8181
{
8282
"webSearchTool": "/path/to/my-search-script.sh"
8383
}
8484
```
8585

86-
The script receives a search query as an argument and outputs results in JSON format for the AI.
86+
脚本接收一个搜索查询参数,输出 JSON 格式的结果供 AI 使用。
8787

88-
#### `mcpServers` — MCP Servers
88+
#### `mcpServers` — MCP 服务器
8989

90-
Configuration for MCP (Model Context Protocol) servers. The value is a key-value pair, where the key is the service name and the value is a server configuration object.
90+
MCPModel Context Protocol)服务器配置。值是键值对,键为服务名称,值为服务器配置对象。
9191

9292
```json
9393
{
9494
"mcpServers": {
95-
"<service name>": {
95+
"<服务名>": {
9696
"command": "npx",
9797
"args": ["-y", "@modelcontextprotocol/server-github"],
9898
"env": {
@@ -103,70 +103,71 @@ Configuration for MCP (Model Context Protocol) servers. The value is a key-value
103103
}
104104
```
105105

106-
| McpServerConfig field | Type | Required | Description |
107-
| --------------------- | -------- | -------- | ------------------------------------------------------------------------ |
108-
| `command` | string | Yes | Executable path or command (e.g. `npx`, `node`, `python`) |
109-
| `args` | string[] | No | List of arguments passed to the command |
110-
| `env` | object | No | Environment variables passed to the MCP server process |
106+
| McpServerConfig 字段 | 类型 | 必填 | 说明 |
107+
| -------------------- | -------- | ---- | -------------------------------------------------------------------- |
108+
| `command` | string | | 可执行文件路径或命令(如 `npx``node``python` |
109+
| `args` | string[] | | 传递给命令的参数列表 |
110+
| `env` | object | | 传递给 MCP 服务器进程的环境变量 |
111111

112-
> When `command` is `npx`, Deep Code automatically prepends `-y` to the arguments.
112+
> `command` `npx` 时,Deep Code 会自动在参数前补充 `-y`
113113
114-
For detailed MCP usage instructions, refer to [mcp.md](mcp.md).
114+
详细 MCP 使用说明请参考 [mcp.md](mcp.md)
115115

116-
#### `debugLogEnabled` — Debug Log
117116

118-
Set to `true` to enable detailed debug logging (default `false`), useful for troubleshooting API calls and tool execution.
117+
#### `debugLogEnabled` — 调试日志
119118

120-
## Environment Variable Priority
119+
设为 `true` 可让程序输出详细的调试日志(默认 `false`),用于排查 API 调用和工具执行的问题。
121120

122-
Environment variables are a common way to configure applications, especially for sensitive information (such as api-key) or settings that may change between environments.
121+
## 环境变量优先级
123122

124-
### Priority Principle
123+
环境变量是配置应用程序的常用方式,尤其适用于敏感信息(如 api-key)或可能在不同环境之间更改的设置。
125124

126-
Environment variable priority follows the logic of “the more specific and localized the configuration, the higher the priority”, and the override rule of “env files protect existing environment by default, system variables override env files”. (The `env` object in settings.json can be thought of as a type of env file.)
125+
### 优先级原则
127126

128-
Priority levels (from lowest to highest):
129-
1. `env` defined at the top level of `settings.json` – this is a general configuration for the entire tool and all its subprocesses (global variables). Can be overridden by outer environment variables, but the environment variable KEY has the `DEEPCODE_` prefix removed.
130-
2. `env` defined inside `mcpServers` in `settings.json` – this is the most specific configuration for a particular MCP service (local variables). Can be overridden by outer environment variables, but the KEY has the `MCP_` prefix removed.
131-
3. Shell/system environment variables – operating system level.
127+
环境变量优先级遵循“越具体、越局部的配置,优先级越高”和“env文件默认保护现有环境,系统变量高于env文件”的覆盖逻辑。(settings.json的env对象可以认为是一种env文件)
132128

133-
### Scenarios
129+
优先级层级 (由低到高)
130+
1. settings.json 外层的 env:这是针对整个工具及其所有子进程的通用配置(全局变量)。可被外层环境变量覆盖,但环境变量KEY会移除`DEEPCODE_`前缀。
131+
2. settings.json mcpServers 内定义的 env:这是针对特定 MCP 服务的最具体配置(局部变量)。可被外层环境变量覆盖,但环境变量KEY会移除`MCP_`前缀。
132+
3. Shell 环境系统变量:操作系统层面的环境变量。
134133

135-
#### 1. Setting the model’s api_key and base_url
134+
### 场景
136135

137-
Applied in the following priority order (lower-numbered sources are overridden by higher-numbered ones) – using api_key as an example:
136+
#### 一、设置模型的api_key, base_url
138137

139-
1. Hardcoded default: `""`
140-
2. User-level settings.json: `{"env": {"API_KEY": "abc123"}}`
141-
3. Project-level settings.json: `{"env": {"API_KEY": "abc123"}}`
142-
4. System environment variable: `DEEPCODE_API_KEY=abc123 deepcode`
138+
按以下优先级顺序应用(数字较小的会被数字较大的覆盖)(以api_key为例):
143139

144-
#### 2. Setting model, thinkingEnabled, and reasoningEffort
140+
1. 硬编码默认值: `""`
141+
2. 用户级settings.json: `{"env": {"API_KEY": "abc123"}}`
142+
3. 项目级settings.json: `{"env": {"API_KEY": "abc123"}}`
143+
4. 系统环境变量: `DEEPCODE_API_KEY=abc123 deepcode`
145144

146-
Applied in the following priority order (lower-numbered overridden by higher-numbered) – using thinkingEnabled as an example:
145+
#### 二、设置模型的model, thinkingEnabled, reasoningEffort
147146

148-
1. Hardcoded default: `true`
149-
2. User-level settings.json: `{"env": {"THINKING_ENABLED": "true"}}`
150-
3. User-level settings.json: `{"thinkingEnabled": true}`
151-
4. Project-level settings.json: `{"env": {"THINKING_ENABLED": "true"}}`
152-
5. Project-level settings.json: `{"thinkingEnabled": true}`
153-
6. System environment variable: `DEEPCODE_THINKING_ENABLED=true deepcode`
147+
按以下优先级顺序应用(数字较小的会被数字较大的覆盖)(以thinkingEnabled为例):
154148

155-
#### 3. Setting environment variables for external scripts like notify and webSearchTool
149+
1. 硬编码默认值: `true`
150+
2. 用户级settings.json: `{"env": {"THINKING_ENABLED": "true"}}`
151+
3. 用户级settings.json: `{"thinkingEnabled": true}`
152+
4. 项目级settings.json: `{"env": {"THINKING_ENABLED": "true"}}`
153+
5. 项目级settings.json: `{"thinkingEnabled": true}`
154+
6. 系统环境变量: `DEEPCODE_THINKING_ENABLED=true deepcode`
156155

157-
Applied in the following priority order (lower-numbered overridden by higher-numbered) – using notify as an example:
156+
#### 三、设置启动notify, webSearchTool等外挂脚本的环境变量
158157

159-
1. Hardcoded default: `os.environ.get('WEBHOOK', '...') # notify script code`
160-
2. User-level settings.json: `{"env": {"WEBHOOK": "..."}}`
161-
3. Project-level settings.json: `{"env": {"WEBHOOK": "true"}}`
162-
4. System environment variable: `DEEPCODE_WEBHOOK=... deepcode`
158+
按以下优先级顺序应用(数字较小的会被数字较大的覆盖)(以notify为例):
163159

164-
#### 4. Setting environment variables for an MCP Service
160+
1. 硬编码默认值:`os.environ.get('WEBHOOK', '...') # notify脚本代码`
161+
2. 用户级settings.json: `{"env": {"WEBHOOK": "..."}}`
162+
3. 项目级settings.json: `{"env": {"WEBHOOK": "true"}}`
163+
4. 系统环境变量: `DEEPCODE_WEBHOOK=... deepcode`
165164

166-
Applied in the following priority order (lower-numbered overridden by higher-numbered) – using a GitHub MCP server as an example:
165+
#### 四、设置MCP Service的环境变量
167166

168-
1. User-level settings.json: `{"mcpServers":{"github":{"env":{"GITHUB_PERSONAL_ACCESS_TOKEN":"..."}}}}`
169-
2. User-level settings.json: `{"env": {"MCP_GITHUB_PERSONAL_ACCESS_TOKEN": "..."}}`
170-
3. Project-level settings.json: `{"mcpServers":{"github":{"env":{"GITHUB_PERSONAL_ACCESS_TOKEN":"..."}}}}`
171-
4. Project-level settings.json: `{"env": {"MCP_GITHUB_PERSONAL_ACCESS_TOKEN": "..."}}`
172-
5. System environment variable: `DEEPCODE_MCP_GITHUB_PERSONAL_ACCESS_TOKEN=... deepcode`
167+
按以下优先级顺序应用(数字较小的会被数字较大的覆盖)(以github MCP server为例):
168+
169+
1. 用户级settings.json: `{"mcpServers":{"github":{"env":{"GITHUB_PERSONAL_ACCESS_TOKEN":"..."}}}}`
170+
2. 用户级settings.json: `{"env": {"MCP_GITHUB_PERSONAL_ACCESS_TOKEN": "..."}}`
171+
3. 项目级settings.json: `{"mcpServers":{"github":{"env":{"GITHUB_PERSONAL_ACCESS_TOKEN":"..."}}}}`
172+
4. 项目级settings.json: `{"env": {"MCP_GITHUB_PERSONAL_ACCESS_TOKEN": "..."}}`
173+
5. 系统环境变量: `DEEPCODE_MCP_GITHUB_PERSONAL_ACCESS_TOKEN=... deepcode`

0 commit comments

Comments
 (0)