tui-test
Skill11k starsChanged 3 months agoMITView on GitHub
Drive, inspect, assert on, record, and watch a real terminal from the command line with the tui-test cli. Use when running shells (bash, zsh, fish, PowerShell, pwsh, cmd, xonsh, elvish, nushell) or TUI programs (vim, less, top, etc.) in a headless PTY; sending keystrokes, key combos, or mouse input; resizing, writing raw bytes, or signaling the child; waiting for a command to finish or the screen to settle; asserting on terminal text, colors, exit codes, output, or snapshots; capturing text or full-color SVG screenshots; recording and replaying asciinema sessions; watching a live cli session while an agent drives it; or driving process-local sessions from Rust, Python, or Node.
- Installs packages
1 other project uses a version of this.
Trending
Quiet since September.about the whole repository
Most recently taken up by
- microsoft/tui-testtheir own version, first seen Sep 17, 2026
Who's talking about microsoft/inshellisense
- A Hacker News story“Show HN: Inshellisense – IDE style shell autocomplete”Hacker News · Nov 6, 2023 · 388 points
- clap-rs/clap“Stablize Rust-Native Completion Engine Tracking Issue”GitHub · Dec 13, 2021 · 102 reactions
- nushell/nushell“Smarter auto-complete built-in”GitHub · Feb 24, 2024 · 28 reactions
- @github-trending-js.bsky.social“🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / inshellisense ⭐ 8,963 (+144) 🗒 TypeScript IDE style …”Bluesky · Jan 4, 2025 · 10 likes
- @midu.dev“Las instrucciones son muy fáciles: github.com/microsoft/in... Y sólo necesitas Node para hacerlo funcionar.”Bluesky · Jan 3, 2025 · 7 likes
The biggest 5 of 52 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 52
Talked about on GitHub, Bluesky and Hacker News (52 times).
On GitHub · 40
- Dec 13, 2021Stablize Rust-Native Completion Engine Tracking Issue — clap-rs/clap102 reactions · 34 comments
- Feb 24, 2024Smarter auto-complete built-in — nushell/nushell28 reactions · 21 comments
- Nov 10, 2023Integrate inshellisense — warpdotdev/warp4 reactions · 2 comments
- Nov 7, 2023Package request: inshellisense — NixOS/nixpkgs2 reactions · 2 comments
- Aug 28, 2025[Feature / Option request] Bring Inshellisense option — ekstranix/home-manager-option-search1 reaction
35 more on GitHub
- Nov 9, 2024OSC sequences are malformed in a prompt — elves/elvish1 reaction · 2 comments
- Dec 19, 2018Autocompletion — PatMyron/dotfiles1 reaction
- Sep 27, 2026External completion sources: Carapace, Fig-compatible specs and Inshellisense — raiseCatError/notMyShell0 reactions · 2 comments
- Sep 12, 2026A display problem — raphamorim/rio0 reactions · 3 comments
- Sep 12, 2026chore(deps): update inshellisense to v0.0.4 — uniget-org/tools0 reactions · 1 comment
- Sep 12, 2026inshellisense: 0.0.3 -> 0.0.4 — NixOS/nixpkgs0 reactions
- Aug 11, 2026chore(deps): update inshellisense to v0.0.3 — uniget-org/tools0 reactions · 1 comment
- Aug 11, 2026inshellisense: 0.0.2 -> 0.0.3 — NixOS/nixpkgs0 reactions · 3 comments
- Jul 30, 2026chore(deps): update inshellisense to v0.0.2 — uniget-org/tools0 reactions · 1 comment
- Jul 30, 2026inshellisense: 0.0.1 -> 0.0.2 — NixOS/nixpkgs0 reactions
- Mar 22, 2026chore(deps): update dependency @microsoft/inshellisense to v0.0.1 — uniget-org/tools0 reactions · 1 comment
- Feb 19, 2026Warp fails to start if inshellisense is loaded in .zshrc — warpdotdev/warp0 reactions · 2 comments
- Jan 23, 2026chore(deps): update dependency @microsoft/inshellisense to v0.0.4 — killo431/tools0 reactions
- Jan 23, 2026chore(deps): update dependency @microsoft/inshellisense to v0.0.1-rc.31 — uniget-org/tools0 reactions · 1 comment
- Jan 3, 2026inshellisense: do not build against nodejs 24 — NixOS/nixpkgs0 reactions · 5 comments
- Nov 17, 2025inshellisense:微软开源的 IDE 风格的命令行自动补全 — jaywcjlove/quick-rss0 reactions · 1 comment
- May 26, 2025inshellisense: 0.0.1-rc.20 -> 0.0.1-rc.21 — NixOS/nixpkgs0 reactions
- May 23, 2025chore(deps): update dependency @microsoft/inshellisense to v0.0.1-rc.21 — uniget-org/tools0 reactions · 3 comments
- May 23, 2025OpenBSD Support — homebridge/node-pty-prebuilt-multiarch0 reactions · 1 comment
- Jan 6, 2025inshellisense: 0.0.1-rc.18 -> 0.0.1-rc.20 — NixOS/nixpkgs0 reactions
- Jan 4, 2025chore(deps): update dependency @microsoft/inshellisense to v0.0.1-rc.20 — uniget-org/tools0 reactions · 3 comments
- Jan 1, 2025chore(deps): update dependency @microsoft/inshellisense to v0.0.1-rc.19 — uniget-org/tools0 reactions · 3 comments
- Nov 8, 2024chore(deps): update dependency @microsoft/inshellisense to v0.0.1-rc.18 — uniget-org/tools0 reactions · 4 comments
- Nov 7, 2024inshellisense: 0.0.1-rc.16 -> 0.0.1-rc.18 — NixOS/nixpkgs0 reactions
- Aug 29, 2024inshellisense: 0.0.1-rc.15 -> 0.0.1-rc.16 — NixOS/nixpkgs0 reactions · 2 comments
- Aug 27, 2024chore(deps): update dependency @microsoft/inshellisense to v0.0.1-rc.16 — uniget-org/tools0 reactions · 3 comments
- Jul 6, 2024ble ignores/tramples inSHELLisense bindings — akinomyoga/ble.sh0 reactions · 5 comments
- Apr 2, 2024Feat: Integration https://github.com/microsoft/inshellisense — nyaosorg/nyagos0 reactions · 10 comments
- Feb 5, 2024Add inshellisense — ublue-os/toolboxes0 reactions · 1 comment
- Nov 16, 2023Support with inshellisense — Effect-TS/effect0 reactions · 2 comments
- Nov 15, 2023inshellisense — keinsell/dotfiles0 reactions
- Nov 13, 2023Add inshellisense — kieranpotts/bootstrap0 reactions · 3 comments
- Nov 10, 2023Use Microsoft inshellisense — BSVN/ResaStandardDevEnv0 reactions
- Nov 6, 2023Investigate `inshellisense` — chopfitzroy/dotfiles-experiment0 reactions
- Nov 6, 2023inshellisense is broken — IgorKrupenja/dotfiles0 reactions
On Bluesky · 11
- Jan 4, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / inshellisense ⭐ 8,963 (+144) 🗒 TypeScript IDE style command line auto complete — @github-trending-js.bsky.social10 likes and reposts · 1 reply
- Jan 3, 2025Las instrucciones son muy fáciles: github.com/microsoft/in... Y sólo necesitas Node para hacerlo funcionar. — @midu.dev7 likes and reposts
- Jan 2, 2025Apesar de todo "hate", Microsoft lança umas paradas legais né. Autocomplete pra IDE com suporte a mais de 600 comandos, suporte para… — @flep.dev5 likes and reposts
- Nov 19, 2023ターミナルでIDE風の自動補完。リリースしてるのはmicrosoftだがWindowsのみならずLinuxやmacOSでも動作。ほほう — @matsuu.bsky.social4 likes and reposts
- Jul 25, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / inshellisense ⭐ 10,491 (+116) 🗒 TypeScript IDE style command line auto complete — @github-trending-js.bsky.social3 likes and reposts
6 more on Bluesky
- Nov 9, 2023🎉 Celebrating! 🎉 (500+ new stars) 📦 microsoft / inshellisense ⭐ 2,596 (+689) 🗒 TypeScript IDE style command line auto complete — @github-trending.bsky.social2 likes and reposts · 1 reply
- Nov 7, 2023Show HN: Inshellisense – IDE style shell autocomplete HNを表示: Inshellisense - IDEスタイルのシェルオートコンプリート 🔺 308 💬 29 🔗 HN Post | Article — @hacker-news-jp.bsky.social2 likes and reposts · 1 reply
- Nov 17, 2025IDE-style command-line autocompletion open-sourced by Microsoft 👉 github.com/microsoft/in... — @wangchujiang.com1 likes and repost
- Jan 1, 2025Microsoft again making it hard to hate them: intellisense for the shell. github.com/microsoft/in... — @syn.horse1 likes and repost
- Nov 8, 2023🎉 Celebrating! 🎉 (500+ new stars) 📦 microsoft / inshellisense ⭐ 1,736 (+622) 🗒 TypeScript IDE style command line auto complete — @github-trending-js.bsky.social0 likes and reposts · 1 reply
- Nov 8, 2023github.com/microsof... GitHub - microsoft/inshellisense: IDE style command line auto complete — @technews4869.bsky.social0 likes and reposts · 1 reply
On Hacker News · 1
- Nov 6, 2023Show HN: Inshellisense – IDE style shell autocomplete388 points · 148 comments
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- microsoft/tui-test★ 277same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 48
Every command returns a stable exit code so you can branch on the failure class without parsing text:
- Very specific: line 222
Every session records automatically from the moment it opens, in asciinema v2 cast format, stored in your XDG cache by session name.
- Distinctive: line 397
Every enabled backend satisfies the same cell-grid contract.
- Very specific: line 475
Stuck session?: If the screen is frozen and input seems ignored (e.g.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
tui-test
tui-test controls a real terminal from the command line. It runs shells and
TUI programs in a headless PTY behind a background daemon: a stateless cli front
end talks to a daemon that owns the PTY and renders it into a full terminal
emulator. Each call connects, acts, and exits, and they all share one live
session. With it you can spawn a session, read the rendered screen, send keys
and mouse input, wait for a condition, assert on the result, and record the
session.
Built for agents: self-documenting commands
Three commands let an agent look up the rest of the surface instead of guessing:
tui-test agent-context: versioned JSON describing every command, flag, enum, default, and the exit-code taxonomy. It is generated from the cli, so it stays in sync. Read this first when you need exact argument shapes.tui-test usage: a one-screen command cheatsheet.tui-test skill: this guide.
Core model
- Sessions.
--session <name>(defaultdefault, envTUI_TEST_SESSION) selects a terminal. The first command auto-starts that session's daemon; the session persists across calls untilclose. Sessions are independent. - Stateless calls. Each invocation connects to the daemon, acts, and exits. State (screen, cwd, last command) lives in the daemon, not the cli.
- JSON. Pass
--jsonon any command for machine-readable output. Data goes to stdout, diagnostics to stderr. On failure the JSON carries a"kind"(assertion/usage/no_session/internal). - Verbose.
--verbose/-vstarts the daemon with a full PTY traffic log (see Debugging). Only takes effect when the daemon starts. - Daemon upgrades. A client automatically replaces a daemon from another
tui-testversion. Per-session locking prevents concurrent clients from racing the restart. - Defaults. New sessions are
80x30. Timeouts come in five classes:textandidledefault to 5s;command,exit, andreadyto 30s. Set a session default in the selected config profile or withopen --timeout-<class> <ms>, or override one call with--timeout.statereports the effective values.
Exit codes
Every command returns a stable exit code so you can branch on the failure class without parsing text:
| Code | Meaning |
0 | success |
1 | assertion or wait condition not met (expect / wait) |
2 | usage / invalid argument |
3 | no active session (run open / run first) |
4 | daemon or IPC error |
5 | internal error |
Command reference
Session & lifecycle
| Command | Description |
open [--shell S] [--backend B] [--cols N] [--rows N] [--cwd D] [--env K=V]... [--config F] [--profile P] [--restart] | Spawn or reuse a shell session. --env is repeatable. |
run [--backend B] [--cols N] [--rows N] [--cwd D] [--env K=V]... [--config F] [--profile P] [--restart] <program> [args...] | Spawn or reuse a session running a program directly. |
sessions | List active sessions. |
close [--all] | Close the current session (or every session with --all). |
daemon start | Start this session's daemon. Most commands start one on demand. |
daemon status | Inspect a session's daemon (pid, log path). Exit 3 if none is running. |
daemon stop --session N | --all | Stop one session's daemon, or every daemon. Needs a target. |
open and run reuse an existing live child for the selected session. Pass
--restart (or --force) to replace it.
Inspection
| Command | Description |
state | cwd, size, cursor, window title, last command + exit code, bell count, timeouts, and a text snapshot. |
text [--full] | Rendered viewport text, or full scrollback with --full. |
screenshot [PATH] [-o FILE] [--full] [--zoom N] | Terminal text to stdout, or a full-color SVG scaled without changing its terminal cells. |
cells X Y [W H] | Per-cell attributes (char, fg, bg, flags) for a region. |
get command|output|exit-code|cwd|cursor|size|title|bells|bell-events | One structured field. |
Input
| Command | Description |
type "text" | Type literal text (no return key). |
submit ["text"] | Type text then press the shell's return key. Omit text to just submit. |
key press <Key...> | Simulate key presses, e.g. key press Ctrl+C. |
key down <Key...> / key up <Key...> | Simulate explicit keydown and keyup events. |
key repeat <Key...> | Send repeat events (press-equivalent in legacy mode). |
mouse click X Y / mouse click --on-text "OK" [--button N] [--clicks N] | Click by coordinates or by visible label. |
mouse move|down|up|drag|scroll ... | Full mouse control (--button default 0=left, scroll --amount default 3). |
Key input automatically follows the Kitty keyboard protocol flags negotiated by
the child application. A key press sends the normal press input and adds a
release only when the child requests event-type reporting. Text-producing keys
also require report-all-keys mode before repeat and release events can be
represented. Modifiers are Ctrl, Alt / Option, Shift, Super, Hyper,
and Meta. Top-level press remains a compatibility alias for key press.
PTY control
| Command | Description |
resize COLS ROWS | Resize the PTY and emulator. |
write <data> | Write raw bytes to the PTY (no return key appended). |
signal INT|TERM|KILL|QUIT | Send a signal to the session's child process. |
kill | Kill the session's child process. |
Wait (block until a condition holds)
| Command | Description |
wait text "T" [--regex --full --not --timeout MS] | Until text/regex is (with --not, is not) visible. Most precise wait. |
wait title "T" [--regex --not --timeout MS] | Until the window title (OSC 0/OSC 2) matches. Programs announce progress there. |
wait idle [--timeout MS] | Until the screen stops repainting (~250ms quiet). |
wait command [--timeout MS] | Until the current foreground command finishes (needs shell integration). |
wait exit [--timeout MS] | Until the session's program/shell itself exits. |
wait ready [--timeout MS] | Until the shell reports a ready prompt (needs shell integration). open waits by default. |
wait bell [--timeout MS] | Until the next terminal bell event. |
Expect (exit 0 = pass, 1 = fail)
| Command | Description |
expect text "T" [--regex --full --no-strict --not --fg C --bg C --timeout MS] | Visibility plus optional color. --no-strict relaxes a strict single-match. |
expect title "T" [--regex --not --timeout MS] | The window title set with OSC 0/OSC 2. An unset title matches nothing. |
expect exit-code N [--timeout MS] | The last command's exit code. Waits for the command to finish first. |
expect output "T" [--regex] | The last command's captured output. |
expect bell N [--timeout MS] | The cumulative bell count reaches at least N. |
expect snapshot NAME [-u] [--include-colors --include-title] | Compare the screen against __snapshots__/NAME.snap; -u writes/updates it. --include-title records the window title in the frame; off by default because a prompt often sets it to a host and path. |
Colors accept ansi-256 (9), hex (#ff0000), or rgb (255,0,0).
Recording, monitor & self-docs
| Command | Description |
record start OUT [options] | Start APNG, GIF, MP4, or asciicast recording; --zoom N scales image/video output. |
record stop | Finish the active recording. |
get-recording [session] | Print the always-on asciinema v2 cast (works even after the session stopped). |
monitor | Watch the session live, full-color, in another terminal. |
usage / agent-context / skill | Self-documentation (see top of guide). |
Workflow: run a command and check the result
tui-test open # start a shell session
tui-test submit "echo hello" # type text + Enter
tui-test wait command # block until the command finishes
tui-test expect text "hello" # assert it appeared (exit 1 if not)
tui-test expect exit-code 0 # assert the command succeeded
tui-test closesubmit types text then presses Enter; type types without Enter; key press
simulates key presses (key press Escape : w q Enter, key press Ctrl+C);
key down and key up simulate explicit keydown and keyup events, and
key repeat sends repeat events.
Workflow: drive a TUI program
tui-test run vim file.txt
tui-test wait idle # let the screen finish rendering
tui-test key press i # enter insert mode
tui-test type "some text"
tui-test key press Escape : w q Enter # save and quit
tui-test wait exitWorkflow: mouse interaction
tui-test mouse click --on-text "OK" # click a label, no coordinates needed
tui-test mouse click 10 5 --clicks 2 # double-click at column 10, row 5
tui-test mouse scroll down --amount 5 # scroll the wheel
tui-test mouse drag 2 2 20 2 # drag from (2,2) to (20,2)Workflow: assert colors
tui-test cells 0 0 10 1 # inspect char/fg/bg/flags
tui-test expect text "ERROR" --fg "#ff0000" # text present AND red
tui-test expect text "OK" --fg 2 --bg 0 # ansi-256 fg/bg
tui-test expect text "plain" --fg default # asserts the cell set no colorWorkflow: snapshot testing
tui-test expect snapshot main-view -u # create/update the snapshot
tui-test expect snapshot main-view # later: assert it still matches
tui-test expect snapshot main-view --include-colors # also compare per-cell colorsSnapshots live in __snapshots__/<NAME>.snap next to where you run the command.
Waiting: pick the right one
wait text "T": waits until text/regex is visible. The most precise wait; use it whenever you know what output to look for.--notwaits for it to disappear.wait command: waits until the current command finishes, via the shell's OSC integration markers. Use it aftersubmit. Without shell integration it falls back to "screen idle". Bump--timeoutfor long commands (default 30s).wait idle: waits until the screen stops repainting. This tracks visual quiescence, not completion: a silent command likesleep 100counts as idle almost immediately. Use it to let a TUI finish drawing.wait exit: waits until the program/session itself exits. Use forrun <program>sessions or after sendingexit.wait ready: waits until the shell reports a ready prompt.opendoes this for you.
Recording
Every session records automatically from the moment it opens, in asciinema v2
cast format, stored in your XDG cache by session name. The path is reported in
the open / run response. Recordings persist after the session ends; stale
ones are swept when a daemon next starts (recordings of still-running sessions
are kept).
tui-test get-recording > demo.cast # current session's recording to stdout
tui-test get-recording work > w.cast # a specific session by name (even if stopped)Record a selected span directly to APNG, GIF, MP4, or cast:
tui-test record start demo.png --zoom 0.5
tui-test submit "echo hello"
tui-test wait command
tui-test record stopAPNG, GIF, and MP4 render at 2x pixel density. --zoom multiplies the output
dimensions without changing the rows or columns; --zoom 0.5 produces a 1x
export. Resize events change the terminal window size inside a centered,
opaque canvas sized for the recording's largest frame. Use --fps, --speed,
and --idle-time-limit to tune playback. .cast output does not use zoom and
interoperates with the asciicast ecosystem without adding any GPL dependency
to tui-test. If a process exits before record stop, an APNG/GIF/MP4 capture
remains beside the target as OUT.tui-test.cast.
Live monitor
Watch a session live in a second terminal while an agent drives it; both share
the same daemon. monitor takes over an alternate screen and streams the
session in full color at ~20fps. Press q, Esc, or Ctrl-C to detach.
tui-test --session work monitor # watch the 'work' session liveIt needs an interactive terminal (exit 2 otherwise) and an existing session
(exit 3 if none). It only reads shared screen state, so watching never blocks
the commands the agent runs; resizing the window re-fits the frame.
This works only with standalone CLI sessions.
Programmatic use (Rust, Python, and JavaScript)
The Rust crate and the Python and JavaScript packages run the terminal engine in-process. Session names, registries, and recordings are process-local. A native session cannot be listed, attached to, controlled, or monitored from another process, including by the standalone CLI.
These programmatic APIs do not install or require the tui-test CLI. Only
the standalone CLI uses the daemon and JSON-over-local-socket protocol
described elsewhere in this guide.
Node is the supported JavaScript runtime. Bun and Deno compatibility is best
effort and does not gate releases. Deno requires a local node_modules
directory and --allow-ffi in addition to read/write permissions.
cargo add tui-test # Rust 1.88+
pip install tui-test # Python 3.8+, imported as `tui_test`
npm install @microsoft/tui-test # Node 20+ (ESM only)
bun add @microsoft/tui-test # Bun (best effort)
deno add npm:@microsoft/tui-test # Deno 2 (best effort)Rust:
use tui_test::{OpenOptions, Operation, Session};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let session = Session::new(format!("rust-example-{}", std::process::id()));
session.open(OpenOptions::default())?;
session.execute(Operation::Submit {
data: Some("echo hello".into()),
})?;
session.execute(Operation::WaitCommand {
timeout_ms: Some(30_000),
})?;
session.execute(Operation::ExpectText {
text: "hello".into(),
regex: false,
full: false,
strict: false,
not: false,
fg: None,
bg: None,
timeout_ms: Some(5_000),
})?;
session.execute(Operation::ExpectExitCode {
code: 0,
timeout_ms: Some(5_000),
})?;
session.close()?;
Ok(())
}Python:
import asyncio
from tui_test import TuiTest
async def main():
async with TuiTest() as su: # closes the session on exit
await su.open()
await su.submit("echo hello")
await su.wait_command()
await su.expect_text("hello", strict=False) # command echo + output both match
await su.expect_exit_code(0)
asyncio.run(main())Node (the same API may work on Bun and Deno):
import { TuiTest } from "@microsoft/tui-test";
const su = new TuiTest();
await su.open();
await su.submit("echo hello");
await su.waitCommand();
await su.expectText("hello", { strict: false });
await su.expectExitCode(0);
await su.close();The Rust crate exposes Session and SessionRegistry for terminal ownership,
plus the Operation and OperationResult enums for the command surface.
Python and JavaScript methods mirror the cli commands: open / run, submit
/ type / write, keyboard.press|down|repeat|up, compatibility
press,
mouse.click|move|down|up|drag|scroll,
resize, signal / kill, state, text, cells, the dedicated
get_command / get_output / get_exit_code / get_cwd / get_cursor /
get_size / get_title / get_bell_count / get_bell_events methods,
screenshot, start_recording / stop_recording, wait_text / wait_title / wait_idle / wait_command /
wait_exit / wait_ready / wait_bell, expect_text / expect_title /
expect_exit_code / expect_output / expect_bell_count / expect_snapshot,
and close. Python module-level helpers are sessions,
close_all, and get_recording; JavaScript exports sessions, closeAll,
and getRecording. The JavaScript client otherwise uses the same names in
camelCase (startRecording, stopRecording, waitCommand, expectText,
getExitCode, etc.).
The constructors accept a session name plus backend, profile, timeout, and
artifact options: TuiTest(session="default", *, backend=None, timeouts=None,
profile=None, artifacts=None) in Python and new TuiTest(session?, {
backend?, profile?, timeouts?, artifacts? }) in JavaScript. run takes the
program then its arguments
(await su.run("vim", "file.txt") in Python, await su.run("vim",
["file.txt"]) in JavaScript).
Python and JavaScript failures raise typed errors instead of returning exit
codes, one class per row of the applicable exit-code table:
ExpectationError (1), UsageError (2), NoSessionError (3), and
InternalError (5), all subclasses of TuiTestError.
Terminal backends
open and run accept --backend alacritty|ghostty|rio; Alacritty is the
default. The Python and JavaScript constructors accept the same canonical
strings as a client default, and each open/run can override it.
tui-test open --backend ghostty
tui-test run --backend rio -- vim file.txtEvery enabled backend satisfies the same cell-grid contract. Ghostty preserves the blink attribute, while Alacritty and Rio cannot report it. Command boundaries, exit codes, cwd, and captured command output are parsed separately from the raw PTY stream, so switching emulators does not change shell integration behavior.
Configuration
tui-test.toml holds named profiles; --profile NAME selects one and
--config PATH picks the file. Looked up nearest first: ./tui-test.toml
then the platform config directory ($XDG_CONFIG_HOME/tui-test/tui-test.toml
on Unix), then ~/.tui-test/tui-test.toml. No discovered file is fine;
--config and TUI_TEST_CONFIG are explicit and error when their path is
missing.
[profiles.ci]
scrollback = 500
[profiles.ci.timeouts]
text = 15000
ready = 60000
[profiles.ci.colors]
red = "#ff0000"A profile sets timeout defaults, scrollback (default 10000), and colors:
foreground, background, cursor, and the 16 ANSI slots by name (red,
bright_red, ...). Indices 16-255 are spec-defined and not configurable, so
--fg 196 is stable across profiles. Unknown settings and invalid colors are
rejected before a session starts.
Named profiles do not inherit from [profiles.default]; omitted fields use
tui-test's built-in defaults. The in-process APIs accept profile objects:
Rust passes Profile directly, Python uses Profile / Colors, and
JavaScript uses { scrollback, colors }. A profile can be a client default or
a per-open / per-run override. The bindings do not load tui-test.toml.
The palette is what a screenshot paints and what expect --fg/--bg matches
a #rrggbb against, so the two always agree.
Programs can also set and query colours at runtime with OSC 4/10/11/12 and
reset them with OSC 104/110/111/112. A query is answered with the colour
currently showing; a reset restores the profile's colour, which no escape
sequence can change. Note that a program setting a colour also changes what a
screenshot of that session looks like.
Supported shells & integration
open --shell S accepts: bash, zsh, fish, powershell, pwsh, cmd,
xonsh, elvish, nushell. Omit --shell to use the platform default.
tui-test injects shell integration (standard OSC 133 semantic-prompt markers,
plus OSC 7 for cwd) so it can track command boundaries, exit codes, cwd, and
command/output text across shells. This is what powers wait command,
expect exit-code, get cwd, and get command|output.
Integration coverage varies by shell: powershell has no native pre-exec hook
so command/output text is best-effort (exit code and cwd still track); cmd is
prompt-only.
Debugging
By default the daemon writes no log. Start it with --verbose to record every
byte read from and written to the PTY, plus lifecycle events, to
~/.tui-test/<session>.log. Logging is fixed when the daemon starts, so enable
it on a fresh daemon (close any existing one first):
tui-test --session work close # stop any existing daemon
tui-test --session work --verbose open # start one with logging on
tui-test --session work submit "ls"
cat ~/.tui-test/work.logtui-test daemon status reports the active log path.
Stuck session? If the screen is frozen and input seems ignored (e.g. after
git log / git diff), a full-screen pager such as less is likely holding the
terminal, and Ctrl+C won't quit it. Confirm with tui-test state
("ready": false and a stale last command). Quit the pager with
tui-test key press q, or avoid it with git --no-pager <cmd> or
GIT_PAGER=cat.
Platform note. On Windows ConPTY, get output and get command text can on some rare occasions be
unreliable due to screen repainting; grid-based checks (expect text,
expect exit-code) are unaffected. ConPTY also gives a session a window title
before anything runs (the program's path, e.g. C:\Program Files\Git\bin\bash.EXE),
where a unix PTY starts with none, so treat get title on a fresh session as
platform-dependent and assert on a title only after a program sets one.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

