Skip to content

Commit 9223464

Browse files
committed
docs(zh-CN): 同步 README 中文版能力表与示例
1 parent 2264eb5 commit 9223464

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

README.zh-CN.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@
6868
| 其他 API | 可用 | commands、skills、formatters、LSPs、MCP servers、path、VCS、instance dispose、global upgrade |
6969
| Question / permission API | 可用 | 待回答问题与权限、reply / reject |
7070
| SSE 事件流 | 可用 | `subscribe``subscribeQueue``subscribeSession``subscribeEventTypes`、类型化 `EventHandler` |
71-
| CLI 封装 | 可用 | `run``runJson`、sessions、agents、models、providers/auth、MCP、stats、export / import、db、debug、serve / web / attach、github、plugin、console |
71+
| CLI 封装 | 可用 | `run``runJson``run(RunOptions)` 全旗标、`tui(TuiOptions)`、sessions、agents、models、providers/auth、MCP(含 `mcp auth list`)、stats、export / import、db、debug、serve / web / attach 全旗标(`--mdns/--cors/--mdns-domain`)、github、plugin、console、`raw` 逃生通道 |
72+
| MCP 配置模型 | 可用 | `McpServerConfig``local` stdio / `remote` HTTP-SSE,environment/headers/oauth/timeout/enabled),接入 `OpenCodeConfig.mcp` |
7273

7374
<a id="3-requirements--compatibility"></a>
7475
## 3. 运行要求与兼容性
@@ -241,6 +242,17 @@ OpenCodeCliResult result = cli.run("Explain async/await in JavaScript");
241242
System.out.println(result.getStdout());
242243

243244
cli.run("Hello", "plan", "anthropic/claude-sonnet-4-5"); // agent + model
245+
246+
// 全旗标 run(--command/--continue/--fork/--share/--file/--title/--attach/
247+
// --variant/--thinking/--dir/--port 均可组合)
248+
cli.run(new OpenCodeRunOptions("修复失败的测试")
249+
.model("anthropic/claude-sonnet-4-5")
250+
.format("json")
251+
.attach("http://localhost:4096")
252+
.variant("high"));
253+
254+
// 交互式 TUI
255+
cli.tui(new OpenCodeTuiOptions().project(".").continueLast(true).fork(true));
244256
cli.sessionList();
245257
cli.serve(4096, "127.0.0.1"); // opencode serve --port 4096 --hostname 127.0.0.1
246258
cli.upgrade("v1.18.0", "npm");

0 commit comments

Comments
 (0)