Hex1b.Tool
0.172.0
dotnet tool install --global Hex1b.Tool --version 0.172.0
dotnet new tool-manifest
dotnet tool install --local Hex1b.Tool --version 0.172.0
#tool dotnet:?package=Hex1b.Tool&version=0.172.0
nuke :add-package Hex1b.Tool --version 0.172.0
Hex1b.Tool
A command-line tool for managing and interacting with Hex1b terminal applications. Provides terminal hosting, screen capture, input injection, widget tree inspection, session recording, and more.
Installation
Install as a .NET global tool:
dotnet tool install -g Hex1b.Tool
This makes the hex1b command available system-wide. Alternatively, install as a local tool in your project:
dotnet tool install Hex1b.Tool
Then invoke with dotnet hex1b.
Quick Start
Connect to a running app
Any Hex1b application that uses .WithDiagnostics() is automatically discoverable:
# List all discoverable terminals
hex1b terminal list
# Attach to a terminal (interactive TUI mirror)
hex1b terminal attach <id>
# Take a screenshot
hex1b capture screenshot <id>
Start a hosted terminal
Start new terminal sessions that host shell commands:
# Start the default interactive shell
# (PowerShell on Windows, bash on Linux/macOS)
hex1b terminal start
# Start with custom dimensions
hex1b terminal start --width 120 --height 40 -- htop
# Start and immediately attach
hex1b terminal start --attach -- vim
Commands
terminal — Manage terminal sessions
| Command | Description |
|---|---|
terminal list |
List all discoverable terminals |
terminal start |
Start a hosted terminal session |
terminal stop |
Stop a hosted terminal |
terminal info |
Show terminal metadata and details |
terminal attach |
Attach to a terminal with an interactive TUI mirror |
terminal resize |
Resize terminal dimensions |
terminal clean |
Remove stale diagnostic sockets |
capture — Screenshots and recordings
| Command | Description |
|---|---|
capture screenshot |
Capture terminal screen (text, ANSI, SVG, HTML, or PNG) |
capture recording start |
Begin recording a session to a .cast file |
capture recording stop |
Stop an active recording |
capture recording status |
Check recording status |
capture recording playback |
Play back a .cast recording |
keys — Send keyboard input
hex1b keys <id> --text "hello world"
hex1b keys <id> --key Enter
hex1b keys <id> --key Tab --ctrl
mouse — Send mouse input
| Command | Description |
|---|---|
mouse click |
Click at coordinates |
mouse drag |
Drag between coordinates |
app — Inspect widget trees
| Command | Description |
|---|---|
app tree |
Show the widget/node tree of a running application |
assert — Validate terminal content
Assert on terminal content for scripting and CI:
hex1b assert <id> --text-present "Ready" --timeout 10
hex1b assert <id> --text-absent "Error"
agent — AI agent integration
| Command | Description |
|---|---|
agent init |
Generate a skill file for AI coding agents |
agent mcp |
Start an MCP server |
Global Options
| Option | Description |
|---|---|
--json |
Output results as JSON for scripting |
Making Your App Discoverable
For the CLI to find your application, call .WithDiagnostics() on your terminal builder:
using Hex1b;
await using var terminal = Hex1bTerminal.CreateBuilder()
.WithHex1bApp((app, options) => ctx =>
ctx.Text("Hello from Hex1b!"))
.WithDiagnostics()
.Build();
await terminal.RunAsync();
Scripting and CI
The CLI is designed for scriptability. Use --json for machine-readable output and assert for CI checks:
hex1b terminal start -- ./my-app
hex1b assert abc --text-present "Welcome" --timeout 30
hex1b keys abc --text "admin"
hex1b keys abc --key Enter
hex1b assert abc --text-present "Dashboard"
hex1b capture screenshot abc --format svg --output result.svg
hex1b capture screenshot abc --format png --output result.png
hex1b terminal stop abc
Requirements
- .NET 10.0 or later
- Windows, Linux, or macOS
Documentation
- CLI Guide — Getting started and use cases
- CLI Reference — Complete command reference
- GitHub Repository
License
MIT — See LICENSE file in the repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.172.0 | 3,064 | 9/27/2026 |
| 0.172.0-beta.1788.1.f01b043 | 51 | 9/27/2026 |
| 0.172.0-alpha.1787.1.f01b043 | 1,292 | 9/26/2026 |
| 0.172.0-alpha.1785.1.d253961 | 466 | 9/25/2026 |
| 0.172.0-alpha.1654.1.f826137 | 479 | 9/25/2026 |
| 0.172.0-alpha.1652.1.6a01c54 | 50 | 9/22/2026 |
| 0.172.0-alpha.1650.1.2df4512 | 49 | 9/22/2026 |
| 0.171.0 | 2,673 | 9/22/2026 |
| 0.170.0 | 90 | 9/21/2026 |
| 0.170.0-alpha.1620.1.85e091a | 49 | 9/21/2026 |
| 0.170.0-alpha.1616.1.6221fe4 | 56 | 9/21/2026 |
| 0.169.1 | 89 | 9/21/2026 |
| 0.169.1-beta.1619.1.ce890db | 51 | 9/21/2026 |
| 0.169.0 | 1,586 | 9/20/2026 |
| 0.169.0-beta.1611.1.c1a7c2d | 60 | 9/20/2026 |
| 0.169.0-alpha.1608.1.d6a20d4 | 52 | 9/19/2026 |
| 0.169.0-alpha.1597.1.365795a | 57 | 9/19/2026 |
| 0.168.0 | 86 | 9/16/2026 |
| 0.168.0-beta.1592.1.d87cce1 | 55 | 9/16/2026 |
| 0.168.0-alpha.1588.1.cb3cf27 | 63 | 9/16/2026 |