Files
t3tui/docs/development.md
venomade b40f09e56f Bump vendored T3 Code to 42c9107983 (v0.1.12-nightly) and catch up
- vendor/t3code submodule pinned to 42c9107983; deps in package.json
  aligned with the upstream catalog, including upstream's effect@4.1.5
  patch via patchedDependencies (patches/effect@4.1.5.patch)
- nix flake.nix devShell provides bun locally (no guix home install)
- scripts/link-vendor.ts now copies the vendored packages into
  node_modules/@t3tools and applies tscPatches for the spots where
  classic tsc can't infer what upstream's Effect language service can,
  so `bun run typecheck` runs clean under full strict mode
- protocol drift fixes across model/ui/client: usage-limit copy, context
  window snapshot, checkpoint totals, turn diff summaries, alert
  observation, "once" schedules, composer trigger kinds, PR keying,
  thread menu state, secret request answers, terminal summaries,
  snapshot-required shell events, revert checkpoint lookup
- new parity features over the typed RPC: fork a turn into a new thread,
  rewind a message with its attachments restored to the composer, guest
  share links and turn-into-project in the thread menu
- tests updated and added (301 pass); typecheck, lint and build clean

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-11-24 00:52:30 +00:00

3.8 KiB

Developing t3tui

Running from source

t3tui runs the bundle in dist/, which uses over 100 MB less memory than the sources. After pulling changes, run bun run build (or bun install) to rebuild it; bun run dev runs the sources directly.

Set T3TUI_DEBUG=/path/to/log to log thread subscriptions and snapshots.

How it connects

  • It finds the local server from ~/.t3/userdata/server-runtime.json (override with T3TUI_SERVER).
  • On first run it mints its own bearer session with t3 auth session issue --label t3tui, scoped to orchestration:read, orchestration:operate (attachments and automations ride on it), filesystem:read (diffs), source-control:write (git actions), terminal:read and terminal:operate (terminals, stopping servers), diagnostics:read (usage totals) and providers:manage (reset credits), and stores it in ~/.config/t3tui/credentials.json (mode 600). A stored credential missing any of these scopes is replaced with a new one. Revoke it any time with t3 auth session revoke. For a remote server, pass a token in T3TUI_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 (commit 42c9107983, v0.1.12-nightly).

Following the web app

t3tui aims to behave like T3 Code's web app: the same sidebar sections and status words, timeline, thread menu, palette scoring, alert rules, setting names and defaults (except the two alert settings), attachment limits, and editor fallback order. Where it can, it uses the web app's own code from vendor/t3code rather than reimplementing it. When a behaviour differs, that's either a gap (listed under "Not yet supported" in the README) or a terminal constraint, such as links showing as raw markdown in the message box instead of chips.

Some gaps come from the pinned server rather than t3tui: it doesn't publish update-available or shutting-down events, historical checkpoint diffs have no unchanged context, and the open-in-editor RPC has no line argument.

Updating for a newer T3 Code

The protocol packages are private and change without notice, so t3tui tracks a pinned upstream tag:

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.

Two patches ride along with a bump: upstream's patches/effect@*.patch is applied to the installed effect package through patchedDependencies in package.json (copy the current patch file into patches/ when the effect version changes), and tscPatches in scripts/link-vendor.ts fixes the spots where classic tsc can't infer what upstream's Effect language service can — the vendored packages are copied into node_modules/@t3tools for this, so vendor/ itself stays pristine.

Releasing

Releases are standalone binaries built with bun build --compile, so users don't need Bun or a checkout. To cut one, bump version in package.json, commit, and push a matching tag:

git tag v0.1.0 && git push origin v0.1.0

The Release workflow compiles linux-x64, linux-arm64, darwin-x64, darwin-arm64 and windows-x64 on one machine, opens each binary's dashboard on its own OS (on Windows it only runs t3tui version), and publishes them gzipped with a SHA256SUMS file, which install.sh, install.ps1 and t3tui upgrade all check. Run the workflow by hand to build and check the binaries without releasing.

To build a binary locally, run bun run compile (this machine) or name targets, e.g. bun run compile darwin-arm64. Other platforms' targets need their OpenTUI packages: bun install --os='*' --cpu='*'. Binaries go in release/.