# `ClaudeAgentSDK.Runtime.CLI`
[🔗](https://github.com/nshkrdotcom/claude_agent_sdk/blob/v0.17.2/lib/claude_agent_sdk/runtime/cli.ex#L1)

Session-oriented runtime kit for the shared Claude CLI lane.

The tagged mailbox event atom is provider-owned adapter detail. Higher-level
callers should prefer the projected Claude stream events instead of matching a
core session tag directly.

# `start_option`

```elixir
@type start_option() ::
  {:options, ClaudeAgentSDK.Options.t()}
  | {:execution_surface,
     CliSubprocessCore.ExecutionSurface.t() | map() | keyword()}
  | {:subscriber, pid() | {pid(), reference() | :legacy}}
  | {:metadata, map()}
  | {:session_event_tag, atom()}
  | {:startup_mode, :eager | :lazy}
  | {:task_supervisor, pid() | atom()}
  | {:headless_timeout_ms, pos_integer() | :infinity}
  | {:max_buffer_size, pos_integer()}
  | {:max_stderr_buffer_size, pos_integer()}
```

# `build_invocation`

```elixir
@spec build_invocation(keyword()) ::
  {:ok, CliSubprocessCore.Command.t()} | {:error, term()}
```

# `capabilities`

```elixir
@spec capabilities() :: [atom()]
```

# `close`

```elixir
@spec close(pid()) :: :ok
```

# `end_input`

```elixir
@spec end_input(pid()) :: :ok | {:error, term()}
```

# `info`

```elixir
@spec info(pid()) :: map()
```

# `interrupt`

```elixir
@spec interrupt(pid()) :: :ok | {:error, term()}
```

# `list_provider_sessions`

```elixir
@spec list_provider_sessions(keyword()) :: {:ok, [map()]} | {:error, term()}
```

# `new_projection_state`

```elixir
@spec new_projection_state(map()) :: ClaudeAgentSDK.Runtime.CLI.ProjectionState.t()
```

# `project_event`

```elixir
@spec project_event(
  CliSubprocessCore.Event.t(),
  ClaudeAgentSDK.Runtime.CLI.ProjectionState.t()
) ::
  {[map()], ClaudeAgentSDK.Runtime.CLI.ProjectionState.t()}
```

# `send_input`

```elixir
@spec send_input(pid(), iodata() | map() | list(), keyword()) ::
  :ok | {:error, term()}
```

# `start_session`

```elixir
@spec start_session([start_option()]) ::
  {:ok, pid(),
   %{
     info: map(),
     projection_state: ClaudeAgentSDK.Runtime.CLI.ProjectionState.t()
   }}
  | {:error, term()}
```

# `subscribe`

```elixir
@spec subscribe(pid(), pid(), reference()) :: :ok | {:error, term()}
```

---

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