npx skills add ...
npx skills add microsoft/aspire --skill hex1b
CLI tool for automating any terminal application — TUI apps, shells, CLI tools, REPLs, and more. Use when you need to launch a process in a virtual terminal, capture its screen output, inject keystrokes or mouse input, take screenshots, record sessions, or assert on what's visible.
npx skills add microsoft/aspire --skill hex1b
The dotnet hex1b CLI tool lets you automate any terminal application — TUI apps,
interactive CLIs, shells, REPLs, curses programs, or anything else that runs in a terminal.
It wraps arbitrary processes in a headless virtual terminal, giving you programmatic control
over screen capture, input injection, and content assertions.
A terminal is a headless virtual terminal managed by Hex1b. Any process that runs in a terminal emulator can be launched inside one. Terminals are identified by a short numeric ID (the process ID). Use a prefix if unambiguous.
All commands support --json for machine-readable output.
Start any command in a headless terminal. This is the entry point for all automation.
To get the terminal ID for subsequent commands:
Capture the terminal's visible content at any point.
The --wait option polls until the specified text is visible, then captures. Useful when
the application takes time to render its initial state.
Use assertions to block until content is visible (or confirm it's absent). This is essential for reliable automation — never assume timing.
Exit code 0 means the assertion passed; non-zero means it failed (timed out).
Type text or send individual keys to the terminal.
Available key names (from the Hex1bKey enum, case-insensitive):
A–ZD0–D9F1–F12UpArrow, DownArrow, LeftArrow, RightArrow, Home, End, PageUp, PageDownBackspace, Delete, InsertTab, Enter, SpacebarEscapeOemComma, OemPeriod, OemMinus, OemPlus, OemQuestion, Oem1, Oem4, Oem5, Oem6, Oem7, OemTildeNumPad0–NumPad9, Multiply, Add, Subtract, Decimal, DivideClick or drag at specific terminal coordinates (0-based column, row).
If the terminal is already running, start recording its session to an asciinema .cast file.
Use --record on terminal start to begin recording immediately when the process launches.
The .cast file is written incrementally, so the file will contain all events up to the
point you stop.
If the terminal is running a Hex1b application with .WithDiagnostics() enabled, you can
inspect its internal widget/node tree.
Attach to a terminal for interactive use — you see what the process sees and can type directly.
Generate this skill file for a repository so AI agents know how to use the CLI.
--json with jq for scriptable output: dotnet hex1b terminal list --json | jq '.[] | .id'terminal list automatically cleans up stale sockets from exited processescapture screenshot --wait is useful for waiting for async rendering before capturingassert before interacting — never assume the app has rendered--output is required since PNG is a binary format.cast format and can be played with any compatible player