mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-17 05:26:47 +03:00
docs(core): point the opencode skill at the opencode tools before the api cli (#62375)
This commit is contained in:
@@ -191,10 +191,20 @@ opencode service status
|
||||
OpenCode exposes an HTTP API from its server. The API is described by an
|
||||
OpenAPI document available from the running server at `/openapi.json`.
|
||||
|
||||
Use OpenCode's built-in `api` command for local requests. It uses the same
|
||||
discovery and authentication flow as the TUI and may start the background
|
||||
service when no compatible healthy service is available. It accepts either an
|
||||
HTTP method and path or an OpenAPI operation ID.
|
||||
In Code Mode, use the built-in `opencode` tool namespace first, called inside
|
||||
`execute` as `tools.opencode.*`. These tools skip the shell round-trip and
|
||||
handle discovery and authentication. They cover sessions (`session_rename`,
|
||||
`session_move`), worktrees (`worktree_create`, `worktree_list`,
|
||||
`worktree_remove`), model search (`models`), MCP resource discovery and reading
|
||||
(`list_mcp_resources`, `read_mcp_resource`), schedules (`schedule_create`,
|
||||
`schedule_list`, `schedule_pause`, `schedule_resume`, `schedule_delete`), and
|
||||
artifacts (`artifact_create`, `artifact_read`, `artifact_update`,
|
||||
`artifact_delete`).
|
||||
|
||||
For anything those tools do not cover, use OpenCode's built-in `api` command.
|
||||
It uses the same discovery and authentication flow as the TUI and may start the
|
||||
background service when no compatible healthy service is available. It accepts
|
||||
either an HTTP method and path or an OpenAPI operation ID.
|
||||
|
||||
Call an endpoint with an HTTP method and path:
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ story("copies the shell command and its output separately", async ({ mount, page
|
||||
expect(await clipboard()).toBe(output)
|
||||
await shell.locator('[data-slot="bash-command"]').getByRole("button", { name: "Copy", exact: true }).click()
|
||||
expect(await clipboard()).toBe(command)
|
||||
expect(command).toContain("opencode2 api get /openapi.json")
|
||||
expect(command).toContain("opencode api get /openapi.json")
|
||||
expect(output).toContain('"name":"OpenCode"')
|
||||
})
|
||||
|
||||
|
||||
@@ -522,7 +522,7 @@ export const expandedShellDocument = document([
|
||||
offset: 52_300,
|
||||
args: {
|
||||
command:
|
||||
"opencode2 api get /openapi.json > /private/var/folders/j/gd69b2|16y91666jzf3p9g22asdasc0000gn/T/opencode/temp/tes",
|
||||
"opencode api get /openapi.json > /private/var/folders/j/gd69b2|16y91666jzf3p9g22asdasc0000gn/T/opencode/temp/tes",
|
||||
},
|
||||
output:
|
||||
'{"location":{"directory":"/Users/usrnk1","project":{"id":"global","directory":"/","canonical":"/"}},"data":[{"id":"opencode","name":"OpenCode","description":"Use this skill for any question about OpenCode itself, including how OpenCode works, using or configuring it, migrating from V1 to V2, troubleshooting it, developing plugins or integrations, using the OpenCode SDK, clients, server, or API, and contributing to the OpenCode codebase."}]}',
|
||||
|
||||
Reference in New Issue
Block a user