Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions README-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Deep Code CLI supports agent skills that allow you to extend the assistant's cap
| `/resume` | Choose a previous conversation to continue |
| `/continue` | Continue the active conversation or pick one to resume |
| `/model` | Switch model, thinking mode, and reasoning effort |
| `/theme` | Open theme picker with live preview |
| `/raw` | Toggle display mode (Normal / Lite / Raw scrollback) |
| `/init` | Initialize an AGENTS.md file (LLM project instructions) |
| `/skills` | List available skills |
Expand Down Expand Up @@ -141,6 +142,91 @@ For detailed configuration instructions, see: [docs/notify_en.md](docs/notify_en

No. Deep Code has a built-in fine-grained permission control mechanism that lets you confirm operations before the AI assistant executes shell commands, reads/writes files, accesses the network, and more. You can configure each permission scope's policy — always allow, always ask, or deny — via the `permissions` field in `settings.json`. See [docs/permission.md](docs/permission.md) for details.

### How do I customize the theme?

Deep Code CLI includes multiple built-in preset themes, defaulting to the light theme (`light`). You can switch presets by setting `theme.preset` in `settings.json`, or set it to `"custom"` for full customization.

**Using preset themes**

Set `theme.preset` in `settings.json` to switch:

```json
{
"theme": {
"preset": "dark"
}
}
```

Available presets: `light` (default), `dark`, `github-light`, `github-dark`, `gitlab-light`, `gitlab-dark`, `monokai`, `dracula`.

You can also use the `/theme` command at runtime to open the theme picker with live preview.

**Option 1: Partial overrides (preset="custom" + overrides)**

Override only the colors you want to change; the rest keep their defaults:

```json
{
"theme": {
"preset": "custom",
"overrides": {
"primary": "#ff6600",
"success": "greenBright"
}
}
}
```

**Option 2: Full customization (preset="custom" + tokens)**

Provide a complete tokens object, merged on top of the light theme:

```json
{
"theme": {
"preset": "custom",
"tokens": {
"primary": "#229ac3",
"secondary": "#229ac3e6",
"success": "green",
"error": "red",
"warning": "yellow",
"info": "magenta",
"text": "white",
"textDim": "gray",
"textBright": "white",
"code": "cyan",
"border": "gray",
"gradients": ["#229ac3e6", "#229ac3e6"]
}
}
}
```

> Note: `overrides` and `tokens` only take effect when `preset` is set to `"custom"`. When `preset` is unset, the `light` theme is used by default.

Default light theme (`light`) color values:

| Token | Default | Used For |
|-------|---------|----------|
| `primary` | `#229ac3` | Primary brand: user messages, selected items, status line bullets, Markdown headings |
| `secondary` | `#229ac3e6` | Secondary brand: welcome screen logo text/border, exit panel border |
| `success` | `#1a7f37` | Success: tool execution success, MCP ready, diff additions, low-risk permissions |
| `error` | `#d1242f` | Error: tool execution failure, error lines, diff deletions, high-risk permissions |
| `warning` | `#fa8c16` | Warning/in-progress: busy spinner, permission prompt border, list bullets, MCP starting |
| `info` | `#0969da` | Info: skill loading tips, image attachment status |
| `text` | `#3D4149` | Body text: permission prompt text, question text, ProcessStdout title |
| `textDim` | `#646A71` | Secondary text: status line params, search placeholder, diff context, Markdown blockquotes |
| `textBright` | `#1F2329` | Bright text: emphasized hints |
| `code` | `#787f8a` | Code blocks and inline code |
| `border` | `#999` | All component borders |
| `gradients` | `["#229ac3", "#8250df"]` | Logo and exit panel gradient colors |

Color values support hex (`"#ff6600"`), hex with alpha (`"#229ac3e6"`), and chalk named colors (`"cyanBright"`, `"green"`).

> Note: `tokens` takes priority over `overrides` — if both are specified, only `tokens` is used. Theme settings can be placed in the global `~/.deepcode/settings.json` or the project-root `.deepcode/settings.json`.

## Contributing

Contributions are welcome! Here's how to get started:
Expand Down
86 changes: 86 additions & 0 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Deep Code CLI 支持 agent skills,允许您扩展助手的能力:
| `/resume` | 选择历史对话继续 |
| `/continue` | 继续当前对话,或选择历史对话恢复 |
| `/model` | 切换模型、思考模式和推理强度 |
| `/theme` | 打开主题选择器,实时预览并切换主题 |
| `/raw` | 切换显示模式(Normal / Lite / Raw 滚动回溯) |
| `/init` | 初始化 AGENTS.md 文件 |
| `/skills` | 列出可用 skills |
Expand Down Expand Up @@ -141,6 +142,91 @@ Deep Code 支持 MCP(Model Context Protocol),可以连接 GitHub、浏览
}
```

### 如何自定义主题?

Deep Code CLI 内置多套预设主题,默认使用浅色主题(`light`)。可在 `settings.json` 中设置 `theme.preset` 切换预设,或设为 `"custom"` 自定义颜色。

**使用预设主题**

在 `settings.json` 中设置 `theme.preset` 即可切换:

```json
{
"theme": {
"preset": "dark"
}
}
```

可用预设:`light`(默认)、`dark`、`github-light`、`github-dark`、`gitlab-light`、`gitlab-dark`、`monokai`、`dracula`。

也可在运行时使用 `/theme` 命令打开主题选择器,实时预览并切换。

**方式一:局部覆盖(preset="custom" + overrides)**

只覆盖需要调整的颜色,其余保持默认值:

```json
{
"theme": {
"preset": "custom",
"overrides": {
"primary": "#ff6600",
"success": "greenBright"
}
}
}
```

**方式二:完全自定义(preset="custom" + tokens)**

提供完整的 tokens 对象,基于浅色主题合并:

```json
{
"theme": {
"preset": "custom",
"tokens": {
"primary": "#229ac3",
"secondary": "#229ac3e6",
"success": "green",
"error": "red",
"warning": "yellow",
"info": "magenta",
"text": "white",
"textDim": "gray",
"textBright": "white",
"code": "cyan",
"border": "gray",
"gradients": ["#229ac3e6", "#229ac3e6"]
}
}
}
```

> 注意:`overrides` 和 `tokens` 仅在 `preset` 为 `"custom"` 时生效。不配置 `preset` 时默认使用 `light` 主题。

默认浅色主题(`light`)色值:

| Token | 默认值 | 用途 |
|-------|--------|------|
| `primary` | `#229ac3` | 主品牌色:用户消息、选中项、状态行 bullet、Markdown 标题 |
| `secondary` | `#229ac3e6` | 辅助品牌色:欢迎屏 Logo 文字与边框、退出面板边框 |
| `success` | `#1a7f37` | 成功:工具执行成功、MCP ready、diff 新增行、低风险权限色 |
| `error` | `#d1242f` | 失败/错误:工具执行失败、Error 行、diff 删除行、高风险权限色 |
| `warning` | `#fa8c16` | 警告/进行中:忙时 spinner、权限提示边框、列表标记色、MCP 启动中 |
| `info` | `#0969da` | 特殊指示:技能加载提示、图片附件状态 |
| `text` | `#3D4149` | 主文字色:权限提示正文、问题文字、ProcessStdout 标题 |
| `textDim` | `#646A71` | 次要文字:状态行参数、搜索占位符、diff 上下文行、Markdown 引用块 |
| `textBright` | `#1F2329` | 亮色文字:强调提示 |
| `code` | `#787f8a` | 代码块/内联代码 |
| `border` | `#999` | 所有组件的边框色 |
| `gradients` | `["#229ac3", "#8250df"]` | Logo 与退出面板的渐变色数组 |

颜色值支持 hex(`"#ff6600"`)、hex 含透明度(`"#229ac3e6"`)、chalk 命名色(`"cyanBright"`、`"green"`)。

> 注意:`tokens` 优先级高于 `overrides`——如果同时指定两者,仅 `tokens` 生效。主题配置可放在全局 `~/.deepcode/settings.json` 或项目根 `.deepcode/settings.json` 中。

## 贡献

欢迎贡献代码!以下是参与方式:
Expand Down
86 changes: 86 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Deep Code CLI 支持 agent skills,允许您扩展助手的能力:
| `/resume` | 选择历史对话继续 |
| `/continue` | 继续当前对话,或选择历史对话恢复 |
| `/model` | 切换模型、思考模式和推理强度 |
| `/theme` | 打开主题选择器,实时预览并切换主题 |
| `/raw` | 切换显示模式(Normal / Lite / Raw 滚动回溯) |
| `/init` | 初始化 AGENTS.md 文件 |
| `/skills` | 列出可用 skills |
Expand Down Expand Up @@ -141,6 +142,91 @@ Deep Code 支持 MCP(Model Context Protocol),可以连接 GitHub、浏览
}
```

### 如何自定义主题?

Deep Code CLI 内置多套预设主题,默认使用浅色主题(`light`)。可在 `settings.json` 中设置 `theme.preset` 切换预设,或设为 `"custom"` 自定义颜色。

**使用预设主题**

在 `settings.json` 中设置 `theme.preset` 即可切换:

```json
{
"theme": {
"preset": "dark"
}
}
```

可用预设:`light`(默认)、`dark`、`github-light`、`github-dark`、`gitlab-light`、`gitlab-dark`、`monokai`、`dracula`。

也可在运行时使用 `/theme` 命令打开主题选择器,实时预览并切换。

**方式一:局部覆盖(preset="custom" + overrides)**

只覆盖需要调整的颜色,其余保持默认值:

```json
{
"theme": {
"preset": "custom",
"overrides": {
"primary": "#ff6600",
"success": "greenBright"
}
}
}
```

**方式二:完全自定义(preset="custom" + tokens)**

提供完整的 tokens 对象,基于浅色主题合并:

```json
{
"theme": {
"preset": "custom",
"tokens": {
"primary": "#229ac3",
"secondary": "#229ac3e6",
"success": "green",
"error": "red",
"warning": "yellow",
"info": "magenta",
"text": "white",
"textDim": "gray",
"textBright": "white",
"code": "cyan",
"border": "gray",
"gradients": ["#229ac3e6", "#229ac3e6"]
}
}
}
```

> 注意:`overrides` 和 `tokens` 仅在 `preset` 为 `"custom"` 时生效。不配置 `preset` 时默认使用 `light` 主题。

默认浅色主题(`light`)色值:

| Token | 默认值 | 用途 |
|-------|--------|------|
| `primary` | `#229ac3` | 主品牌色:用户消息、选中项、状态行 bullet、Markdown 标题 |
| `secondary` | `#229ac3e6` | 辅助品牌色:欢迎屏 Logo 文字与边框、退出面板边框 |
| `success` | `#1a7f37` | 成功:工具执行成功、MCP ready、diff 新增行、低风险权限色 |
| `error` | `#d1242f` | 失败/错误:工具执行失败、Error 行、diff 删除行、高风险权限色 |
| `warning` | `#fa8c16` | 警告/进行中:忙时 spinner、权限提示边框、列表标记色、MCP 启动中 |
| `info` | `#0969da` | 特殊指示:技能加载提示、图片附件状态 |
| `text` | `#3D4149` | 主文字色:权限提示正文、问题文字、ProcessStdout 标题 |
| `textDim` | `#646A71` | 次要文字:状态行参数、搜索占位符、diff 上下文行、Markdown 引用块 |
| `textBright` | `#1F2329` | 亮色文字:强调提示 |
| `code` | `#787f8a` | 代码块/内联代码 |
| `border` | `#999` | 所有组件的边框色 |
| `gradients` | `["#229ac3", "#8250df"]` | Logo 与退出面板的渐变色数组 |

颜色值支持 hex(`"#ff6600"`)、hex 含透明度(`"#229ac3e6"`)、chalk 命名色(`"cyanBright"`、`"green"`)。

> 注意:`tokens` 优先级高于 `overrides`——如果同时指定两者,仅 `tokens` 生效。主题配置可放在全局 `~/.deepcode/settings.json` 或项目根 `.deepcode/settings.json` 中。

## 贡献

欢迎贡献代码!以下是参与方式:
Expand Down
74 changes: 74 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,80 @@ MCP(Model Context Protocol)服务器配置。值是键值对,键为服务
详细 MCP 使用说明请参考 [mcp.md](mcp.md)。


#### `theme` — 主题配置

Deep Code 支持自定义主题颜色,让你的终端界面更符合个人喜好。

**使用预设主题**

```json
{
"theme": {
"preset": "dark"
}
}
```

可用的预设主题:

| 预设名称 | 说明 |
| --------------- | ------------------------------ |
| `light` | 浅色主题(默认,浅色背景优化) |
| `dark` | 暗色主题(深色背景优化) |
| `github-light` | GitHub Light 风格主题 |
| `github-dark` | GitHub Dark 风格主题 |
| `gitlab-light` | GitLab Light 风格主题 |
| `gitlab-dark` | GitLab Dark 风格主题 |
| `monokai` | Monokai 风格主题 |
| `dracula` | Dracula 风格主题 |

**自定义主题颜色**

使用 `preset: "custom"` 并通过 `overrides` 覆盖部分颜色:

```json
{
"theme": {
"preset": "custom",
"overrides": {
"primary": "#ff6600",
"success": "greenBright"
}
}
}
```

**可用的颜色 Token**

| Token | 说明 | 默认值 |
| ------------ | -------------------------------------------- | ---------- |
| `primary` | 品牌色:Logo、用户消息、选中项、标题 | `#229ac3` |
| `secondary` | 辅助品牌色:边框、渐变 | `#229ac3e6`|
| `success` | 成功:工具执行成功、低风险操作 | `#1a7f37` |
| `error` | 错误:工具执行失败、高风险操作 | `#d1242f` |
| `warning` | 警告:进行中状态、中风险操作 | `#fa8c16` |
| `info` | 信息:技能、图片附件 | `#0969da` |
| `text` | 主文字颜色 | `#3D4149` |
| `textDim` | 次要文字:暗化提示、引用块 | `#646A71` |
| `textBright` | 亮色文字:强调提示 | `#1F2329` |
| `code` | 代码块/内联代码 | `#787f8a` |
| `border` | 边框 | `#999` |
| `gradients` | Logo 渐变色数组 | `["#229ac3", "#8250df"]` |

颜色值支持以下格式:
- Hex 格式:`"#ff6600"`、`"#ff6600cc"`(带透明度)
- Chalk 命名颜色:`"greenBright"`、`"cyanBright"`、`"red"` 等

**运行时切换主题**

在 CLI 中使用 `/theme` 命令打开主题选择器,使用方向键浏览主题,按 Space 或 Enter 确认选择:

```
/theme # 打开主题选择器
```

选择器中可用的主题与上表一致。在浏览过程中会实时预览主题效果,按 Esc 可取消并恢复原主题。确认后会自动保存到 `settings.json`,下次启动时生效。

#### `debugLogEnabled` — 调试日志

设为 `true` 可让程序输出详细的调试日志(默认 `false`),用于排查 API 调用和工具执行的问题。
Expand Down
Loading
Loading