# `OpenCode.Generated.Global`
[🔗](https://github.com/UtkarshUsername/opencode-sdk-elixir/blob/v0.1.84/lib/opencode/generated/global.ex#L1)

Provides API endpoints related to global

# `global_health_200_json_resp`

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

# `global_upgrade_200_json_resp`

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

# `global_config_get`

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

Get global configuration

Retrieve the current global OpenCode configuration settings and preferences.

# `global_config_update`

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

Update global configuration

Update global OpenCode configuration settings and preferences.

## Request Body

**Content Types**: `application/json`

# `global_dispose`

```elixir
@spec global_dispose(opts :: keyword()) ::
  {:ok, boolean()} | {:error, OpenCode.Generated.BadRequestError.t()}
```

Dispose instance

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

# `global_event`

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

Get global events

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

# `global_health`

```elixir
@spec global_health(opts :: keyword()) ::
  {:ok, global_health_200_json_resp()}
  | {:error, OpenCode.Generated.BadRequestError.t()}
```

Get health

Get health information about the OpenCode server.

# `global_upgrade`

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

Upgrade opencode

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

## Request Body

**Content Types**: `application/json`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
