fix(docs): translations
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
---
|
||||
title: 簡介
|
||||
description: 开始使用OpenCode。
|
||||
description: 开始使用opencode。
|
||||
---
|
||||
|
||||
import { Tabs, TabItem } from "@astrojs/starlight/components"
|
||||
import config from "../../../../config.mjs"
|
||||
export const console = config.console
|
||||
|
||||
[**开放代码**](/)是一个开源人工智能编码代理。它可用于基于终端的界面、桌面应用程序或IDE扩展。
|
||||
[**opencode**](/)是一个开源人工智能编码代理。它可用于基于终端的界面、桌面应用程序或IDE扩展。
|
||||
|
||||

|
||||

|
||||
|
||||
讓我們開始吧。
|
||||
|
||||
@@ -17,7 +17,7 @@ export const console = config.console
|
||||
|
||||
#### 先決條件
|
||||
|
||||
要在终端中使用OpenCode,您需要:
|
||||
要在终端中使用opencode,您需要:
|
||||
|
||||
1. 現代終端模擬器,例如:
|
||||
- [韦兹术语](https://wezterm.org),跨平台
|
||||
@@ -31,7 +31,7 @@ export const console = config.console
|
||||
|
||||
## 安裝
|
||||
|
||||
安装 OpenCode 最简单的方法是通过安装脚本。
|
||||
安装 opencode 最简单的方法是通过安装脚本。
|
||||
|
||||
```bash
|
||||
curl -fsSL https://opencode.ai/install | bash
|
||||
@@ -79,7 +79,7 @@ curl -fsSL https://opencode.ai/install | bash
|
||||
brew install anomalyco/tap/opencode
|
||||
```
|
||||
|
||||
> 我们使用 OpenCode Tap 来获取最新版本。官方 `brew install opencode` 公式由 Homebrew 团队建议,维护频率较低。
|
||||
> 我们使用 opencode Tap 来获取最新版本。官方 `brew install opencode` 公式由 Homebrew 团队建议,维护频率较低。
|
||||
|
||||
- **在 Arch Linux 上使用 Paru**
|
||||
|
||||
@@ -90,7 +90,7 @@ curl -fsSL https://opencode.ai/install | bash
|
||||
#### 視窗
|
||||
|
||||
:::tip[Recommended: 使用 WSL]
|
||||
为了在 Windows 上获得最佳体验,我们建议使用[适用于 Linux 的 Windows 子系统 (WSL)](/docs/windows-wsl)。它提供了更好的性能并与 OpenCode 的功能完全兼容。
|
||||
为了在 Windows 上获得最佳体验,我们建议使用[适用于 Linux 的 Windows 子系统 (WSL)](/docs/windows-wsl)。它提供了更好的性能并与 opencode 的功能完全兼容。
|
||||
:::
|
||||
|
||||
- **使用巧克力**
|
||||
@@ -123,7 +123,7 @@ curl -fsSL https://opencode.ai/install | bash
|
||||
docker run -it --rm ghcr.io/anomalyco/opencode
|
||||
```
|
||||
|
||||
目前正在支持在 Windows 上安装 OpenCode 时使用 Bun。
|
||||
目前正在支持在 Windows 上安装 opencode 时使用 Bun。
|
||||
|
||||
您还可以从[发布](https://github.com/anomalyco/opencode/releases) 获取二进制文件。
|
||||
|
||||
@@ -131,10 +131,10 @@ curl -fsSL https://opencode.ai/install | bash
|
||||
|
||||
## 配置
|
||||
|
||||
借助 OpenCode,您可以通过配置 API 来使用任何 LLM 成功。
|
||||
借助 opencode,您可以通过配置 API 来使用任何 LLM 成功。
|
||||
|
||||
如果您不熟悉使用 LLM 成功,我们建议使用[开放代码禅](/docs/zen)。
|
||||
这是经过 OpenCode 测试和验证的精选模型列表
|
||||
如果您不熟悉使用 LLM 成功,我们建议使用[OpenCode Zen](/docs/zen)。
|
||||
这是经过 opencode 测试和验证的精选模型列表
|
||||
團隊。
|
||||
|
||||
1. 在 TUI 中运行 `/connect` 命令,选择 opencode,然后前往 [opencode.ai/auth](https://opencode.ai/auth)。
|
||||
@@ -167,33 +167,33 @@ curl -fsSL https://opencode.ai/install | bash
|
||||
cd /path/to/project
|
||||
```
|
||||
|
||||
并运行OpenCode。
|
||||
并运行opencode。
|
||||
|
||||
```bash
|
||||
opencode
|
||||
```
|
||||
|
||||
接下来,通过运行以下命令来初始化项目的 OpenCode。
|
||||
接下来,通过运行以下命令来初始化项目的 opencode。
|
||||
|
||||
```bash frame="none"
|
||||
/init
|
||||
```
|
||||
|
||||
这涉及 OpenCode 分析您的项目并在以下位置创建 `AGENTS.md` 文件
|
||||
这涉及 opencode 分析您的项目并在以下位置创建 `AGENTS.md` 文件
|
||||
項目根。
|
||||
|
||||
:::tip
|
||||
您应该将项目的 `AGENTS.md` 文件提交到 Git。
|
||||
:::
|
||||
|
||||
这有助于 OpenCode 理解项目结构和编码模式
|
||||
这有助于 opencode 理解项目结构和编码模式
|
||||
用過的。
|
||||
|
||||
---
|
||||
|
||||
## 用法
|
||||
|
||||
您现在已准备好使用 OpenCode 来处理您的项目。请轻松询问
|
||||
您现在已准备好使用 opencode 来处理您的项目。请轻松询问
|
||||
任何事物!
|
||||
|
||||
如果您不熟悉使用 AI 编码代理,以下是一些可能会有所帮助的示例
|
||||
@@ -203,7 +203,7 @@ opencode
|
||||
|
||||
### 提出問題
|
||||
|
||||
您可以要求 OpenCode 向您解释代码库。
|
||||
您可以要求 opencode 向您解释代码库。
|
||||
|
||||
:::tip
|
||||
使用`@`鍵模糊搜索工程中的文件。
|
||||
@@ -219,11 +219,11 @@ How is authentication handled in @packages/functions/src/api/index.ts
|
||||
|
||||
### 添加功能
|
||||
|
||||
您可以要求 OpenCode 向您的项目添加新功能。但是我们首先建议要求它制定一个计划。
|
||||
您可以要求 opencode 向您的项目添加新功能。但是我们首先建议要求它制定一个计划。
|
||||
|
||||
1. **制定計劃**
|
||||
|
||||
OpenCode 有一个*计划模式*,该模式禁止其进行更改和
|
||||
opencode 有一个*计划模式*,该模式禁止其进行更改和
|
||||
相反,建議*如何*實現該功能。
|
||||
|
||||
使用 **Tab** 键切换到它。您会在右下角有一个指示符。
|
||||
@@ -240,11 +240,11 @@ How is authentication handled in @packages/functions/src/api/index.ts
|
||||
From this screen, the user can undelete a note or permanently delete it.
|
||||
```
|
||||
|
||||
您需要为 OpenCode 提供足够的详细信息才能了解您想要的内容。它有帮助
|
||||
您需要为 opencode 提供足够的详细信息才能了解您想要的内容。它有帮助
|
||||
就像與團隊中的初級開發人員交談一樣與它交談。
|
||||
|
||||
:::提示
|
||||
为 OpenCode 提供大量上下文和示例,以帮助其理解您的内容
|
||||
为 opencode 提供大量上下文和示例,以帮助其理解您的内容
|
||||
想。
|
||||
:::
|
||||
|
||||
@@ -261,7 +261,7 @@ How is authentication handled in @packages/functions/src/api/index.ts
|
||||
將圖像拖放到終端中以將其添加到提示中。
|
||||
:::
|
||||
|
||||
OpenCode 可以扫描您提供的任何图像并将其添加到提示中。您可以
|
||||
opencode 可以扫描您提供的任何图像并将其添加到提示中。您可以
|
||||
通過將圖像拖放到終端中來完成此操作。
|
||||
|
||||
3. **構建功能**
|
||||
@@ -283,7 +283,7 @@ How is authentication handled in @packages/functions/src/api/index.ts
|
||||
|
||||
### 做出改變
|
||||
|
||||
对于更直接的更改,您可以要求 OpenCode 直接构建它
|
||||
对于更直接的更改,您可以要求 opencode 直接构建它
|
||||
無需先審查計劃。
|
||||
|
||||
```txt frame="none" "@packages/functions/src/settings.ts" "@packages/functions/src/notes.ts"
|
||||
@@ -292,14 +292,14 @@ handled in the /notes route in @packages/functions/src/notes.ts and implement
|
||||
the same logic in @packages/functions/src/settings.ts
|
||||
```
|
||||
|
||||
您需要确保提供大量详细信息,以便 OpenCode 做出正确的决定
|
||||
您需要确保提供大量详细信息,以便 opencode 做出正确的决定
|
||||
變化。
|
||||
|
||||
---
|
||||
|
||||
### 撤消更改
|
||||
|
||||
假设您要求 OpenCode 进行一些更改。
|
||||
假设您要求 opencode 进行一些更改。
|
||||
|
||||
```txt frame="none" "@packages/functions/src/api/index.ts"
|
||||
Can you refactor the function in @packages/functions/src/api/index.ts?
|
||||
@@ -312,14 +312,14 @@ Can you refactor the function in @packages/functions/src/api/index.ts?
|
||||
/undo
|
||||
```
|
||||
|
||||
OpenCode 现在将恢复您所做的更改并显示您的原始消息
|
||||
opencode 现在将恢复您所做的更改并显示您的原始消息
|
||||
再次。
|
||||
|
||||
```txt frame="none" "@packages/functions/src/api/index.ts"
|
||||
Can you refactor the function in @packages/functions/src/api/index.ts?
|
||||
```
|
||||
|
||||
您可以从这里调整提示并要求 OpenCode 重试。
|
||||
您可以从这里调整提示并要求 opencode 重试。
|
||||
|
||||
:::tip
|
||||
您可以多次运行 `/undo` 以取消消减更改。
|
||||
@@ -335,7 +335,7 @@ Can you refactor the function in @packages/functions/src/api/index.ts?
|
||||
|
||||
## 分享
|
||||
|
||||
您与 OpenCode 的对话可以[与您的
|
||||
您与 opencode 的对话可以[与您的
|
||||
團隊](/docs/分享)。
|
||||
|
||||
```bash frame="none"
|
||||
@@ -348,12 +348,12 @@ Can you refactor the function in @packages/functions/src/api/index.ts?
|
||||
默認情況下不共享對話。
|
||||
:::
|
||||
|
||||
这是带有 OpenCode 的[示例对话](https://opencode.ai/s/4XP1fce5)。
|
||||
这是带有 opencode 的[示例对话](https://opencode.ai/s/4XP1fce5)。
|
||||
|
||||
---
|
||||
|
||||
## 定制
|
||||
|
||||
就是这样!您现在已经是使用 OpenCode 的专家了。
|
||||
就是这样!您现在已经是使用 opencode 的专家了。
|
||||
|
||||
要让您成为自己的,我们建议[选择一个主题](/docs/themes)、[自定义交互绑定](/docs/keybinds)、[配置代码整理程序](/docs/formatters)、[创建自定义命令](/docs/commands)或使用[开放代码配置](/docs/config)。
|
||||
要让您成为自己的,我们建议[选择一个主题](/docs/themes)、[自定义交互绑定](/docs/keybinds)、[配置代码整理程序](/docs/formatters)、[创建自定义命令](/docs/commands)或使用[opencode配置](/docs/config)。
|
||||
|
||||
Reference in New Issue
Block a user