/dotnet:cli-e2e-testingfrom dotnet
Creates, debugs, and reviews end-to-end tests for CLI tools using Hex1b terminal automation with PTY-backed child processes, keyboard input, and terminal screen inspection.
Ships in dotnet. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this skill when a CLI test must exercise the real executable through a terminal-like environment instead of calling internal APIs or redirecting standard input/output.
Hex1b is a good fit when tests need any of these:
bash, zsh, pwsh, or the CLI itself.Avoid Hex1b for simple non-interactive commands where ProcessStartInfo with redirected output is enough.
Hex1bTerminal with:
WithHeadless()WithPtyProcess(...) for the shell or CLI process under testWithAsciinemaRecording(...) writing to a per-test .cast fileHex1bTerminalAutomator.finally.using Hex1b;
using Hex1b.Automation;
using Hex1b.Input;
await using var terminal = Hex1bTerminal.CreateBuilder()
.WithHeadless()
.WithDimensions(160, 80)
.WithPtyProcess(options =>
{
options.FileName = "/bin/bash";
options.Arguments = ["--noprofile", "--norc", "-i"];
options.WorkingDirectory = workspace;
options.Environment = new Dictionary<string, string>
{
["TERM"] = "xterm-256color",
["PATH"] = testBin + Path.PathSeparator + (Environment.GetEnvironmentVariable("PATH") ?? "")
};
})
.WithAsciinemaRecording(
recordingPath,
new AsciinemaRecorderOptions
{
Title = "my-cli end-to-end test",
Command = "my-cli",
IdleTimeLimit = 1
})
.Build();
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(90));
var runTask = terminal.RunAsync(cts.Token);
var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(30));
try
{
await auto.TypeAsync("my-cli --dry-run; printf '\\n__DONE:%s__\\n' \"$?\"");
await auto.EnterAsync();
await auto.WaitUntilTextAsync("__DONE:0__", timeout: TimeSpan.FromSeconds(60));
using var snapshot = auto.CreateSnapshot();
string screen = snapshot.GetScreenText();
Assert.Contains("Expected output", screen, StringComparison.Ordinal);
}
finally
{
await auto.TypeAsync("exit");
await auto.EnterAsync();
await runTask.WaitAsync(TimeSpan.FromSeconds(5));
}
Make Hex1b asciinema recordings a standard artifact for terminal e2e tests. This gives reviewers a visual playback of what happened without changing the CLI tool under test.
Recording guidelines:
TestResults/recordings directory.ITestOutputHelper.CaptureInput disabled unless a test explicitly needs to review typed input. It is disabled by default.IdleTimeLimit to compress long pauses in playback.Example recording path helper:
static string CreateRecordingPath(string testName)
{
string recordingDirectory = Path.Combine(ProjectDirectory, "TestResults", "recordings");
_ = Directory.CreateDirectory(recordingDirectory);
return Path.Combine(recordingDirectory, $"{testName}-{Guid.NewGuid():N}.cast");
}
Visual verification:
asciinema play tests/MyCli.LiveTests/TestResults/recordings/MyTest-abc123.cast
For CI, upload TestResults/recordings/*.cast as test artifacts so failures can be replayed locally.
Prefer deterministic waits over sleeps:
await auto.WaitUntilTextAsync("Select an option");
await auto.WaitUntilAsync(
snapshot => snapshot.ContainsText("Ready") && !snapshot.ContainsText("Loading"),
timeout: TimeSpan.FromSeconds(30),
description: "CLI to finish loading");
Use a unique command-completion sentinel when driving a shell:
my-cli args; printf '\n__DONE:%s__\n' "$?"
Wait for __DONE:0__ for success. If testing failures, wait for the expected non-zero sentinel.
Wait for the prompt/list before sending input:
await auto.WaitUntilTextAsync("select which to apply:");
await auto.LeftAsync();
await auto.WaitUntilTextAsync("[ ] first-item");
await auto.EnterAsync();
Useful automator methods:
TypeAsync("text")EnterAsync()UpAsync(), DownAsync(), LeftAsync(), RightAsync()SpaceAsync()EscapeAsync()Ctrl().KeyAsync(Hex1bKey.C)After keyboard input that changes the UI, wait for a visible result before continuing.
Keep e2e tests deterministic:
bin directory and prepending it to PATH.Assert both terminal output and side effects:
Use GetScreenText() for visible terminal contents. If important output can scroll out of view, use larger fixed dimensions, add a sentinel near the end, or assert side effects and inspect the Hex1b recording.
Hex1b automation failures include step history and terminal snapshots. Make wait descriptions specific enough to identify the failed phase.
When diagnosing a failing test:
.cast recording to see the terminal flow exactly as the test saw it.PATH, HOME/config variables, and working directory.WaitUntilTextAsync or WaitUntilAsync.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/dotnet-livecharts2LiveCharts2 development guide — installation, XAML source generator integration, theme config, gotchas, and sample index with exact repo file paths. Use when implementing any LiveCharts2 chart (line, area, bar, pie, gauge, heatmap, scatter, polar, financial). Covers all platforms (WinUI, Uno, Avalonia, MAUI, WPF, Blazor, WinForms, Eto)./dotnet-modern-csharp-editorconfigDrop-in opinionated .editorconfig for modern C# (C# 14 on .NET 10, also works with C# 10–13) that enforces concise, readable code leveraging the latest language features. Use when setting up code-style rules, naming conventions, formatting, and preview analyzer severities for a new or existing .NET repo. Also covers the required .csproj flags (Nullable, TreatWarningsAsErrors, AnalysisLevel=preview-All, EnforceCodeStyleInBuild) and the .NET 8 vs .NET 9+ build-respect-editorconfig distinction. Generated by the `mcs-editorconfig` template./dotnet-refactoringWhat a green build does not check when C# code is refactored. Use when renaming, moving, extracting, inlining, merging or deduplicating C# / .NET code. Covers names read at runtime, edits to text that only looks like a reference, behavior drift while deduplicating, generated and partial code, and targets the default build skips.npx claudepluginhub vincenth-net/dotnet-agentic-engineering --plugin dotnetOther plugins' skills for the same job