- Details rows are actionable: view the working-tree diff (whole or per file), run the web app's git quick action or menu after a confirmation, stop a local server, run or toggle an automation, open lineage threads. - Command palette (ctrl+k or :) searching commands and threads with T3's own scoring. - Subagent work entries link to their child threads; u goes to the parent. - Threads open scrolled to the bottom. - Mouse: thread rows, collapsed sections, details rows, palette, composer. - The / filter opens in the thread list. - Multi-line composer: shift+enter, ctrl+j, or a trailing backslash; it grows to 8 lines. - The credential asks for filesystem:read, source-control:write and terminal:operate, and is reissued when a stored one lacks them.
95 lines
6.5 KiB
Markdown
95 lines
6.5 KiB
Markdown
# tui3
|
||
|
||
A terminal client for [T3 Code](https://github.com/pingdotgg/t3code). It connects to the T3 Code server you already run, shows every thread live, and lets you read, message, approve and stop them without the GUI.
|
||
|
||
Built with Bun and [OpenTUI](https://github.com/anomalyco/opentui) (React).
|
||
|
||
## Install
|
||
|
||
```sh
|
||
git clone --recurse-submodules <this repo> && cd tui3
|
||
bun install # also links the pinned T3 Code packages into node_modules
|
||
bun link # optional: puts `tui3` on your PATH
|
||
```
|
||
|
||
## Use
|
||
|
||
```sh
|
||
tui3 # dashboard: threads on the left, the selected thread on the right
|
||
tui3 attach <thread> # one thread, full screen (id, short id from `tui3 list`, or title text)
|
||
tui3 list [--json] # print threads and exit
|
||
tui3 tmux [--watch] # mirror active threads into a tmux session, one window each
|
||
```
|
||
|
||
The message box is always at the bottom. tui3 has two modes: **typing**, where keys go to the message box, and **navigation**, where single keys act. `esc` switches to navigation; `i`, `enter` or `tab` switch back. Drafts are kept per thread.
|
||
|
||
Any mode:
|
||
|
||
| Key | Action |
|
||
| --- | --- |
|
||
| `ctrl+k` | command palette: every action below, plus thread search |
|
||
| `ctrl+n` / `ctrl+p` (or `alt+↓`/`alt+↑`) | next / previous thread |
|
||
| `pgup`/`pgdn`, `ctrl+u`/`ctrl+d` | scroll the conversation |
|
||
| `ctrl+c` | quit |
|
||
|
||
Typing: `enter` sends. While the agent is running, `enter` steers it (the message reaches it mid-run) and `alt+enter` queues the message for after the run, as in T3 Code. With an approval pending, a typed message declines it with your feedback. `shift+enter` or `ctrl+j` adds a newline (`shift+enter` needs a terminal with the kitty keyboard protocol); so does ending the line with `\` and pressing `enter`. The box grows up to 8 lines.
|
||
|
||
Navigation:
|
||
|
||
| Key | Action |
|
||
| --- | --- |
|
||
| `j`/`k`, arrows | next / previous thread (scroll, in `attach`) |
|
||
| `y` / `Y` / `n` | approve / always allow this session / decline the pending approval |
|
||
| `1`–`9` | pick an option when the agent asks a question (also in an empty message box) |
|
||
| `x` | dismiss the agent's question |
|
||
| `e` | expand all folded turns and work groups |
|
||
| `o` | load earlier turns |
|
||
| `d` | show or hide thread details |
|
||
| `l` / `→` | move into the details panel: `j`/`k` choose, `enter` opens, `t` turns an automation on or off, `esc` comes back |
|
||
| `u` | go to the parent thread (from a fork or subagent) |
|
||
| `:` | command palette |
|
||
| `z` | show the Settled and Snoozed sections |
|
||
| `/` | filter threads by title or project (the box opens at the top of the thread list) |
|
||
| `S` | stop the thread |
|
||
| `g` / `G` | top / bottom of the conversation |
|
||
| `esc` / `q` | close the diff; otherwise `q` quits |
|
||
|
||
The layout follows T3 Code's web app, and much of it uses the web app's own code (vendored from upstream):
|
||
|
||
- **Sidebar:** the same sections (Pinned, Active, Working, then Snoozed and Settled folded to a count) and the same status words: `Working 2m`, `Waiting`, `Approval`, `Input`, `Request`, `Limited`, `Failed`, `Done`. Threads that need you are bold.
|
||
- **Conversation:** built by the web app's timeline logic. Each finished turn's work folds into one line (`Worked for 3m 12s`), your messages are right-aligned, and a running turn shows its live step and `Working for 12s`.
|
||
- **Thread details:** a column beside the conversation with the workspace, model and mode, the branch with ahead/behind and its pull request, uncommitted changes per file, lineage (forks and subagents), background work and the goal. It opens by itself on terminals 160 columns or wider; on narrow ones `d` shows it in place of the conversation.
|
||
- **Diffs:** pick `View diff` or a file under Changes to see uncommitted changes as unified diffs in place of the conversation. `j`/`k` scroll, `esc` closes.
|
||
- **Git:** the branch section offers the web app's quick action (`Commit & push`, `Push`, `Create PR`…) and its menu. Every action asks first, says when you are on the default branch, and takes an optional commit message (blank lets T3 write one). Progress shows on the bottom line.
|
||
- **Servers and automations:** local dev servers the thread started (stop one from the panel) and T3's scheduled tasks with their schedule and next run (run now, or turn on and off).
|
||
- **Subagents:** subagent work in the conversation and the lineage rows in details are links; `enter` or a click opens the child thread, and `u` goes back. Idle subagents have no details, because the thread list leaves them out.
|
||
- **Command palette:** `ctrl+k`, as in the web app. It searches commands and threads with T3's own scoring; start with `>` for commands only.
|
||
- **Mouse:** click a thread to open it, a collapsed section to unfold it, a details row to run it, the message box to type, or a palette row.
|
||
- Threads open scrolled to the bottom.
|
||
- **Read state:** opening a thread marks it read after a moment, as the web app does. Set `TUI3_NO_VISIT=1` to turn that off.
|
||
|
||
Long threads load as a bounded window of recent turns; press `o` for older ones. If the connection drops, tui3 reconnects with backoff and resubscribes.
|
||
|
||
## How it connects
|
||
|
||
- It finds the local server from `~/.t3/userdata/server-runtime.json` (override with `TUI3_SERVER`).
|
||
- On first run it mints its own bearer session with `t3 auth session issue --label tui3`, scoped to `orchestration:read`, `orchestration:operate`, `filesystem:read` (diffs), `source-control:write` (git actions) and `terminal:operate` (stopping servers), and stores it in `~/.config/tui3/credentials.json` (mode 600). Revoke it any time with `t3 auth session revoke`. A stored credential missing any of these scopes is replaced with a new one. For a remote server, pass a token in `TUI3_TOKEN`.
|
||
- It speaks T3 Code's own WebSocket RPC protocol, typed by upstream's `@t3tools/contracts`, and applies thread updates with upstream's own reducers. Both come from `vendor/t3code`, a submodule pinned to the server version this was built against (`v0.1.6-nightly.20261030.3917`).
|
||
|
||
Set `TUI3_DEBUG=/path/to/log` to log thread subscriptions and snapshots.
|
||
|
||
## Updating for a newer T3 Code
|
||
|
||
The protocol packages are private and change without notice, so tui3 tracks a pinned upstream tag:
|
||
|
||
```sh
|
||
cd vendor/t3code && git fetch --depth 1 origin tag <tag> && git checkout <tag> && cd -
|
||
bun install && bun run typecheck && bun test
|
||
```
|
||
|
||
Type errors after a bump point at the protocol changes to adapt to.
|
||
|
||
## Not yet supported
|
||
|
||
Starting new threads, editing queued messages, plan follow-ups, attachments, reviewing or commenting on diffs, and the integrated terminal. Use the T3 Code app for those.
|