OpenCode.Generated.Pty (opencode_sdk v0.1.64)

Copy Markdown View Source

Provides API endpoints related to pty

Summary

Functions

Connect to PTY session

Create PTY WebSocket token

Create PTY session

Get PTY session

List PTY sessions

Remove PTY session

List available shells

Types

pty_connect_token_200_json_resp()

@type pty_connect_token_200_json_resp() :: %{
  expires_in: integer(),
  ticket: String.t()
}

pty_shells_200_json_resp()

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

t()

@type t() :: %OpenCode.Generated.Pty{
  args: [String.t()],
  command: String.t(),
  cwd: String.t(),
  id: String.t(),
  pid: integer(),
  status: String.t(),
  title: String.t()
}

Functions

pty_connect(ptyID, opts \\ [])

@spec pty_connect(ptyID :: String.t(), opts :: keyword()) ::
  {:ok, boolean()}
  | {:error,
     OpenCode.Generated.EffectHttpApiErrorForbidden.t()
     | 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_connect_token(ptyID, opts \\ [])

Create PTY WebSocket token

Create a short-lived ticket for opening a PTY WebSocket connection.

Options

  • directory
  • workspace

pty_create(body, opts \\ [])

@spec pty_create(body :: map(), opts :: keyword()) ::
  {:ok, 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(ptyID, opts \\ [])

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

Get PTY session

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

Options

  • directory
  • workspace

pty_list(opts \\ [])

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

List PTY sessions

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

Options

  • directory
  • workspace

pty_remove(ptyID, opts \\ [])

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

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

@spec pty_update(ptyID :: String.t(), body :: map(), opts :: keyword()) ::
  {:ok, 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