OpenCode.Generated.Experimental (opencode_sdk v0.1.59)

Copy Markdown View Source

Provides API endpoints related to experimental

Summary

Types

experimental_console_list_orgs_200_json_resp()

@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()

@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()
}

Functions

experimental_console_get(opts \\ [])

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

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(opts \\ [])

@spec experimental_console_list_orgs(opts :: keyword()) ::
  {:ok, experimental_console_list_orgs_200_json_resp()}
  | {:error, OpenCode.Generated.EffectHttpApiErrorInternalServerError.t()}

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(body, opts \\ [])

@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(opts \\ [])

@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(opts \\ [])

@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
  • workspace
  • roots
  • start
  • cursor
  • search
  • limit
  • archived

tool_ids(opts \\ [])

@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(opts \\ [])

@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

worktree_create(body, opts \\ [])

@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(opts \\ [])

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

List worktrees

List all sandbox worktrees for the current project.

Options

  • directory
  • workspace

worktree_remove(body, opts \\ [])

@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(body, opts \\ [])

@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