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

Provides API endpoints related to operations

# `app_skills_200_json_resp`

```elixir
@type app_skills_200_json_resp() :: %{
  content: String.t(),
  description: String.t(),
  location: String.t(),
  name: String.t()
}
```

# `config_providers_200_json_resp`

```elixir
@type config_providers_200_json_resp() :: %{
  default: map(),
  providers: [OpenCode.Generated.Provider.t()]
}
```

# `experimental_console_list_orgs_200_json_resp`

```elixir
@type experimental_console_list_orgs_200_json_resp() :: %{
  orgs: [experimental_console_list_orgs_200_json_resp_orgs()]
}
```

# `experimental_console_list_orgs_200_json_resp_orgs`

```elixir
@type experimental_console_list_orgs_200_json_resp_orgs() :: %{
  account_email: String.t(),
  account_id: String.t(),
  account_url: String.t(),
  active: boolean(),
  org_id: String.t(),
  org_name: String.t()
}
```

# `experimental_workspace_adapter_list_200_json_resp`

```elixir
@type experimental_workspace_adapter_list_200_json_resp() :: %{
  description: String.t(),
  name: String.t(),
  type: String.t()
}
```

# `experimental_workspace_session_restore_200_json_resp`

```elixir
@type experimental_workspace_session_restore_200_json_resp() :: %{total: integer()}
```

# `experimental_workspace_status_200_json_resp`

```elixir
@type experimental_workspace_status_200_json_resp() :: %{
  status: String.t(),
  workspace_id: String.t()
}
```

# `find_text_200_json_resp`

```elixir
@type find_text_200_json_resp() :: %{
  absolute_offset: integer(),
  line_number: integer(),
  lines: find_text_200_json_resp_lines(),
  path: find_text_200_json_resp_path(),
  submatches: [find_text_200_json_resp_submatches()]
}
```

# `find_text_200_json_resp_lines`

```elixir
@type find_text_200_json_resp_lines() :: %{text: String.t()}
```

# `find_text_200_json_resp_path`

```elixir
@type find_text_200_json_resp_path() :: %{text: String.t()}
```

# `find_text_200_json_resp_submatches`

```elixir
@type find_text_200_json_resp_submatches() :: %{
  end: integer(),
  match: find_text_200_json_resp_submatches_match(),
  start: integer()
}
```

# `find_text_200_json_resp_submatches_match`

```elixir
@type find_text_200_json_resp_submatches_match() :: %{text: String.t()}
```

# `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()
}
```

# `mcp_auth_remove_200_json_resp`

```elixir
@type mcp_auth_remove_200_json_resp() :: %{success: true}
```

# `mcp_auth_start_200_json_resp`

```elixir
@type mcp_auth_start_200_json_resp() :: %{authorization_url: String.t()}
```

# `provider_list_200_json_resp`

```elixir
@type provider_list_200_json_resp() :: %{
  all: [OpenCode.Generated.Provider.t()],
  connected: [String.t()],
  default: map()
}
```

# `pty_shells_200_json_resp`

```elixir
@type pty_shells_200_json_resp() :: %{
  acceptable: boolean(),
  name: String.t(),
  path: String.t()
}
```

# `session_command_200_json_resp`

```elixir
@type session_command_200_json_resp() :: %{
  info: OpenCode.Generated.AssistantMessage.t(),
  parts: [
    OpenCode.Generated.AgentPart.t()
    | OpenCode.Generated.CompactionPart.t()
    | OpenCode.Generated.FilePart.t()
    | OpenCode.Generated.PatchPart.t()
    | OpenCode.Generated.ReasoningPart.t()
    | OpenCode.Generated.RetryPart.t()
    | OpenCode.Generated.SnapshotPart.t()
    | OpenCode.Generated.StepFinishPart.t()
    | OpenCode.Generated.StepStartPart.t()
    | OpenCode.Generated.SubtaskPart.t()
    | OpenCode.Generated.TextPart.t()
    | OpenCode.Generated.ToolPart.t()
  ]
}
```

# `session_message_200_json_resp`

```elixir
@type session_message_200_json_resp() :: %{
  info:
    OpenCode.Generated.AssistantMessage.t() | OpenCode.Generated.UserMessage.t(),
  parts: [
    OpenCode.Generated.AgentPart.t()
    | OpenCode.Generated.CompactionPart.t()
    | OpenCode.Generated.FilePart.t()
    | OpenCode.Generated.PatchPart.t()
    | OpenCode.Generated.ReasoningPart.t()
    | OpenCode.Generated.RetryPart.t()
    | OpenCode.Generated.SnapshotPart.t()
    | OpenCode.Generated.StepFinishPart.t()
    | OpenCode.Generated.StepStartPart.t()
    | OpenCode.Generated.SubtaskPart.t()
    | OpenCode.Generated.TextPart.t()
    | OpenCode.Generated.ToolPart.t()
  ]
}
```

# `session_messages_200_json_resp`

```elixir
@type session_messages_200_json_resp() :: %{
  info:
    OpenCode.Generated.AssistantMessage.t() | OpenCode.Generated.UserMessage.t(),
  parts: [
    OpenCode.Generated.AgentPart.t()
    | OpenCode.Generated.CompactionPart.t()
    | OpenCode.Generated.FilePart.t()
    | OpenCode.Generated.PatchPart.t()
    | OpenCode.Generated.ReasoningPart.t()
    | OpenCode.Generated.RetryPart.t()
    | OpenCode.Generated.SnapshotPart.t()
    | OpenCode.Generated.StepFinishPart.t()
    | OpenCode.Generated.StepStartPart.t()
    | OpenCode.Generated.SubtaskPart.t()
    | OpenCode.Generated.TextPart.t()
    | OpenCode.Generated.ToolPart.t()
  ]
}
```

# `session_prompt_200_json_resp`

```elixir
@type session_prompt_200_json_resp() :: %{
  info: OpenCode.Generated.AssistantMessage.t(),
  parts: [
    OpenCode.Generated.AgentPart.t()
    | OpenCode.Generated.CompactionPart.t()
    | OpenCode.Generated.FilePart.t()
    | OpenCode.Generated.PatchPart.t()
    | OpenCode.Generated.ReasoningPart.t()
    | OpenCode.Generated.RetryPart.t()
    | OpenCode.Generated.SnapshotPart.t()
    | OpenCode.Generated.StepFinishPart.t()
    | OpenCode.Generated.StepStartPart.t()
    | OpenCode.Generated.SubtaskPart.t()
    | OpenCode.Generated.TextPart.t()
    | OpenCode.Generated.ToolPart.t()
  ]
}
```

# `session_shell_200_json_resp`

```elixir
@type session_shell_200_json_resp() :: %{
  info:
    OpenCode.Generated.AssistantMessage.t() | OpenCode.Generated.UserMessage.t(),
  parts: [
    OpenCode.Generated.AgentPart.t()
    | OpenCode.Generated.CompactionPart.t()
    | OpenCode.Generated.FilePart.t()
    | OpenCode.Generated.PatchPart.t()
    | OpenCode.Generated.ReasoningPart.t()
    | OpenCode.Generated.RetryPart.t()
    | OpenCode.Generated.SnapshotPart.t()
    | OpenCode.Generated.StepFinishPart.t()
    | OpenCode.Generated.StepStartPart.t()
    | OpenCode.Generated.SubtaskPart.t()
    | OpenCode.Generated.TextPart.t()
    | OpenCode.Generated.ToolPart.t()
  ]
}
```

# `sync_history_list_200_json_resp`

```elixir
@type sync_history_list_200_json_resp() :: %{
  aggregate_id: String.t(),
  data: map(),
  id: String.t(),
  seq: number(),
  type: String.t()
}
```

# `sync_replay_200_json_resp`

```elixir
@type sync_replay_200_json_resp() :: %{session_id: String.t()}
```

# `tui_control_next_200_json_resp`

```elixir
@type tui_control_next_200_json_resp() :: %{body: map(), path: String.t()}
```

# `app_agents`

```elixir
@spec app_agents(opts :: keyword()) :: {:ok, [OpenCode.Generated.Agent.t()]} | :error
```

List agents

Get a list of all available AI agents in the OpenCode system.

## Options

  * `directory`
  * `workspace`

# `app_log`

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

Write log

Write a log entry to the server logs with specified level and metadata.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `app_skills`

```elixir
@spec app_skills(opts :: keyword()) :: {:ok, [app_skills_200_json_resp()]} | :error
```

List skills

Get a list of all available skills in the OpenCode system.

## Options

  * `directory`
  * `workspace`

# `auth_remove`

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

Remove auth credentials

Remove authentication credentials

# `auth_set`

```elixir
@spec auth_set(
  providerID :: String.t(),
  body ::
    OpenCode.Generated.ApiAuth.t()
    | OpenCode.Generated.OAuth.t()
    | OpenCode.Generated.WellKnownAuth.t(),
  opts :: keyword()
) :: {:ok, boolean()} | {:error, OpenCode.Generated.BadRequestError.t()}
```

Set auth credentials

Set authentication credentials

## Request Body

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

# `command_list`

```elixir
@spec command_list(opts :: keyword()) ::
  {:ok, [OpenCode.Generated.Command.t()]} | :error
```

List commands

Get a list of all available commands in the OpenCode system.

## Options

  * `directory`
  * `workspace`

# `config_get`

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

Get configuration

Retrieve the current OpenCode configuration settings and preferences.

## Options

  * `directory`
  * `workspace`

# `config_providers`

```elixir
@spec config_providers(opts :: keyword()) ::
  {:ok, config_providers_200_json_resp()} | :error
```

List config providers

Get a list of all configured AI providers and their default models.

## Options

  * `directory`
  * `workspace`

# `config_update`

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

Update configuration

Update OpenCode configuration settings and preferences.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `event_subscribe`

```elixir
@spec event_subscribe(opts :: keyword()) ::
  {:ok,
   OpenCode.Generated.EventCommandExecuted.t()
   | OpenCode.Generated.EventFileEdited.t()
   | OpenCode.Generated.EventFileWatcherUpdated.t()
   | OpenCode.Generated.EventGlobalDisposed.t()
   | OpenCode.Generated.EventInstallationUpdateAvailable.t()
   | OpenCode.Generated.EventInstallationUpdated.t()
   | OpenCode.Generated.EventLspClientDiagnostics.t()
   | OpenCode.Generated.EventLspUpdated.t()
   | OpenCode.Generated.EventMcpBrowserOpenFailed.t()
   | OpenCode.Generated.EventMcpToolsChanged.t()
   | OpenCode.Generated.EventMessagePartDelta.t()
   | OpenCode.Generated.EventMessagePartRemoved.t()
   | OpenCode.Generated.EventMessagePartUpdated.t()
   | OpenCode.Generated.EventMessageRemoved.t()
   | OpenCode.Generated.EventMessageUpdated.t()
   | OpenCode.Generated.EventPermissionAsked.t()
   | OpenCode.Generated.EventPermissionReplied.t()
   | OpenCode.Generated.EventProjectUpdated.t()
   | OpenCode.Generated.EventPtyCreated.t()
   | OpenCode.Generated.EventPtyDeleted.t()
   | OpenCode.Generated.EventPtyExited.t()
   | OpenCode.Generated.EventPtyUpdated.t()
   | OpenCode.Generated.EventQuestionAsked.t()
   | OpenCode.Generated.EventQuestionRejected.t()
   | OpenCode.Generated.EventQuestionReplied.t()
   | OpenCode.Generated.EventServerConnected.t()
   | OpenCode.Generated.EventServerInstanceDisposed.t()
   | OpenCode.Generated.EventSessionCompacted.t()
   | OpenCode.Generated.EventSessionCreated.t()
   | OpenCode.Generated.EventSessionDeleted.t()
   | OpenCode.Generated.EventSessionDiff.t()
   | OpenCode.Generated.EventSessionError.t()
   | OpenCode.Generated.EventSessionIdle.t()
   | OpenCode.Generated.EventSessionNextAgentSwitched.t()
   | OpenCode.Generated.EventSessionNextCompactionDelta.t()
   | OpenCode.Generated.EventSessionNextCompactionEnded.t()
   | OpenCode.Generated.EventSessionNextCompactionStarted.t()
   | OpenCode.Generated.EventSessionNextModelSwitched.t()
   | OpenCode.Generated.EventSessionNextPrompted.t()
   | OpenCode.Generated.EventSessionNextReasoningDelta.t()
   | OpenCode.Generated.EventSessionNextReasoningEnded.t()
   | OpenCode.Generated.EventSessionNextReasoningStarted.t()
   | OpenCode.Generated.EventSessionNextRetried.t()
   | OpenCode.Generated.EventSessionNextShellEnded.t()
   | OpenCode.Generated.EventSessionNextShellStarted.t()
   | OpenCode.Generated.EventSessionNextStepEnded.t()
   | OpenCode.Generated.EventSessionNextStepStarted.t()
   | OpenCode.Generated.EventSessionNextSynthetic.t()
   | OpenCode.Generated.EventSessionNextTextDelta.t()
   | OpenCode.Generated.EventSessionNextTextEnded.t()
   | OpenCode.Generated.EventSessionNextTextStarted.t()
   | OpenCode.Generated.EventSessionNextToolCalled.t()
   | OpenCode.Generated.EventSessionNextToolError.t()
   | OpenCode.Generated.EventSessionNextToolInputDelta.t()
   | OpenCode.Generated.EventSessionNextToolInputEnded.t()
   | OpenCode.Generated.EventSessionNextToolInputStarted.t()
   | OpenCode.Generated.EventSessionNextToolProgress.t()
   | OpenCode.Generated.EventSessionNextToolSuccess.t()
   | OpenCode.Generated.EventSessionStatus.t()
   | OpenCode.Generated.EventSessionUpdated.t()
   | OpenCode.Generated.EventTodoUpdated.t()
   | OpenCode.Generated.EventTuiCommandExecute.t()
   | OpenCode.Generated.EventTuiPromptAppend.t()
   | OpenCode.Generated.EventTuiSessionSelect.t()
   | OpenCode.Generated.EventTuiToastShow.t()
   | OpenCode.Generated.EventVcsBranchUpdated.t()
   | OpenCode.Generated.EventWorkspaceFailed.t()
   | OpenCode.Generated.EventWorkspaceReady.t()
   | OpenCode.Generated.EventWorkspaceRestore.t()
   | OpenCode.Generated.EventWorkspaceStatus.t()
   | OpenCode.Generated.EventWorktreeFailed.t()
   | OpenCode.Generated.EventWorktreeReady.t()}
  | :error
```

Subscribe to events

Get events

## Options

  * `directory`
  * `workspace`

# `experimental_console_get`

```elixir
@spec experimental_console_get(opts :: keyword()) ::
  {:ok, OpenCode.Generated.ConsoleState.t()} | :error
```

Get active Console provider metadata

Get the active Console org name and the set of provider IDs managed by that Console org.

## Options

  * `directory`
  * `workspace`

# `experimental_console_list_orgs`

```elixir
@spec experimental_console_list_orgs(opts :: keyword()) ::
  {:ok, experimental_console_list_orgs_200_json_resp()} | :error
```

List switchable Console orgs

Get the available Console orgs across logged-in accounts, including the current active org.

## Options

  * `directory`
  * `workspace`

# `experimental_console_switch_org`

```elixir
@spec experimental_console_switch_org(body :: map(), opts :: keyword()) ::
  {:ok, boolean()} | :error
```

Switch active Console org

Persist a new active Console account/org selection for the current local OpenCode state.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `experimental_resource_list`

```elixir
@spec experimental_resource_list(opts :: keyword()) :: {:ok, map()} | :error
```

Get MCP resources

Get all available MCP resources from connected servers. Optionally filter by name.

## Options

  * `directory`
  * `workspace`

# `experimental_session_list`

```elixir
@spec experimental_session_list(opts :: keyword()) ::
  {:ok, [OpenCode.Generated.GlobalSession.t()]} | :error
```

List sessions

Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.

## Options

  * `directory`: Filter sessions by project directory
  * `workspace`
  * `roots`: Only return root sessions (no parentID)
  * `start`: Filter sessions updated on or after this timestamp (milliseconds since epoch)
  * `cursor`: Return sessions updated before this timestamp (milliseconds since epoch)
  * `search`: Filter sessions by title (case-insensitive)
  * `limit`: Maximum number of sessions to return
  * `archived`: Include archived sessions (default false)

# `experimental_workspace_adapter_list`

```elixir
@spec experimental_workspace_adapter_list(opts :: keyword()) ::
  {:ok, [experimental_workspace_adapter_list_200_json_resp()]} | :error
```

List workspace adapters

List all available workspace adapters for the current project.

## Options

  * `directory`
  * `workspace`

# `experimental_workspace_create`

```elixir
@spec experimental_workspace_create(body :: map(), opts :: keyword()) ::
  {:ok, OpenCode.Generated.Workspace.t()}
  | {:error, OpenCode.Generated.BadRequestError.t()}
```

Create workspace

Create a workspace for the current project.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `experimental_workspace_list`

```elixir
@spec experimental_workspace_list(opts :: keyword()) ::
  {:ok, [OpenCode.Generated.Workspace.t()]} | :error
```

List workspaces

List all workspaces.

## Options

  * `directory`
  * `workspace`

# `experimental_workspace_remove`

```elixir
@spec experimental_workspace_remove(id :: String.t(), opts :: keyword()) ::
  {:ok, OpenCode.Generated.Workspace.t()}
  | {:error, OpenCode.Generated.BadRequestError.t()}
```

Remove workspace

Remove an existing workspace.

## Options

  * `directory`
  * `workspace`

# `experimental_workspace_session_restore`

```elixir
@spec experimental_workspace_session_restore(
  id :: String.t(),
  body :: map(),
  opts :: keyword()
) ::
  {:ok, experimental_workspace_session_restore_200_json_resp()}
  | {:error, OpenCode.Generated.BadRequestError.t()}
```

Restore session into workspace

Replay a session's sync events into the target workspace in batches.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `experimental_workspace_status`

```elixir
@spec experimental_workspace_status(opts :: keyword()) ::
  {:ok, [experimental_workspace_status_200_json_resp()]} | :error
```

Workspace status

Get connection status for workspaces in the current project.

## Options

  * `directory`
  * `workspace`

# `file_list`

```elixir
@spec file_list(opts :: keyword()) ::
  {:ok, [OpenCode.Generated.FileNode.t()]} | :error
```

List files

List files and directories in a specified path.

## Options

  * `directory`
  * `workspace`
  * `path`

# `file_read`

```elixir
@spec file_read(opts :: keyword()) ::
  {:ok, OpenCode.Generated.FileContent.t()} | :error
```

Read file

Read the content of a specified file.

## Options

  * `directory`
  * `workspace`
  * `path`

# `file_status`

```elixir
@spec file_status(opts :: keyword()) :: {:ok, [OpenCode.Generated.File.t()]} | :error
```

Get file status

Get the git status of all files in the project.

## Options

  * `directory`
  * `workspace`

# `find_files`

```elixir
@spec find_files(opts :: keyword()) :: {:ok, [String.t()]} | :error
```

Find files

Search for files or directories by name or pattern in the project directory.

## Options

  * `directory`
  * `workspace`
  * `query`
  * `dirs`
  * `type`
  * `limit`

# `find_symbols`

```elixir
@spec find_symbols(opts :: keyword()) ::
  {:ok, [OpenCode.Generated.Symbol.t()]} | :error
```

Find symbols

Search for workspace symbols like functions, classes, and variables using LSP.

## Options

  * `directory`
  * `workspace`
  * `query`

# `find_text`

```elixir
@spec find_text(opts :: keyword()) :: {:ok, [find_text_200_json_resp()]} | :error
```

Find text

Search for text patterns across files in the project using ripgrep.

## Options

  * `directory`
  * `workspace`
  * `pattern`

# `formatter_status`

```elixir
@spec formatter_status(opts :: keyword()) ::
  {:ok, [OpenCode.Generated.FormatterStatus.t()]} | :error
```

Get formatter status

Get formatter status

## Options

  * `directory`
  * `workspace`

# `global_config_get`

```elixir
@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`

```elixir
@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`

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

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
```

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
```

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.BadRequestError.t()}
```

Upgrade opencode

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

## Request Body

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

# `instance_dispose`

```elixir
@spec instance_dispose(opts :: keyword()) :: {:ok, boolean()} | :error
```

Dispose instance

Clean up and dispose the current OpenCode instance, releasing all resources.

## Options

  * `directory`
  * `workspace`

# `lsp_status`

```elixir
@spec lsp_status(opts :: keyword()) ::
  {:ok, [OpenCode.Generated.LSPStatus.t()]} | :error
```

Get LSP status

Get LSP server status

## Options

  * `directory`
  * `workspace`

# `mcp_add`

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

Add MCP server

Dynamically add a new Model Context Protocol (MCP) server to the system.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `mcp_auth_authenticate`

```elixir
@spec mcp_auth_authenticate(name :: String.t(), opts :: keyword()) ::
  {:ok,
   OpenCode.Generated.MCPStatusConnected.t()
   | OpenCode.Generated.MCPStatusDisabled.t()
   | OpenCode.Generated.MCPStatusFailed.t()
   | OpenCode.Generated.MCPStatusNeedsAuth.t()
   | OpenCode.Generated.MCPStatusNeedsClientRegistration.t()}
  | {:error,
     OpenCode.Generated.McpUnsupportedOAuthError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Authenticate MCP OAuth

Start OAuth flow and wait for callback (opens browser)

## Options

  * `directory`
  * `workspace`

# `mcp_auth_callback`

```elixir
@spec mcp_auth_callback(name :: String.t(), body :: map(), opts :: keyword()) ::
  {:ok,
   OpenCode.Generated.MCPStatusConnected.t()
   | OpenCode.Generated.MCPStatusDisabled.t()
   | OpenCode.Generated.MCPStatusFailed.t()
   | OpenCode.Generated.MCPStatusNeedsAuth.t()
   | OpenCode.Generated.MCPStatusNeedsClientRegistration.t()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Complete MCP OAuth

Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `mcp_auth_remove`

```elixir
@spec mcp_auth_remove(name :: String.t(), opts :: keyword()) ::
  {:ok, mcp_auth_remove_200_json_resp()}
  | {:error, OpenCode.Generated.NotFoundError.t()}
```

Remove MCP OAuth

Remove OAuth credentials for an MCP server

## Options

  * `directory`
  * `workspace`

# `mcp_auth_start`

```elixir
@spec mcp_auth_start(name :: String.t(), opts :: keyword()) ::
  {:ok, mcp_auth_start_200_json_resp()}
  | {:error,
     OpenCode.Generated.McpUnsupportedOAuthError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Start MCP OAuth

Start OAuth authentication flow for a Model Context Protocol (MCP) server.

## Options

  * `directory`
  * `workspace`

# `mcp_connect`

```elixir
@spec mcp_connect(name :: String.t(), opts :: keyword()) :: {:ok, boolean()} | :error
```

post `/mcp/{name}/connect`

Connect an MCP server

## Options

  * `directory`
  * `workspace`

# `mcp_disconnect`

```elixir
@spec mcp_disconnect(name :: String.t(), opts :: keyword()) ::
  {:ok, boolean()} | :error
```

post `/mcp/{name}/disconnect`

Disconnect an MCP server

## Options

  * `directory`
  * `workspace`

# `mcp_status`

```elixir
@spec mcp_status(opts :: keyword()) :: {:ok, map()} | :error
```

Get MCP status

Get the status of all Model Context Protocol (MCP) servers.

## Options

  * `directory`
  * `workspace`

# `part_delete`

```elixir
@spec part_delete(
  sessionID :: String.t(),
  messageID :: String.t(),
  partID :: String.t(),
  opts :: keyword()
) ::
  {:ok, boolean()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

delete `/session/{sessionID}/message/{messageID}/part/{partID}`

Delete a part from a message

## Options

  * `directory`
  * `workspace`

# `part_update`

```elixir
@spec part_update(
  sessionID :: String.t(),
  messageID :: String.t(),
  partID :: String.t(),
  body ::
    OpenCode.Generated.AgentPart.t()
    | OpenCode.Generated.CompactionPart.t()
    | OpenCode.Generated.FilePart.t()
    | OpenCode.Generated.PatchPart.t()
    | OpenCode.Generated.ReasoningPart.t()
    | OpenCode.Generated.RetryPart.t()
    | OpenCode.Generated.SnapshotPart.t()
    | OpenCode.Generated.StepFinishPart.t()
    | OpenCode.Generated.StepStartPart.t()
    | OpenCode.Generated.SubtaskPart.t()
    | OpenCode.Generated.TextPart.t()
    | OpenCode.Generated.ToolPart.t(),
  opts :: keyword()
) ::
  {:ok,
   OpenCode.Generated.AgentPart.t()
   | OpenCode.Generated.CompactionPart.t()
   | OpenCode.Generated.FilePart.t()
   | OpenCode.Generated.PatchPart.t()
   | OpenCode.Generated.ReasoningPart.t()
   | OpenCode.Generated.RetryPart.t()
   | OpenCode.Generated.SnapshotPart.t()
   | OpenCode.Generated.StepFinishPart.t()
   | OpenCode.Generated.StepStartPart.t()
   | OpenCode.Generated.SubtaskPart.t()
   | OpenCode.Generated.TextPart.t()
   | OpenCode.Generated.ToolPart.t()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

patch `/session/{sessionID}/message/{messageID}/part/{partID}`

Update a part in a message

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `path_get`

```elixir
@spec path_get(opts :: keyword()) :: {:ok, OpenCode.Generated.Path.t()} | :error
```

Get paths

Retrieve the current working directory and related path information for the OpenCode instance.

## Options

  * `directory`
  * `workspace`

# `permission_list`

```elixir
@spec permission_list(opts :: keyword()) ::
  {:ok, [OpenCode.Generated.PermissionRequest.t()]} | :error
```

List pending permissions

Get all pending permission requests across all sessions.

## Options

  * `directory`
  * `workspace`

# `permission_reply`

```elixir
@spec permission_reply(requestID :: String.t(), body :: map(), opts :: keyword()) ::
  {:ok, boolean()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Respond to permission request

Approve or deny a permission request from the AI assistant.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `permission_respond`

```elixir
@spec permission_respond(
  sessionID :: String.t(),
  permissionID :: String.t(),
  body :: map(),
  opts :: keyword()
) ::
  {:ok, boolean()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Respond to permission

Approve or deny a permission request from the AI assistant.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `project_current`

```elixir
@spec project_current(opts :: keyword()) ::
  {:ok, OpenCode.Generated.Project.t()} | :error
```

Get current project

Retrieve the currently active project that OpenCode is working with.

## Options

  * `directory`
  * `workspace`

# `project_init_git`

```elixir
@spec project_init_git(opts :: keyword()) ::
  {:ok, OpenCode.Generated.Project.t()} | :error
```

Initialize git repository

Create a git repository for the current project and return the refreshed project info.

## Options

  * `directory`
  * `workspace`

# `project_list`

```elixir
@spec project_list(opts :: keyword()) ::
  {:ok, [OpenCode.Generated.Project.t()]} | :error
```

List all projects

Get a list of projects that have been opened with OpenCode.

## Options

  * `directory`
  * `workspace`

# `project_update`

```elixir
@spec project_update(projectID :: String.t(), body :: map(), opts :: keyword()) ::
  {:ok, OpenCode.Generated.Project.t()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Update project

Update project properties such as name, icon, and commands.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `provider_auth`

```elixir
@spec provider_auth(opts :: keyword()) :: {:ok, map()} | :error
```

Get provider auth methods

Retrieve available authentication methods for all AI providers.

## Options

  * `directory`
  * `workspace`

# `provider_list`

```elixir
@spec provider_list(opts :: keyword()) ::
  {:ok, provider_list_200_json_resp()} | :error
```

List providers

Get a list of all available AI providers, including both available and connected ones.

## Options

  * `directory`
  * `workspace`

# `provider_oauth_authorize`

```elixir
@spec provider_oauth_authorize(
  providerID :: String.t(),
  body :: map(),
  opts :: keyword()
) ::
  {:ok, OpenCode.Generated.ProviderAuthAuthorization.t()}
  | {:error, OpenCode.Generated.BadRequestError.t()}
```

OAuth authorize

Initiate OAuth authorization for a specific AI provider to get an authorization URL.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `provider_oauth_callback`

```elixir
@spec provider_oauth_callback(
  providerID :: String.t(),
  body :: map(),
  opts :: keyword()
) ::
  {:ok, boolean()} | {:error, OpenCode.Generated.BadRequestError.t()}
```

OAuth callback

Handle the OAuth callback from a provider after user authorization.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `pty_connect`

```elixir
@spec pty_connect(ptyID :: String.t(), opts :: keyword()) ::
  {:ok, boolean()} | {:error, OpenCode.Generated.NotFoundError.t()}
```

Connect to PTY session

Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.

## Options

  * `directory`
  * `workspace`

# `pty_create`

```elixir
@spec pty_create(body :: map(), opts :: keyword()) ::
  {:ok, OpenCode.Generated.Pty.t()}
  | {:error, OpenCode.Generated.BadRequestError.t()}
```

Create PTY session

Create a new pseudo-terminal (PTY) session for running shell commands and processes.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `pty_get`

```elixir
@spec pty_get(ptyID :: String.t(), opts :: keyword()) ::
  {:ok, OpenCode.Generated.Pty.t()}
  | {:error, OpenCode.Generated.NotFoundError.t()}
```

Get PTY session

Retrieve detailed information about a specific pseudo-terminal (PTY) session.

## Options

  * `directory`
  * `workspace`

# `pty_list`

```elixir
@spec pty_list(opts :: keyword()) :: {:ok, [OpenCode.Generated.Pty.t()]} | :error
```

List PTY sessions

Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.

## Options

  * `directory`
  * `workspace`

# `pty_remove`

```elixir
@spec pty_remove(ptyID :: String.t(), opts :: keyword()) ::
  {:ok, boolean()} | {:error, OpenCode.Generated.NotFoundError.t()}
```

Remove PTY session

Remove and terminate a specific pseudo-terminal (PTY) session.

## Options

  * `directory`
  * `workspace`

# `pty_shells`

```elixir
@spec pty_shells(opts :: keyword()) :: {:ok, [pty_shells_200_json_resp()]} | :error
```

List available shells

Get a list of available shells on the system.

## Options

  * `directory`
  * `workspace`

# `pty_update`

```elixir
@spec pty_update(ptyID :: String.t(), body :: map(), opts :: keyword()) ::
  {:ok, OpenCode.Generated.Pty.t()}
  | {:error, OpenCode.Generated.BadRequestError.t()}
```

Update PTY session

Update properties of an existing pseudo-terminal (PTY) session.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `question_list`

```elixir
@spec question_list(opts :: keyword()) ::
  {:ok, [OpenCode.Generated.QuestionRequest.t()]} | :error
```

List pending questions

Get all pending question requests across all sessions.

## Options

  * `directory`
  * `workspace`

# `question_reject`

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

Reject question request

Reject a question request from the AI assistant.

## Options

  * `directory`
  * `workspace`

# `question_reply`

```elixir
@spec question_reply(requestID :: String.t(), body :: map(), opts :: keyword()) ::
  {:ok, boolean()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Reply to question request

Provide answers to a question request from the AI assistant.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `session_abort`

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

Abort session

Abort an active session and stop any ongoing AI processing or command execution.

## Options

  * `directory`
  * `workspace`

# `session_command`

```elixir
@spec session_command(sessionID :: String.t(), body :: map(), opts :: keyword()) ::
  {:ok, session_command_200_json_resp()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Send command

Send a new command to a session for execution by the AI assistant.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `session_create`

```elixir
@spec session_create(body :: map(), opts :: keyword()) ::
  {:ok, OpenCode.Generated.Session.t()}
  | {:error, OpenCode.Generated.BadRequestError.t()}
```

Create session

Create a new OpenCode session for interacting with AI assistants and managing conversations.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `session_delete`

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

Delete session

Delete a session and permanently remove all associated data, including messages and history.

## Options

  * `directory`
  * `workspace`

# `session_delete_message`

```elixir
@spec session_delete_message(
  sessionID :: String.t(),
  messageID :: String.t(),
  opts :: keyword()
) ::
  {:ok, boolean()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Delete message

Permanently delete a specific message (and all of its parts) from a session. This does not revert any file changes that may have been made while processing the message.

## Options

  * `directory`
  * `workspace`

# `session_diff`

```elixir
@spec session_diff(sessionID :: String.t(), opts :: keyword()) ::
  {:ok, [OpenCode.Generated.SnapshotFileDiff.t()]} | :error
```

Get message diff

Get the file changes (diff) that resulted from a specific user message in the session.

## Options

  * `directory`
  * `workspace`
  * `messageID`

# `session_fork`

```elixir
@spec session_fork(sessionID :: String.t(), body :: map(), opts :: keyword()) ::
  {:ok, OpenCode.Generated.Session.t()} | :error
```

Fork session

Create a new session by forking an existing session at a specific message point.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `session_init`

```elixir
@spec session_init(sessionID :: String.t(), body :: map(), opts :: keyword()) ::
  {:ok, boolean()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Initialize session

Analyze the current application and create an AGENTS.md file with project-specific agent configurations.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `session_list`

```elixir
@spec session_list(opts :: keyword()) ::
  {:ok, [OpenCode.Generated.Session.t()]} | :error
```

List sessions

Get a list of all OpenCode sessions, sorted by most recently updated.

## Options

  * `directory`: Filter sessions by directory
  * `workspace`
  * `scope`: List all sessions for the current project
  * `path`: Filter sessions by project-relative path
  * `roots`: Only return root sessions (no parentID)
  * `start`: Filter sessions updated on or after this timestamp (milliseconds since epoch)
  * `search`: Filter sessions by title (case-insensitive)
  * `limit`: Maximum number of sessions to return

# `session_message`

```elixir
@spec session_message(
  sessionID :: String.t(),
  messageID :: String.t(),
  opts :: keyword()
) ::
  {:ok, session_message_200_json_resp()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Get message

Retrieve a specific message from a session by its message ID.

## Options

  * `directory`
  * `workspace`

# `session_messages`

```elixir
@spec session_messages(sessionID :: String.t(), opts :: keyword()) ::
  {:ok, [session_messages_200_json_resp()]}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Get session messages

Retrieve all messages in a session, including user prompts and AI responses.

## Options

  * `directory`
  * `workspace`
  * `limit`: Maximum number of messages to return
  * `before`

# `session_prompt`

```elixir
@spec session_prompt(sessionID :: String.t(), body :: map(), opts :: keyword()) ::
  {:ok, session_prompt_200_json_resp()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Send message

Create and send a new message to a session, streaming the AI response.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `session_prompt_async`

```elixir
@spec session_prompt_async(sessionID :: String.t(), body :: map(), opts :: keyword()) ::
  :ok
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Send async message

Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `session_revert`

```elixir
@spec session_revert(sessionID :: String.t(), body :: map(), opts :: keyword()) ::
  {:ok, OpenCode.Generated.Session.t()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Revert message

Revert a specific message in a session, undoing its effects and restoring the previous state.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `session_share`

```elixir
@spec session_share(sessionID :: String.t(), opts :: keyword()) ::
  {:ok, OpenCode.Generated.Session.t()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Share session

Create a shareable link for a session, allowing others to view the conversation.

## Options

  * `directory`
  * `workspace`

# `session_shell`

```elixir
@spec session_shell(sessionID :: String.t(), body :: map(), opts :: keyword()) ::
  {:ok, session_shell_200_json_resp()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Run shell command

Execute a shell command within the session context and return the AI's response.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `session_status`

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

Get session status

Retrieve the current status of all sessions, including active, idle, and completed states.

## Options

  * `directory`
  * `workspace`

# `session_summarize`

```elixir
@spec session_summarize(sessionID :: String.t(), body :: map(), opts :: keyword()) ::
  {:ok, boolean()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Summarize session

Generate a concise summary of the session using AI compaction to preserve key information.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `session_todo`

```elixir
@spec session_todo(sessionID :: String.t(), opts :: keyword()) ::
  {:ok, [OpenCode.Generated.Todo.t()]}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Get session todos

Retrieve the todo list associated with a specific session, showing tasks and action items.

## Options

  * `directory`
  * `workspace`

# `session_unrevert`

```elixir
@spec session_unrevert(sessionID :: String.t(), opts :: keyword()) ::
  {:ok, OpenCode.Generated.Session.t()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Restore reverted messages

Restore all previously reverted messages in a session.

## Options

  * `directory`
  * `workspace`

# `session_unshare`

```elixir
@spec session_unshare(sessionID :: String.t(), opts :: keyword()) ::
  {:ok, OpenCode.Generated.Session.t()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Unshare session

Remove the shareable link for a session, making it private again.

## Options

  * `directory`
  * `workspace`

# `session_update`

```elixir
@spec session_update(sessionID :: String.t(), body :: map(), opts :: keyword()) ::
  {:ok, OpenCode.Generated.Session.t()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.NotFoundError.t()}
```

Update session

Update properties of an existing session, such as title or other metadata.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `sync_history_list`

```elixir
@spec sync_history_list(body :: map(), opts :: keyword()) ::
  {:ok, [sync_history_list_200_json_resp()]}
  | {:error, OpenCode.Generated.BadRequestError.t()}
```

List sync events

List sync events for all aggregates. Keys are aggregate IDs the client already knows about, values are the last known sequence ID. Events with seq > value are returned for those aggregates. Aggregates not listed in the input get their full history.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `sync_replay`

```elixir
@spec sync_replay(body :: map(), opts :: keyword()) ::
  {:ok, sync_replay_200_json_resp()}
  | {:error, OpenCode.Generated.BadRequestError.t()}
```

Replay sync events

Validate and replay a complete sync event history.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `sync_start`

```elixir
@spec sync_start(opts :: keyword()) :: {:ok, boolean()} | :error
```

Start workspace sync

Start sync loops for workspaces in the current project that have active sessions.

## Options

  * `directory`
  * `workspace`

# `tool_ids`

```elixir
@spec tool_ids(opts :: keyword()) ::
  {:ok, [String.t()]} | {:error, OpenCode.Generated.BadRequestError.t()}
```

List tool IDs

Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.

## Options

  * `directory`
  * `workspace`

# `tool_list`

```elixir
@spec tool_list(opts :: keyword()) ::
  {:ok, [OpenCode.Generated.ToolListItem.t()]}
  | {:error, OpenCode.Generated.BadRequestError.t()}
```

List tools

Get a list of available tools with their JSON schema parameters for a specific provider and model combination.

## Options

  * `directory`
  * `workspace`
  * `provider`
  * `model`

# `tui_append_prompt`

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

Append TUI prompt

Append prompt to the TUI

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `tui_clear_prompt`

```elixir
@spec tui_clear_prompt(opts :: keyword()) :: {:ok, boolean()} | :error
```

Clear TUI prompt

Clear the prompt

## Options

  * `directory`
  * `workspace`

# `tui_control_next`

```elixir
@spec tui_control_next(opts :: keyword()) ::
  {:ok, tui_control_next_200_json_resp()} | :error
```

Get next TUI request

Retrieve the next TUI (Terminal User Interface) request from the queue for processing.

## Options

  * `directory`
  * `workspace`

# `tui_control_response`

```elixir
@spec tui_control_response(body :: map(), opts :: keyword()) ::
  {:ok, boolean()} | :error
```

Submit TUI response

Submit a response to the TUI request queue to complete a pending request.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `tui_execute_command`

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

Execute TUI command

Execute a TUI command (e.g. agent_cycle)

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `tui_open_help`

```elixir
@spec tui_open_help(opts :: keyword()) :: {:ok, boolean()} | :error
```

Open help dialog

Open the help dialog in the TUI to display user assistance information.

## Options

  * `directory`
  * `workspace`

# `tui_open_models`

```elixir
@spec tui_open_models(opts :: keyword()) :: {:ok, boolean()} | :error
```

Open models dialog

Open the model dialog

## Options

  * `directory`
  * `workspace`

# `tui_open_sessions`

```elixir
@spec tui_open_sessions(opts :: keyword()) :: {:ok, boolean()} | :error
```

Open sessions dialog

Open the session dialog

## Options

  * `directory`
  * `workspace`

# `tui_open_themes`

```elixir
@spec tui_open_themes(opts :: keyword()) :: {:ok, boolean()} | :error
```

Open themes dialog

Open the theme dialog

## Options

  * `directory`
  * `workspace`

# `tui_publish`

```elixir
@spec tui_publish(
  body ::
    OpenCode.Generated.EventTuiCommandExecute.t()
    | OpenCode.Generated.EventTuiPromptAppend.t()
    | OpenCode.Generated.EventTuiSessionSelect.t()
    | OpenCode.Generated.EventTuiToastShow.t(),
  opts :: keyword()
) :: {:ok, boolean()} | {:error, OpenCode.Generated.BadRequestError.t()}
```

Publish TUI event

Publish a TUI event

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `tui_select_session`

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

Select session

Navigate the TUI to display the specified session.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `tui_show_toast`

```elixir
@spec tui_show_toast(body :: map(), opts :: keyword()) :: {:ok, boolean()} | :error
```

Show TUI toast

Show a toast notification in the TUI

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `tui_submit_prompt`

```elixir
@spec tui_submit_prompt(opts :: keyword()) :: {:ok, boolean()} | :error
```

Submit TUI prompt

Submit the prompt

## Options

  * `directory`
  * `workspace`

# `vcs_diff`

```elixir
@spec vcs_diff(opts :: keyword()) ::
  {:ok, [OpenCode.Generated.VcsFileDiff.t()]} | :error
```

Get VCS diff

Retrieve the current git diff for the working tree or against the default branch.

## Options

  * `directory`
  * `workspace`
  * `mode`

# `vcs_get`

```elixir
@spec vcs_get(opts :: keyword()) :: {:ok, OpenCode.Generated.VcsInfo.t()} | :error
```

Get VCS info

Retrieve version control system (VCS) information for the current project, such as git branch.

## Options

  * `directory`
  * `workspace`

# `worktree_create`

```elixir
@spec worktree_create(
  body :: OpenCode.Generated.WorktreeCreateInput.t(),
  opts :: keyword()
) ::
  {:ok, OpenCode.Generated.Worktree.t()}
  | {:error, OpenCode.Generated.BadRequestError.t()}
```

Create worktree

Create a new git worktree for the current project and run any configured startup scripts.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `worktree_list`

```elixir
@spec worktree_list(opts :: keyword()) :: {:ok, [String.t()]} | :error
```

List worktrees

List all sandbox worktrees for the current project.

## Options

  * `directory`
  * `workspace`

# `worktree_remove`

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

Remove worktree

Remove a git worktree and delete its branch.

## Options

  * `directory`
  * `workspace`

## Request Body

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

# `worktree_reset`

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

Reset worktree

Reset a worktree branch to the primary default branch.

## Options

  * `directory`
  * `workspace`

## Request Body

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

---

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