tui-test

Ochiq manbalardan

💻 istalgan TUI ilova / CLI ni mashhur terminallarda boshqarish, yozib olish va sinash — terminalni AI uchun toʻliq ochiq qiladi

Mashina tarjimasi · Asl matnni koʻrsatish

💻 control, record, & test any tui app / cli with popular terminals - makes the terminal fully accessible to AI

AI skillKategoriya: AI koʻnikmalari · Dasturiy muhandislik · Testlash va QAOpen sourcemaʼlumot tekshirilgan: 15-okt, 2026

Sharh

  • ai-tools
  • alacritty
  • automation
  • bash
  • cli
  • e2e-testing
  • fish
  • ghostty
  • llm
  • powershell

Oʻrnatish

Buyruqlar faqat koʻrsatiladi, marketpleys ularni bajarmaydi. Rasmiy hujjatlar bilan solishtiring.

Moslik

«Nomaʼlum» dalil topilmaganini bildiradi, mahsulot mos emasligini emas.
PlatformaHolatArxitekturaDalilIshonchlilik
Claude CodeNomaʼlum———
Claude (web & desktop)Nomaʼlum———
OpenAI CodexNomaʼlum———
ChatGPTNomaʼlum———
CursorNomaʼlum———
GitHub CopilotNomaʼlum———
Gemini CLINomaʼlum———
WindowsMosx86_640.1.1 relizidagi rasmiy yigʻma: tui-test-native-0.1.1-x86_64-pc-windows-msvc.tar.gz0.70
macOSMosarm640.1.1 relizidagi rasmiy yigʻma: tui-test-aarch64-apple-darwin.tar.gz0.70
Mosx86_640.1.1 relizidagi rasmiy yigʻma: tui-test-native-0.1.1-x86_64-apple-darwin.tar.gz0.70
LinuxMosarm640.1.1 relizidagi rasmiy yigʻma: tui-test-aarch64-unknown-linux-gnu.tar.gz0.70
Mosx86_640.1.1 relizidagi rasmiy yigʻma: tui-test-native-0.1.1-x86_64-unknown-linux-gnu.tar.gz0.70

Relizlar

tekshirilgan: 29-okt, 2026
v0.1.1Oxirgi23-okt, 2026Rasmiy manba ↗

0.1.1 versiyasi fayllari

Marketpleys bu fayllarni saqlamaydi: yuklab olish rasmiy manbadan. Biz ularni skanerlamaganmiz.
FaylPlatformaHajmSHA-256Rasmiy manbadan yuklab olish
tui-test-aarch64-apple-darwin.tar.gzmacos · arm64 · tarball6,1 MBa6819562a180…Rasmiy manba ↗
tui-test-aarch64-unknown-linux-gnu.tar.gzlinux · arm64 · tarball6,5 MB99588dd2e296…Rasmiy manba ↗
tui-test-aarch64-unknown-linux-musl.tar.gzlinux · arm64 · tarball6,5 MBf041c826ebf2…Rasmiy manba ↗
tui-test-go-0.1.1.tar.gzNomaʼlum52,9 MBc3f518a709ee…Rasmiy manba ↗
tui-test-native-0.1.1-aarch64-apple-darwin.tar.gzmacos · arm64 · tarball7,2 MB9ad0aa5953d9…Rasmiy manba ↗
tui-test-native-0.1.1-aarch64-unknown-linux-gnu.tar.gzlinux · arm64 · tarball7,5 MBf8ccd5fe2c07…Rasmiy manba ↗
tui-test-native-0.1.1-aarch64-unknown-linux-musl.tar.gzlinux · arm64 · tarball7,5 MB92fa488c0b08…Rasmiy manba ↗
tui-test-native-0.1.1-x86_64-apple-darwin.tar.gzmacos · x86_64 · tarball7,4 MBaededdca63e3…Rasmiy manba ↗
tui-test-native-0.1.1-x86_64-pc-windows-msvc.tar.gzwindows · x86_64 · tarball7,7 MB510ab7ebd363…Rasmiy manba ↗
tui-test-native-0.1.1-x86_64-unknown-linux-gnu.tar.gzlinux · x86_64 · tarball7,8 MB55bec981a8d3…Rasmiy manba ↗
tui-test-native-0.1.1-x86_64-unknown-linux-musl.tar.gzlinux · x86_64 · tarball7,8 MB2a99f9366f78…Rasmiy manba ↗
tui-test-x86_64-apple-darwin.tar.gzmacos · x86_64 · tarball6,5 MB298ae3d37549…Rasmiy manba ↗
tui-test-x86_64-pc-windows-msvc.zipwindows · x86_64 · zip7,1 MB1dfdc80c6394…Rasmiy manba ↗
tui-test-x86_64-unknown-linux-gnu.tar.gzlinux · x86_64 · tarball6,9 MBae1f32afb34c…Rasmiy manba ↗
tui-test-x86_64-unknown-linux-musl.tar.gzlinux · x86_64 · tarball6,9 MB7bc4b706abac…Rasmiy manba ↗
tui-test-go-0.1.1.tar.gz.sha256nazorat summalari91 B210fca3ba326…Rasmiy manba ↗
tui-test-native-0.1.1-aarch64-apple-darwin.tar.gz.sha256nazorat summalari116 B9c1715d4e1d7…Rasmiy manba ↗
tui-test-native-0.1.1-aarch64-unknown-linux-gnu.tar.gz.sha256nazorat summalari121 B311dc5a243ab…Rasmiy manba ↗
tui-test-native-0.1.1-aarch64-unknown-linux-musl.tar.gz.sha256nazorat summalari122 Bdfbd1ff8ae30…Rasmiy manba ↗
tui-test-native-0.1.1-x86_64-apple-darwin.tar.gz.sha256nazorat summalari115 B3fb01dbdefc1…Rasmiy manba ↗
tui-test-native-0.1.1-x86_64-pc-windows-msvc.tar.gz.sha256nazorat summalari118 B5cd2a0035158…Rasmiy manba ↗
tui-test-native-0.1.1-x86_64-unknown-linux-gnu.tar.gz.sha256nazorat summalari120 B934411960395…Rasmiy manba ↗
tui-test-native-0.1.1-x86_64-unknown-linux-musl.tar.gz.sha256nazorat summalari121 B27af4f606ec0…Rasmiy manba ↗

Relizlar tarixi

Sifat profili

algoritm quality-v1.0 · baholangan 15-okt, 2026
Sifat bahosi91
Xavf bahosi0
Ishonchlilik 1.00
Sifat bahosi va xavf bahosi — turli koʻrsatkichlar. Yuqori sifat xavfsizlikni kafolatlamaydi.

Baho tarkibi

Qoʻllab-quvvatlash · 2020
last activity 0 days ago
Hujjatlar · 1515
README 15379 chars, description present
Foydalanishga tayyorlik · 1515
install instructions: yes; releases: yes
Metamaʼlumotlar · 108
3/4 of description, homepage, license, topics
Relizlar · 1010
10 release(s), latest 12 days ago
Kategoriya aniqligi · 108
classifier confidence 0.75
Ommaboplik · 106
287 stars (log-dampened, 10k = max)
Litsenziya aniqligi · 55
SPDX MIT
Hamjamiyat · 55
issues enabled, 27 forks

Litsenziya

MIT
Litsenziya maʼlumrepozitoriy xostingi maʼlumotlariga koʻra

Bu katalog siyosati holati, yuridik xulosa emas.

Manbalar

github.com/microsoft/tui-testAsosiy★ 287 yulduzfaollik: 15-okt, 2026Asosiy repozitoriy · Ishonchlilik 1.00

Sharhlar

Sharh yozish uchun kiring

Hali sharhlar yoʻq.

Muqobillar

README

microsoft/tui-test dan · litsenziya MIT · yuklangan 29-okt, 2026

tui-test

tui-test controls, inspects, tests, and records real shell sessions and full-screen terminal apps on Windows, Linux, and macOS. Use it from the CLI or call the same engine from Rust, Python, JavaScript, or Go. It works for AI agents that need structured access to terminal state, terminal automation, and terminal ui application testing.

Installation

CLI

Homebrew
brew tap microsoft/tui-test https://github.com/microsoft/tui-test
brew install tui-test
Install script

macOS and Linux:

curl --proto '=https' --tlsv1.2 -LsSf https://raw.githubusercontent.com/microsoft/tui-test/main/install/install.sh | sh

Windows:

irm https://raw.githubusercontent.com/microsoft/tui-test/main/install/install.ps1 | iex

You can also download a binary from GitHub Releases.

Libraries

LanguageInstallReference
Rust 1.90+cargo add tui-test-rs@0.1.1docs.rs
Python 3.8+pip install tui-testPython API
Node 20+npm install @microsoft/tui-testJavaScript API
Go 1.26+go get github.com/microsoft/tui-test/bindings/go@v0.1.1Go API

Add the Rust recording-raster feature for APNG, GIF, and MP4 output. It uses installed fonts; recording-font-jetbrains-mono* bundles a font.

Go, Python, and JavaScript use one native adapter crate. All three use its generated C ABI declarations through purego, ctypes, and Koffi, respectively. Set TUI_TEST_NATIVE_LIBRARY to select a matching library explicitly.

Quick start

The CLI and libraries expose the same terminal actions. Python, JavaScript, Rust, and Go sessions run in-process and do not require the CLI. Released Go modules include the native engine; see Go installation for supported platforms and Linux runtime requirements.

CLI

tui-test run my-app
tui-test expect text "Ready"
tui-test click text "Continue"
tui-test expect text "Done"
tui-test screenshot -o result.svg
tui-test close

Python

import asyncio
from tui_test import TuiTest

async def main():
    async with TuiTest.ephemeral() as terminal:
        await terminal.run("my-app")
        await terminal.get_by_text("Ready").expect()
        await terminal.get_by_text("Continue").click()
        await terminal.get_by_text("Done").expect()

asyncio.run(main())

Python API reference

JavaScript

import { TuiTest } from "@microsoft/tui-test";

const terminal = TuiTest.ephemeral();

try {
  await terminal.run("my-app");
  await terminal.getByText("Ready").expect();
  await terminal.getByText("Continue").click();
  await terminal.getByText("Done").expect();
} finally {
  await terminal.closeQuiet();
}

JavaScript API reference

Rust

use tui_test::{OpenOptions, Operation, Session};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let terminal = Session::new("example");
    terminal.open(OpenOptions::default())?;
    terminal.execute(Operation::Submit {
        data: Some("echo hello".into()),
    })?;
    terminal.get_by_text("hello").last().expect()?;
    terminal.close()?;
    Ok(())
}

Rust API reference

Go

package main

import (
    "log"

    "github.com/microsoft/tui-test/bindings/go"
)

func main() {
    terminal, err := tuitest.Ephemeral("example", tuitest.ClientOptions{})
    if err != nil {
        log.Fatal(err)
    }
    defer terminal.CloseQuiet()

    if _, err := terminal.Run("my-app", nil, tuitest.SpawnOptions{}); err != nil {
        log.Fatal(err)
    }
    if err := terminal.GetByText("Ready", tuitest.TextSelectorOptions{}).Expect(tuitest.LocatorExpectOptions{}); err != nil {
        log.Fatal(err)
    }
}

Go installation and API reference

API references

SurfaceReference
CLICLI reference
Rustdocs.rs
Pythonbindings/python/README.md
JavaScriptbindings/js/README.md
Gobindings/go/README.md

CLI reference

Global options

OptionDescription
--session NAMESelect a session. Default: default or TUI_TEST_SESSION.
--jsonPrint JSON.
--verbose, -vWrite a session log.
--failure-artifacts DIRWrite structured assertion artifacts.
--failure-artifact-mode MODESelect none, text, html, or all (default when exports are enabled).
--failure-artifact-recordingCopy the automatic cast through the failure boundary.
--diagnostic-context KEY=VALUEAdd safe caller context to failure details.

CLI sessions persist between commands. open and run reuse a live session unless --restart is set.

Sessions

CommandDescription
open [options]Open a shell.
run [options] PROGRAM [ARGS...]Run a program.
[global options] -- PROGRAM [ARGS...]Alias for run.
restart [--graceful-timeout MS]Restart the session.
sessionsList sessions.
close [--all]Close one or all sessions.
daemon startStart the session daemon.
daemon statusShow daemon status.
daemon stop [--all]Stop one or all daemons.

open and run accept --backend, --cols, --rows, --cwd, repeatable --env KEY=VALUE, --wait-ready, --no-wait-ready, --restart, --config, --profile, --timeout-<class> MS, and --screen-history-limit COUNT. open also accepts --shell.

Text locators

tui-test find text TEXT [options]
tui-test expect text TEXT [options]
tui-test click text TEXT [options]
tui-test highlight text TEXT [options]
CommandDescription
find textReturn current matches and cell spans.
expect textRetry until the locator passes.
click textRetry, then click the middle cell.
highlight textMark matches in screenshots and the live monitor.

Locator options:

OptionDescription
--regexTreat TEXT as a regular expression.
--fullInclude scrollback.
--whitespace exact|normalizeChoose whitespace matching.
--after-text TEXTSearch after an anchor.
--before-text TEXTSearch before an anchor.
--after-regex, --before-regexTreat the anchor as a regular expression.
--after-match MODE, --before-match MODESelect an anchor with any, unique, first, or last.
--after-nth N, --before-nth NSelect a zero-based anchor.
--match MODESelect any, unique, first, or last.
--nth NSelect a zero-based match.

Style options are --fg, --bg, --bold, --dim, --italic, --underline-style, --underline-color, --inverse, --hidden, --strikethrough, and --blink. Boolean styles accept =false.

--link URI separately requires every matched cell, including spaces, to have that OSC 8 target. --link "" requires no link.

Programmatic locators add getByLink() / get_by_link(), cell-set intersection and union (and/or in Rust and JavaScript, and_/or_ in Python), and locator-only filter containment. AND/OR form new contiguous per-row runs; filters preserve whole matches. See the JavaScript and Python composition examples.

expect text also accepts --not and --timeout MS. click text accepts --button left|middle|right, --alt, --ctrl, --shift, --clicks N, and --timeout MS. highlight text accepts --timeout MS.

Keyboard and mouse

CommandDescription
submit [TEXT]Type text and press Enter.
type TEXTType text.
write DATAWrite raw bytes.
key press KEYS...Press keys.
key down KEYS...Send keydown events.
key repeat KEYS...Send repeat events.
key up KEYS...Send keyup events.
mouse click [X Y] [options]Click a cell or --on-text TEXT.
mouse move X YMove the pointer.
mouse down X Y [options]Press a mouse button.
mouse up X Y [options]Release a mouse button.
mouse drag X1 Y1 X2 Y2 [options]Drag between cells.
mouse scroll up|down [--amount N]Send mouse wheel input to the application.
scroll up|down [LINES]Move the native history viewport; default: one row.
scroll top|bottomShow the oldest output or return to the live screen.
resize COLS ROWSResize the terminal.
signal INT|TERM|KILL|QUITSend a signal.
killKill the child process.

Mouse button actions accept --button left|middle|right, --alt, --ctrl, and --shift. Click also accepts --clicks N.

Named keys include arrows, Home, End, PageUp, PageDown, Insert, Delete, Backspace, Tab, Enter, Space, Escape, and F1 through F12. Join modifiers such as Ctrl, Alt, Shift, Super, Meta, or Hyper with +.

Read state

CommandDescription
statePrint session state and visible text.
text [--full]Print terminal text.
cells X Y [W H]Return cells and styles.
get commandReturn the last command.
get outputReturn the last command output.
get exit-codeReturn the last exit code.
get cwdReturn the working directory.
get cursorReturn the cursor position.
get viewportReturn the history offset and available rows.
get sizeReturn the terminal size.
get titleReturn the window title.
get clipboardReturn the session clipboard.
get bellsReturn the bell count.
get bell-eventsReturn bell events.

Native scrolling changes the visible viewport without mouse input to the application. New output preserves the historical view. Keyboard input returns to the live screen. Mouse input and historical locator clicks fail until you return to the live screen. Full-text reads remain independent of the viewport. See the history reference, JavaScript example, and Rust example.

Wait and assert

CommandDescription
wait title TEXT [--regex --not --timeout MS]Wait for a title.
wait clipboard [TEXT] [--regex --timeout MS]Wait for a clipboard change or match.
wait idle [--timeout MS]Wait for the screen to stop changing.
wait command [--timeout MS]Wait for a submitted command.
wait exit [--timeout MS]Wait for the program to exit.
wait ready [--timeout MS]Wait for a shell prompt.
wait bell [--timeout MS]Wait for a bell.
expect title TEXT [--regex --not --timeout MS]Assert the title.
expect exit-code CODE [--timeout MS]Assert the last exit code.
expect output TEXT [--regex]Assert command output.
expect bell COUNT [--timeout MS]Wait until the cumulative bell count reaches COUNT.
expect snapshot NAME [-u] [--include-style] [--include-title]Assert a snapshot.

Use wait command after submit, wait exit after run, and text locators for visible state. wait idle only means the screen stopped changing.

Timeout defaults:

ClassDefault
text5 seconds
idle5 seconds
command30 seconds
exit30 seconds
ready30 seconds

Capture

CommandDescription
screenshot [PATH] [-o PATH] [--full] [--zoom N] [--background COLOR | --transparent]Print text or save SVG or PNG.
record start PATH [options] [--background COLOR | --transparent]Start APNG, GIF, MP4, or asciinema recording.
record stopFinish the recording.
get-recording [SESSION] [--config PATH]Print the automatic asciinema recording.
monitor [--interactive]Watch a CLI session or send input with --interactive.

record start options: --format, --fps, --speed, --idle-time-limit, --zoom, --background, and --transparent. MP4 requires ffmpeg and does not support transparency. Cast recordings do not support canvas options.

The extension selects the format: .png or .apng, .gif, .mp4, or .cast. --format overrides it.

Record
inputmonitor

Diagnostics / trace viewer

Add the following to tui-test.toml to retain failed traces, or use mode = "on" to retain every trace.

[trace]
mode = "on-failure"
directory = "./traces"

Users can open trace.html to review the trace or replay session.cast. Agents should read trace.md first and use trace.json and timeline.json for structured evidence instead of parsing the HTML.

Configuration

Create tui-test.toml:

[profiles.default]
scrollback = 10000

[profiles.default.colors]
background = "#000000"
foreground = "#c0c0c0"
red = "#800000"

[recording]
directory = "./casts"

[trace]
mode = "on-failure"
directory = "./traces"

[diagnostics]
screen-history-limit = 10

Set the appearance of screenshots and recordings with [recording.style]:

[recording.style]
font_size = 18
canvas_background = "#05050a"
canvas_padding = 30

[recording.style.window]
background = "#15151f"
foreground = "#c8c8e0"
divider = "#2a2a3a"

[recording.style.border]
width = 1
color = "#3a3a52"
radius = 12

[profiles.default.colors]
background = "#0b0b12"
foreground = "#d8d8e8"

Profiles override individual keys and inherit the rest from the file. Failure SVGs and HTML report SVGs use the session style. See the style types and defaults for all options. The CLI reference explains profile overrides.

The CLI checks the current directory, the platform config directory, then ~/.tui-test. Use --config PATH or TUI_TEST_CONFIG to select a file.

Shells and backends

Shells: bash, zsh, fish, PowerShell, pwsh, cmd, xonsh, elvish, and nushell.

Backends: Alacritty, Ghostty, Rio, and xterm.js. Default: Alacritty.

Exit codes

CodeMeaning
0Success
1Wait or assertion failed
2Invalid usage
3No session
4Daemon or IPC error
5Internal error

Agent commands

CommandDescription
usagePrint a short command guide.
agent-contextPrint the full command schema as JSON.
skillPrint the complete agent guide.
skill --addInstall the agent skill and local references.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Repozitoriyni ochish ↗