Expand description
High-level async client for the opencode server.
OpencodeClient wraps the low-level crate::http::HttpTransport with
typed methods for the six hand-wrapped endpoints. Construct one with
OpencodeClient::builder:
ⓘ
use opencode_codes::client_async::OpencodeClient;
use opencode_codes::protocol_generated::types::SessionCreateParams;
let client = OpencodeClient::builder()
.base_url("http://127.0.0.1:4096")
.build()?;
let session = client.create_session(&SessionCreateParams {
title: Some("demo".into()),
..Default::default()
}).await?;§Reconciliation
The GET /event SSE stream (see crate::sse) is best-effort and must not
be trusted as the sole source of truth. After observing activity on the
stream, poll OpencodeClient::list_messages to reconcile against the
server’s authoritative message state.
Structs§
- Opencode
Client - Async client for the opencode HTTP/SSE server.
- Opencode
Client Builder - Builder for
OpencodeClient.
Constants§
- DEFAULT_
BASE_ URL - Base URL of a default local
opencode serveinstance.