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
8 changes: 4 additions & 4 deletions packages/web/src/content/docs/zh-cn/agents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ Markdown 文件名即为代理名称。例如,`review.md` 会创建一个名
使用 `model` 配置为代理覆盖模型。适用于针对不同任务使用不同的优化模型。例如,用更快的模型进行规划,用更强大的模型进行实现。

:::tip
如果您不指定模型,主代理将使用[全局配置的模型](/docs/config#models),而子代理将使用调用它的主代理所使用的模型。
如果您不指定模型,主代理将使用[全局配置的模型](/docs/zh-cn/config#models),而子代理将使用调用它的主代理所使用的模型。
:::

```json title="opencode.json"
Expand All @@ -366,7 +366,7 @@ Markdown 文件名即为代理名称。例如,`review.md` 会创建一个名
}
```

OpenCode 配置中的模型 ID 使用 `provider/model-id` 格式。例如,如果您使用 [OpenCode Zen](/docs/zen),则可以使用 `opencode/gpt-5.1-codex` 来表示 GPT 5.1 Codex。
OpenCode 配置中的模型 ID 使用 `provider/model-id` 格式。例如,如果您使用 [OpenCode Zen](/docs/zh-cn/zen),则可以使用 `opencode/gpt-5.1-codex` 来表示 GPT 5.1 Codex。

---

Expand Down Expand Up @@ -413,7 +413,7 @@ OpenCode 配置中的模型 ID 使用 `provider/model-id` 格式。例如,如
}
```

[了解更多关于工具的信息](/docs/tools)。
[了解更多关于工具的信息](/docs/zh-cn/tools)。

---

Expand Down Expand Up @@ -525,7 +525,7 @@ Only analyze code and suggest changes.
}
```

[了解更多关于权限的信息](/docs/permissions)。
[了解更多关于权限的信息](/docs/zh-cn/permissions)。

---

Expand Down
8 changes: 4 additions & 4 deletions packages/web/src/content/docs/zh-cn/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: OpenCode CLI 选项和命令。

import { Tabs, TabItem } from "@astrojs/starlight/components"

OpenCode CLI 在不带任何参数运行时,默认启动 [TUI](/docs/tui)。
OpenCode CLI 在不带任何参数运行时,默认启动 [TUI](/docs/zh-cn/tui)。

```bash
opencode
Expand Down Expand Up @@ -177,7 +177,7 @@ opencode github [command]
opencode github install
```

此命令会设置必要的 GitHub Actions 工作流并引导您完成配置过程。[了解更多](/docs/github)。
此命令会设置必要的 GitHub Actions 工作流并引导您完成配置过程。[了解更多](/docs/zh-cn/github)。

---

Expand Down Expand Up @@ -290,7 +290,7 @@ opencode models [provider]

此命令以 `provider/model` 的格式显示所有已配置提供商中可用的模型。

这对于确定在[配置文件](/docs/config/)中使用的确切模型名称非常有用。
这对于确定在[配置文件](/docs/zh-cn/config/)中使用的确切模型名称非常有用。

您可以选择传入提供商 ID 来按提供商筛选模型。

Expand Down Expand Up @@ -363,7 +363,7 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"

### serve

启动无界面的 OpenCode 服务器以提供 API 访问。查看[服务器文档](/docs/server)了解完整的 HTTP 接口。
启动无界面的 OpenCode 服务器以提供 API 访问。查看[服务器文档](/docs/zh-cn/server)了解完整的 HTTP 接口。

```bash
opencode serve
Expand Down
16 changes: 8 additions & 8 deletions packages/web/src/content/docs/zh-cn/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: 为重复任务创建自定义命令。
/my-command
```

自定义命令是 `/init`、`/undo`、`/redo`、`/share`、`/help` 等内置命令之外的补充。[了解更多](/docs/tui#commands)。
自定义命令是 `/init`、`/undo`、`/redo`、`/share`、`/help` 等内置命令之外的补充。[了解更多](/docs/zh-cn/tui#commands)。

---

Expand Down Expand Up @@ -48,7 +48,7 @@ frontmatter 定义命令属性,内容则成为模板。

### JSON

在 OpenCode [配置](/docs/config)中使用 `command` 选项:
在 OpenCode [配置](/docs/zh-cn/config)中使用 `command` 选项:

```json title="opencode.jsonc" {4-12}
{
Expand Down Expand Up @@ -162,7 +162,7 @@ with the following content: $3

### Shell 输出

使用 _!`command`_ 将 [bash 命令](/docs/tui#bash-commands)输出注入到提示词中。
使用 _!`command`_ 将 [bash 命令](/docs/zh-cn/tui#bash-commands)输出注入到提示词中。

例如,创建一个分析测试覆盖率的自定义命令:

Expand Down Expand Up @@ -255,8 +255,8 @@ Check for performance issues and suggest improvements.

### Agent

使用 `agent` 配置可选地指定由哪个[代理](/docs/agents)执行此命令。
如果这是一个[子代理](/docs/agents/#subagents),该命令默认会触发子代理调用。
使用 `agent` 配置可选地指定由哪个[代理](/docs/zh-cn/agents)执行此命令。
如果这是一个[子代理](/docs/zh-cn/agents/#subagents),该命令默认会触发子代理调用。
要禁用此行为,请将 `subtask` 设置为 `false`。

```json title="opencode.json"
Expand All @@ -275,9 +275,9 @@ Check for performance issues and suggest improvements.

### Subtask

使用 `subtask` 布尔值强制命令触发[子代理](/docs/agents/#subagents)调用。
使用 `subtask` 布尔值强制命令触发[子代理](/docs/zh-cn/agents/#subagents)调用。
如果你希望命令不污染主要上下文,这会很有用,它会**强制**代理作为子代理运行,
即使[代理](/docs/agents)配置中的 `mode` 设置为 `primary`。
即使[代理](/docs/zh-cn/agents)配置中的 `mode` 设置为 `primary`。

```json title="opencode.json"
{
Expand Down Expand Up @@ -313,7 +313,7 @@ Check for performance issues and suggest improvements.

## 内置命令

opencode 包含多个内置命令,如 `/init`、`/undo`、`/redo`、`/share`、`/help`;[了解更多](/docs/tui#commands)。
opencode 包含多个内置命令,如 `/init`、`/undo`、`/redo`、`/share`、`/help`;[了解更多](/docs/zh-cn/tui#commands)。

:::note
自定义命令可以覆盖内置命令。
Expand Down
36 changes: 18 additions & 18 deletions packages/web/src/content/docs/zh-cn/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ opencode run "Hello world"
- `scroll_speed` - 自定义滚动速度倍率(默认值:`3`,最小值:`1`)。如果 `scroll_acceleration.enabled` 为 `true`,则忽略此选项。
- `diff_style` - 控制差异渲染方式。`"auto"` 根据终端宽度自适应,`"stacked"` 始终显示单列。

[在此了解更多关于 TUI 的信息](/docs/tui)。
[在此了解更多关于 TUI 的信息](/docs/zh-cn/tui)。

---

Expand Down Expand Up @@ -201,7 +201,7 @@ opencode run "Hello world"
- `mdnsDomain` - mDNS 服务的自定义域名。默认为 `opencode.local`。适用于在同一网络上运行多个实例的场景。
- `cors` - 从基于浏览器的客户端使用 HTTP 服务器时允许 CORS 的额外来源。值必须是完整的来源(协议 + 主机 + 可选端口),例如 `https://app.example.com`。

[在此了解更多关于服务器的信息](/docs/server)。
[在此了解更多关于服务器的信息](/docs/zh-cn/server)。

---

Expand All @@ -219,7 +219,7 @@ opencode run "Hello world"
}
```

[在此了解更多关于工具的信息](/docs/tools)。
[在此了解更多关于工具的信息](/docs/zh-cn/tools)。

---

Expand Down Expand Up @@ -257,7 +257,7 @@ opencode run "Hello world"
- `timeout` - 请求超时时间,单位为毫秒(默认值:300000)。设置为 `false` 可禁用超时。
- `setCacheKey` - 确保始终为指定提供商设置缓存键。

您还可以配置[本地模型](/docs/models#local)。[了解更多](/docs/models)。
您还可以配置[本地模型](/docs/zh-cn/models#local)。[了解更多](/docs/zh-cn/models)。

---

Expand Down Expand Up @@ -289,10 +289,10 @@ Amazon Bedrock 支持 AWS 特定配置:
- `endpoint` - VPC 端点的自定义端点 URL。这是通用 `baseURL` 选项使用 AWS 特定术语的别名。如果两者都指定,`endpoint` 优先。

:::note
Bearer Token(`AWS_BEARER_TOKEN_BEDROCK` 或 `/connect`)优先于基于配置文件的身份验证。详情请参见[身份验证优先级](/docs/providers#authentication-precedence)。
Bearer Token(`AWS_BEARER_TOKEN_BEDROCK` 或 `/connect`)优先于基于配置文件的身份验证。详情请参见[身份验证优先级](/docs/zh-cn/providers#authentication-precedence)。
:::

[了解更多关于 Amazon Bedrock 配置的信息](/docs/providers#amazon-bedrock)。
[了解更多关于 Amazon Bedrock 配置的信息](/docs/zh-cn/providers#amazon-bedrock)。

---

Expand All @@ -307,7 +307,7 @@ Bearer Token(`AWS_BEARER_TOKEN_BEDROCK` 或 `/connect`)优先于基于配置
}
```

[在此了解更多](/docs/themes)。
[在此了解更多](/docs/zh-cn/themes)。

---

Expand All @@ -333,7 +333,7 @@ Bearer Token(`AWS_BEARER_TOKEN_BEDROCK` 或 `/connect`)优先于基于配置
}
```

您还可以使用 `~/.config/opencode/agents/` 或 `.opencode/agents/` 中的 Markdown 文件定义代理。[在此了解更多](/docs/agents)。
您还可以使用 `~/.config/opencode/agents/` 或 `.opencode/agents/` 中的 Markdown 文件定义代理。[在此了解更多](/docs/zh-cn/agents)。

---

Expand All @@ -348,15 +348,15 @@ Bearer Token(`AWS_BEARER_TOKEN_BEDROCK` 或 `/connect`)优先于基于配置
}
```

默认代理必须是主代理(不能是子代理)。可以是内置代理(如 `"build"` 或 `"plan"`),也可以是您定义的[自定义代理](/docs/agents)。如果指定的代理不存在或是子代理,OpenCode 将回退到 `"build"` 并发出警告。
默认代理必须是主代理(不能是子代理)。可以是内置代理(如 `"build"` 或 `"plan"`),也可以是您定义的[自定义代理](/docs/zh-cn/agents)。如果指定的代理不存在或是子代理,OpenCode 将回退到 `"build"` 并发出警告。

此设置适用于所有界面:TUI、CLI(`opencode run`)、桌面应用和 GitHub Action。

---

### 分享

您可以通过 `share` 选项配置[分享](/docs/share)功能。
您可以通过 `share` 选项配置[分享](/docs/zh-cn/share)功能。

```json title="opencode.json"
{
Expand Down Expand Up @@ -397,7 +397,7 @@ Bearer Token(`AWS_BEARER_TOKEN_BEDROCK` 或 `/connect`)优先于基于配置
}
```

您还可以使用 `~/.config/opencode/commands/` 或 `.opencode/commands/` 中的 Markdown 文件定义命令。[在此了解更多](/docs/commands)。
您还可以使用 `~/.config/opencode/commands/` 或 `.opencode/commands/` 中的 Markdown 文件定义命令。[在此了解更多](/docs/zh-cn/commands)。

---

Expand All @@ -412,7 +412,7 @@ Bearer Token(`AWS_BEARER_TOKEN_BEDROCK` 或 `/connect`)优先于基于配置
}
```

[在此了解更多](/docs/keybinds)。
[在此了解更多](/docs/zh-cn/keybinds)。

---

Expand Down Expand Up @@ -454,7 +454,7 @@ OpenCode 启动时会自动下载新版本。您可以使用 `autoupdate` 选项
}
```

[在此了解更多关于格式化程序的信息](/docs/formatters)。
[在此了解更多关于格式化程序的信息](/docs/zh-cn/formatters)。

---

Expand All @@ -474,7 +474,7 @@ OpenCode 启动时会自动下载新版本。您可以使用 `autoupdate` 选项
}
```

[在此了解更多关于权限的信息](/docs/permissions)。
[在此了解更多关于权限的信息](/docs/zh-cn/permissions)。

---

Expand Down Expand Up @@ -527,13 +527,13 @@ OpenCode 启动时会自动下载新版本。您可以使用 `autoupdate` 选项
}
```

[在此了解更多](/docs/mcp-servers)。
[在此了解更多](/docs/zh-cn/mcp-servers)。

---

### 插件

[插件](/docs/plugins)通过自定义工具、钩子和集成来扩展 OpenCode。
[插件](/docs/zh-cn/plugins)通过自定义工具、钩子和集成来扩展 OpenCode。

将插件文件放置在 `.opencode/plugins/` 或 `~/.config/opencode/plugins/` 中。您还可以通过 `plugin` 选项从 npm 加载插件。

Expand All @@ -544,7 +544,7 @@ OpenCode 启动时会自动下载新版本。您可以使用 `autoupdate` 选项
}
```

[在此了解更多](/docs/plugins)。
[在此了解更多](/docs/zh-cn/plugins)。

---

Expand All @@ -559,7 +559,7 @@ OpenCode 启动时会自动下载新版本。您可以使用 `autoupdate` 选项
}
```

该选项接受指令文件路径和 glob 模式的数组。[在此了解更多关于规则的信息](/docs/rules)。
该选项接受指令文件路径和 glob 模式的数组。[在此了解更多关于规则的信息](/docs/zh-cn/rules)。

---

Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/content/docs/zh-cn/custom-tools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: 自定义工具
description: 创建 LLM 可在 opencode 中调用的工具。
---

自定义工具是你创建的函数,LLM 可以在对话过程中调用它们。它们与 opencode 的[内置工具](/docs/tools)(如 `read`、`write` 和 `bash`)协同工作。
自定义工具是你创建的函数,LLM 可以在对话过程中调用它们。它们与 opencode 的[内置工具](/docs/zh-cn/tools)(如 `read`、`write` 和 `bash`)协同工作。

---

Expand Down Expand Up @@ -100,7 +100,7 @@ export default tool({
```

:::note
除非你有意替换内置工具,否则最好用独特的名字。如果你想禁用内置工具但不想覆盖它,使用 [权限](/docs/permissions).
除非你有意替换内置工具,否则最好用独特的名字。如果你想禁用内置工具但不想覆盖它,使用 [权限](/docs/zh-cn/permissions).
:::

---
Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/content/docs/zh-cn/enterprise.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ OpenCode 不会存储您的任何代码或上下文数据。

## 试用

OpenCode 是开源的,不会存储您的任何代码或上下文数据,因此您的开发人员可以直接[开始使用](/docs/)并进行试用。
OpenCode 是开源的,不会存储您的任何代码或上下文数据,因此您的开发人员可以直接[开始使用](/docs/zh-cn/)并进行试用。

---

Expand Down Expand Up @@ -50,7 +50,7 @@ OpenCode 是开源的,不会存储您的任何代码或上下文数据,因
}
```

[了解更多关于分享的信息](/docs/share)。
[了解更多关于分享的信息](/docs/zh-cn/share)。

---

Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/content/docs/zh-cn/formatters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ OpenCode 内置了多种适用于主流语言和框架的格式化工具。下
| nixfmt | .nix | `nixfmt` 命令可用 |
| ocamlformat | .ml, .mli | `ocamlformat` 命令可用且存在 `.ocamlformat` 配置文件 |
| ormolu | .hs | `ormolu` 命令可用 |
| oxfmt (Experimental) | .js, .jsx, .ts, .tsx | `package.json` 中有 `oxfmt` 依赖,且设置了[实验性环境变量标志](/docs/cli/#experimental) |
| oxfmt (Experimental) | .js, .jsx, .ts, .tsx | `package.json` 中有 `oxfmt` 依赖,且设置了[实验性环境变量标志](/docs/zh-cn/cli/#experimental) |
| pint | .php | `composer.json` 中有 `laravel/pint` 依赖 |
| prettier | .js, .jsx, .ts, .tsx, .html, .css, .md, .json, .yaml 及[更多](https://prettier.io/docs/en/index.html) | `package.json` 中有 `prettier` 依赖 |
| rubocop | .rb, .rake, .gemspec, .ru | `rubocop` 命令可用 |
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/content/docs/zh-cn/go.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ OpenCode Go 包含以下限制:
| Qwen3.7 Plus | qwen3.7-plus | `https://opencode.ai/zen/go/v1/messages` | `@ai-sdk/anthropic` |
| Qwen3.6 Plus | qwen3.6-plus | `https://opencode.ai/zen/go/v1/messages` | `@ai-sdk/anthropic` |

你 OpenCode 配置中的 [模型 ID](/docs/config/#models) 使用 `opencode-go/<model-id>` 格式。例如,对于 Kimi K2.6,你将在配置中使用 `opencode-go/kimi-k2.6`。
你 OpenCode 配置中的 [模型 ID](/docs/zh-cn/config/#models) 使用 `opencode-go/<model-id>` 格式。例如,对于 Kimi K2.6,你将在配置中使用 `opencode-go/kimi-k2.6`。

---

Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/content/docs/zh-cn/ide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ OpenCode 可与 VS Code、Cursor 或任何支持终端的 IDE 集成。只需在
2. 打开集成终端
3. 运行 `opencode`——扩展将自动安装

如果你希望在 TUI 中执行 `/editor` 或 `/export` 时使用自己的 IDE,需要设置 `export EDITOR="code --wait"`。[了解更多](/docs/tui/#editor-setup)。
如果你希望在 TUI 中执行 `/editor` 或 `/export` 时使用自己的 IDE,需要设置 `export EDITOR="code --wait"`。[了解更多](/docs/zh-cn/tui/#editor-setup)。

---

Expand Down
10 changes: 5 additions & 5 deletions packages/web/src/content/docs/zh-cn/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ curl -fsSL https://opencode.ai/install | bash
#### Windows

:::tip[推荐:使用 WSL]
为了在 Windows 上获得最佳体验,我们推荐使用 [Windows Subsystem for Linux (WSL)](/docs/windows-wsl)。它提供更好的性能,并完全兼容 OpenCode 的所有功能。
为了在 Windows 上获得最佳体验,我们推荐使用 [Windows Subsystem for Linux (WSL)](/docs/zh-cn/windows-wsl)。它提供更好的性能,并完全兼容 OpenCode 的所有功能。
:::

- **使用 Chocolatey**
Expand Down Expand Up @@ -134,7 +134,7 @@ curl -fsSL https://opencode.ai/install | bash

通过 OpenCode,你可以配置 API 密钥来使用任意 LLM 提供商。

如果你刚开始接触 LLM 提供商,我们推荐使用 [OpenCode Zen](/docs/zen)。这是一组经过 OpenCode 团队测试和验证的精选模型。
如果你刚开始接触 LLM 提供商,我们推荐使用 [OpenCode Zen](/docs/zh-cn/zen)。这是一组经过 OpenCode 团队测试和验证的精选模型。

1. 在 TUI 中运行 `/connect` 命令,选择 opencode,然后前往 [opencode.ai/auth](https://opencode.ai/auth)。

Expand All @@ -153,7 +153,7 @@ curl -fsSL https://opencode.ai/install | bash
└ enter
```

你也可以选择其他提供商。[了解更多](/docs/providers#directory)。
你也可以选择其他提供商。[了解更多](/docs/zh-cn/providers#directory)。

---

Expand Down Expand Up @@ -320,7 +320,7 @@ Can you refactor the function in @packages/functions/src/api/index.ts?

## 分享

你与 OpenCode 的对话可以[与团队分享](/docs/share)。
你与 OpenCode 的对话可以[与团队分享](/docs/zh-cn/share)。

```bash frame="none"
/share
Expand All @@ -340,4 +340,4 @@ Can you refactor the function in @packages/functions/src/api/index.ts?

以上就是全部内容!你现在已经是 OpenCode 的使用高手了。

要让它更符合你的习惯,我们推荐[选择一个主题](/docs/themes)、[自定义快捷键](/docs/keybinds)、[配置代码格式化工具](/docs/formatters)、[创建自定义命令](/docs/commands),或者探索 [OpenCode 配置](/docs/config)。
要让它更符合你的习惯,我们推荐[选择一个主题](/docs/zh-cn/themes)、[自定义快捷键](/docs/zh-cn/keybinds)、[配置代码格式化工具](/docs/zh-cn/formatters)、[创建自定义命令](/docs/zh-cn/commands),或者探索 [OpenCode 配置](/docs/zh-cn/config)。
Loading
Loading