# `T3.CLI`
[🔗](https://github.com/dl-alexandre/t3-elixir/blob/main/lib/t3/cli.ex#L1)

Shell-free access to the installed T3 command line interface, using Exile.

`run/2` collects bounded output; `stream/3` delivers
`{:t3_cli, runner, {:data, binary}}`, then either
`{:t3_cli, runner, {:exit, result}}` or `{:t3_cli, runner, {:error, error}}`.
Long-running servers can use `stream/3` with an appropriate finite timeout.
Cancelling kills the directly invoked executable; detached grandchildren are not managed.
Requires Linux or macOS and a C toolchain to build Exile's native code.
Pipes support stdin and EOF; arbitrary inherited descriptors (such as
`--bootstrap-fd`) and terminal/PTY-only interaction are not provided.
CLI capabilities vary by installed version. No command is executed by construction.

    cli = T3.CLI.new()
    T3.CLI.run(cli, ["thread", "send", thread_id, "-"], input: "Review these changes")

    {:ok, runner} = T3.CLI.stream(cli, ["thread", "send", thread_id, "-"])
    :ok = T3.CLI.write(runner, "Review these changes")
    :ok = T3.CLI.close_stdin(runner)
    # Receive {:t3_cli, runner, {:data, bytes}}, then {:exit, result} / {:error, error}.

# `t`

```elixir
@type t() :: %T3.CLI{
  cwd: term(),
  env: term(),
  executable: term(),
  max_output_bytes: term(),
  timeout: term()
}
```

# `app`

Run the `t3 app` command family. Requires support in the installed T3 version.

# `auth`

Run the `t3 auth` command family. Requires support in the installed T3 version.

# `browser`

Run the `t3 browser` command family. Requires support in the installed T3 version.

# `cancel`

Stop a streaming invocation.

# `close_stdin`

Close stdin while continuing to read output (EOF for commands reading `-`).

# `commands`

Discover commands actually advertised by this installed version's help.

# `connect`

Run the `t3 connect` command family. Requires support in the installed T3 version.

# `doctor`

Run the `t3 doctor` command family. Requires support in the installed T3 version.

# `families`

Known command families; commands/2 discovers the installed executable's actual support.

# `help`

Read top-level or subcommand help without invoking the operation.

# `new`

Configure the executable, working directory, environment, deadline and output limit.

# `os_pid`

Return the OS process ID, or an error with code :process_exited if it already exited.

# `pair`

Run the `t3 pair` command family. Requires support in the installed T3 version.

# `project`

Run the `t3 project` command family. Requires support in the installed T3 version.

# `run`

Run T3 with literal arguments. Optional :input iodata is written then stdin closes; default input is empty.

# `serve`

Run the `t3 serve` command family. Requires support in the installed T3 version.

# `service`

Run the `t3 service` command family. Requires support in the installed T3 version.

# `start`

Run the `t3 start` command family. Requires support in the installed T3 version.

# `stream`

Start a linked runner; :owner defaults to caller. Stdin stays open unless :input is supplied.

# `theme`

Run the `t3 theme` command family. Requires support in the installed T3 version.

# `thread`

Run the `t3 thread` command family. Requires support in the installed T3 version.

# `trace`

Run the `t3 trace` command family. Requires support in the installed T3 version.

# `triage`

Run the `t3 triage` command family. Requires support in the installed T3 version.

# `uninstall`

Run the `t3 uninstall` command family. Requires support in the installed T3 version.

# `update`

Run the `t3 update` command family. Requires support in the installed T3 version.

# `version`

Read version output without modifying T3.

# `write`

Write iodata to the streaming command's stdin.

---

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