fix(docs): translations

This commit is contained in:
Adam
2026-02-09 18:11:44 -06:00
parent 3118cab2d8
commit 85fa8abd50
312 changed files with 3578 additions and 3189 deletions

View File

@@ -1,9 +1,9 @@
---
title: 插件
description: 編寫您自己的插件來擴展 OpenCode。
description: 編寫您自己的插件來擴展 opencode。
---
插件允許您通過掛鉤各種事件和自定義行為來擴展 OpenCode。您可以創建插件來添加新功能、與外部服務集成或修改 OpenCode 的默認行為。
插件允許您通過掛鉤各種事件和自定義行為來擴展 opencode。您可以創建插件來添加新功能、與外部服務集成或修改 opencode 的默認行為。
例如,查看社區創建的[插件](/docs/ecosystem#plugins)。
@@ -83,7 +83,7 @@ description: 編寫您自己的插件來擴展 OpenCode。
}
```
OpenCode 在啟動時運行 `bun install` 來安裝這些。然後您的插件和工具就可以導入它們。
opencode 在啟動時運行 `bun install` 來安裝這些。然後您的插件和工具就可以導入它們。
```ts title=".opencode/plugins/my-plugin.ts"
import { escape } from "shescape"
@@ -118,7 +118,7 @@ export const MyPlugin = async ({ project, client, $, directory, worktree }) => {
- `project`:當前項目信息。
- `directory`:當前工作目錄。
- `worktree`git 工作樹路徑。
- `client`:用於與 AI 交互的開放代碼 SDK 客戶端。
- `client`:用於與 AI 交互的opencode SDK 客戶端。
- `$`Bun的[外殼API](https://bun.com/docs/runtime/shell)用於執行命令。
---
@@ -201,7 +201,7 @@ export const MyPlugin: Plugin = async ({ project, client, $, directory, worktree
- `tool.execute.after`
- `tool.execute.before`
#### 途易活動
#### TUI 活動
- `tui.prompt.append`
- `tui.command.execute`
@@ -235,7 +235,7 @@ export const NotificationPlugin = async ({ project, client, $, directory, worktr
我們使用 `osascript` 在 macOS 上運行 AppleScript。這裡我們用它來發送通知。
:::note
如果您使用 OpenCode 桌面應用程序,它可以在響應準備就緒或會話出錯時自動發送系統通知。
如果您使用 opencode 桌面應用程序,它可以在響應準備就緒或會話出錯時自動發送系統通知。
:::
---
@@ -306,7 +306,7 @@ export const CustomToolsPlugin: Plugin = async (ctx) => {
- `args`:工具參數的 Zod 模式
- `execute`:調用工具時運行的函數
您的自定義工具將可與內置工具一起用於開放代碼
您的自定義工具將可與內置工具一起用於opencode
---