OpenCode.Generated.Global (opencode_sdk v0.1.55)

Copy Markdown View Source

Provides API endpoints related to global

Summary

Functions

Get global configuration

Update global configuration

Dispose instance

Get global events

Types

global_health_200_json_resp()

@type global_health_200_json_resp() :: %{healthy: true, version: String.t()}

global_upgrade_200_json_resp()

@type global_upgrade_200_json_resp() :: %{
  error: String.t(),
  success: false | true,
  version: String.t()
}

Functions

global_config_get(opts \\ [])

@spec global_config_get(opts :: keyword()) ::
  {:ok, OpenCode.Generated.Config.t()} | :error

Get global configuration

Retrieve the current global OpenCode configuration settings and preferences.

global_config_update(body, opts \\ [])

@spec global_config_update(body :: OpenCode.Generated.Config.t(), opts :: keyword()) ::
  {:ok, OpenCode.Generated.Config.t()}
  | {:error, OpenCode.Generated.BadRequestError.t()}

Update global configuration

Update global OpenCode configuration settings and preferences.

Request Body

Content Types: application/json

global_dispose(opts \\ [])

@spec global_dispose(opts :: keyword()) :: {:ok, boolean()} | :error

Dispose instance

Clean up and dispose all OpenCode instances, releasing all resources.

global_event(opts \\ [])

@spec global_event(opts :: keyword()) ::
  {:ok, OpenCode.Generated.GlobalEvent.t()} | :error

Get global events

Subscribe to global events from the OpenCode system using server-sent events.

global_health(opts \\ [])

@spec global_health(opts :: keyword()) ::
  {:ok, global_health_200_json_resp()} | :error

Get health

Get health information about the OpenCode server.

global_upgrade(body, opts \\ [])

@spec global_upgrade(body :: map(), opts :: keyword()) ::
  {:ok, global_upgrade_200_json_resp()}
  | {:error, OpenCode.Generated.BadRequestError.t()}

Upgrade opencode

Upgrade opencode to the specified version or latest if not specified.

Request Body

Content Types: application/json