Skip to main content

create_opencode_client

Function create_opencode_client 

Source
pub fn create_opencode_client(
    config: Option<OpencodeClientConfig>,
) -> Result<OpencodeClient>
Expand description

Creates an OpenCode HTTP client from config.

The client applies:

  • default headers from config.headers
  • Authorization: Bearer ... when bearer_token is set
  • x-opencode-directory when directory is set
  • a request timeout from config.timeout