Skip to main content

Module client

Module client 

Source
Expand description

OpenCode HTTP client and endpoint namespaces.

This module provides:

  • low-level request primitives (request_json, request_sse)
  • namespace wrappers for OpenCode endpoints
  • operation-id dispatch helpers aligned with OpenCode OpenAPI specs

Structs§

ApiResponse
Unified JSON response envelope from OpenCode API calls.
AppApi
App endpoint namespace.
AuthApi
Auth endpoint namespace.
CommandApi
Command endpoint namespace.
ConfigApi
Config endpoint namespace.
EventApi
Event endpoint namespace.
FileApi
File endpoint namespace.
FindApi
Find endpoint namespace.
FormatterApi
Formatter endpoint namespace.
GlobalApi
Global endpoint namespace.
InstanceApi
Instance endpoint namespace.
LspApi
LSP endpoint namespace.
McpApi
MCP endpoint namespace.
McpAuthApi
MCP auth endpoint namespace.
OauthApi
OAuth endpoint namespace under provider routes.
OpencodeClient
OpenCode API client aligned with official JS SDK request semantics.
OpencodeClientConfig
Config for creating OpenCode HTTP client.
PathApi
Path endpoint namespace.
ProjectApi
Project endpoint namespace.
ProviderApi
Provider endpoint namespace.
PtyApi
PTY endpoint namespace.
RequestOptions
HTTP request options compatible with OpenCode API endpoints.
SessionApi
Session endpoint namespace.
SseEvent
Parsed SSE event from OpenCode streaming endpoints.
ToolApi
Tool endpoint namespace.
TuiApi
TUI endpoint namespace.
TuiControlApi
TUI control endpoint namespace.
VcsApi
VCS endpoint namespace.

Functions§

create_opencode_client
Creates an OpenCode HTTP client from config.

Type Aliases§

ControlApi
Backward-compatible alias for top-level control API access.
SseStream
Type alias for async SSE stream.