Home / Skills / dagger/dagger

tui-qa

QA the live Dagger TUI with the TuiQa tools, driving a real from-source dagger CLI's pretty TUI over HTTP (DAGGER_TUI_CONSOLE). Read before using the tui-qa tools to read the rendered screen, send keys, inspect spans and their dagui flags, reproduce rendering bugs, or drive the interactive `dagger agent` prompt.

skillLicense: Apache-2.0 Source: dagger/dagger

Install

Copy this folder into your Claude Code project (needs Node.js):

npx degit dagger/dagger/.dagger/modules/tui-qa/skills/tui-qa .claude/skills/tui-qa

Or install it for every project:

npx degit dagger/dagger/.dagger/modules/tui-qa/skills/tui-qa ~/.claude/skills/tui-qa

File content

Made by its original authors and shared under Apache-2.0. We show it unchanged, with credit and a link to the source. Source ↗

---
name: tui-qa
description: QA the live Dagger TUI with the TuiQa tools, driving a real from-source dagger CLI's pretty TUI over HTTP (DAGGER_TUI_CONSOLE). Read before using the tui-qa tools to read the rendered screen, send keys, inspect spans and their dagui flags, reproduce rendering bugs, or drive the interactive `dagger agent` prompt.
---

# TUI QA

You can QA the live Dagger TUI with the TuiQa tools, which drive a real
from-source `dagger` CLI's pretty TUI over HTTP (the DAGGER_TUI_CONSOLE
affordance — see the `tui-console` skill).

Workflow:

- the tui-qa start tool (e.g. args: ["call", "test"]) builds the CLI from the
  workspace source, runs the command against a from-source engine, and starts
  serving the TUI.
- `screen` reads the current rendered terminal. Poll it to watch progress;
  startup takes a little while (build + engine connect), and the tools retry
  the connection for you.
- `wait` blocks until the screen matches a regex — or, without one, until it
  stops changing — then returns it. Prefer it over polling `screen` in a loop
  while a command or span finishes.
- `key`, `typeText`, `resize`, `zoom`, `spans` drive and inspect the TUI,
  exactly like the endpoints in the `tui-console` skill. Key tokens are tuist
  names — "enter", "esc", single characters, "ctrl+s" style modifier combos
  (not "C-s") — and unknown tokens are rejected rather than typed literally.
- `span(spanHex)` inspects one span in depth (status, error and origins,
  timing, dagui flags like internal/passthrough/roll-up, the parent chain with
  each ancestor's flags, and its loaded direct children) — use it to answer
  "why is this span hidden / why didn't its logs roll up", or to walk the tree
  from a span. Get ids from `spans`.
- Check for crashes explicitly: grep the screen for "panic:", "fatal error".
- the tui-qa stop tool when done.

Interactive prompt mode works too: starting with args: ["agent"] brings up the
live `dagger agent` prompt. Drive it by `typeText`-ing a line into the editline
and `key enter` to submit; `key esc` toggles nav/input mode. The runner uses
experimentalPrivilegedNesting so it inherits the outer session's LLM auth (no
credential setup needed). To restore a past session's agents, start with
args: ["agent", "-r", "<trace-id>"] against an engine that retains that
trace's archive (or with Cloud auth, below, so the CLI can fetch it).

Dagger Cloud auth is NOT inherited from the outer session: the CLI under test
reads it from the module's `cloudCredentials` setting, configured in
dagger.toml (`cloudCredentials = "file://~/.config/dagger/credentials.json"`)
and mounted where the CLI's auth code looks
(`$XDG_CONFIG_HOME/dagger/credentials.json`). Without it, commands that talk to
Cloud behave as logged out.

Profiling the live TUI process (for a wedged or busy input/render loop): the
runner also serves the CLI's PPROF debug server on a separate listener, so
these respond even when the console endpoints hang.

- `goroutines` dumps every goroutine's stack — the first stop for "what is the
  UI loop blocked on"; look for the goroutine holding consoleMu.
- `cpuProfile(seconds)` samples CPU while you reproduce the load and returns a
  `go tool pprof -top` table.
- `heapProfile` snapshots the heap the same way.

Once the session is up, `toolset` lists the tools the model actually sees
(names, descriptions, schemas) without spending an LLM turn.

If engine-lab tools are available, their start tool prints a tcp://<host>:1234
endpoint — pass it as `start(engineAddress: ...)` to run the TUI against THAT engine
instead of a fresh one, so its debug endpoints and logs observe exactly what
the TUI is driving. This is the mode for QA'ing engine-side changes, including
`args: ["agent"]`: LLM auth still works, because the module's `daggerConfig`
setting (the host's ~/.config/dagger/config.toml) is mounted into the CLI
under test and carries its LLM provider settings. Only if `daggerConfig` is
unset does an `agent` session against the lab engine fail to authenticate.
Caveat: restarting/stopping the lab engine breaks the attached TUI session —
start a new one after.