Terminal.Gui.Cli 0.1.0-develop.3

This is a prerelease version of Terminal.Gui.Cli.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Terminal.Gui.Cli --version 0.1.0-develop.3
                    
NuGet\Install-Package Terminal.Gui.Cli -Version 0.1.0-develop.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Terminal.Gui.Cli" Version="0.1.0-develop.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Terminal.Gui.Cli" Version="0.1.0-develop.3" />
                    
Directory.Packages.props
<PackageReference Include="Terminal.Gui.Cli" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Terminal.Gui.Cli --version 0.1.0-develop.3
                    
#r "nuget: Terminal.Gui.Cli, 0.1.0-develop.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Terminal.Gui.Cli@0.1.0-develop.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Terminal.Gui.Cli&version=0.1.0-develop.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Terminal.Gui.Cli&version=0.1.0-develop.3&prerelease
                    
Install as a Cake Tool

Terminal.Gui.Cli

Terminal.Gui.Cli Example App

A .NET library that lets Terminal.Gui applications expose Views as scriptable CLI commands with typed JSON output, POSIX exit codes, and AI-agent discoverability.

Ships as a single NuGet package: Terminal.Gui.Cli.

What it does

Terminal.Gui.Cli provides a hosting layer (CliHost) that wires up:

  • CLI parsing — positional command dispatch, typed options, --initial pre-fill for input commands.
  • Structured output--json emits a versioned JsonEnvelope; --cat renders viewer content headlessly.
  • AI-agent discoverability--opencli emits machine-readable metadata; --agent-guide serves embedded Markdown guidance.
  • Built-in help--help renders command/option metadata via pluggable IHelpProvider.
  • Exit codes — deterministic POSIX exit codes from CommandResult status.

Command model

Kind Interface Description
Input ICliCommand<T> Launches a Terminal.Gui UI, returns a typed result.
Viewer IViewerCommand Displays content; supports --cat for headless rendering.

Commands register explicitly (no reflection scanning) and resolve by case-insensitive alias.

Quickstart

using Terminal.Gui.Cli;

CliHost host = new (options =>
{
    options.ApplicationName = "my-app";
    options.Version = "1.0.0";
});

host.Registry.Register (new MyCommand ());

return await host.RunAsync (args);
# Interactive (launches Terminal.Gui)
my-app greet --initial "World"

# JSON envelope
my-app greet --initial "World" --json

# Agent discovery
my-app --opencli
my-app agent-guide

# Headless viewer
my-app info --cat

Framework options

All commands inherit these options from the host:

Option Description
--help / -h Show help
--version Show version
--opencli Emit OpenCLI metadata JSON
--json Wrap output in JSON envelope
--initial <value> Pre-fill input value
--timeout <duration> Cancel after duration (e.g., 30s, 5m)
--output <path> / -o Write output to file
--cat Headless render (viewer commands only)

Repository layout

specs/        Constitution and library spec
src/          Terminal.Gui.Cli library
tests/        Unit, integration, and smoke tests
examples/     Example console app
scripts/      Tooling and recording scripts
docs/         Images and documentation assets

Build

Requires .NET 10 SDK. Solution file: Terminal.Gui.Cli.slnx.

dotnet restore Terminal.Gui.Cli.slnx
dotnet build   Terminal.Gui.Cli.slnx

# Tests
dotnet run --project tests/Terminal.Gui.Cli.Tests
dotnet run --project tests/Terminal.Gui.Cli.IntegrationTests
dotnet run --project tests/Terminal.Gui.Cli.SmokeTests

# Example app
dotnet run --project examples/Terminal.Gui.Cli.ExampleApp -- greet --initial "World" --json

Status

Alpha0.1.0-develop pre-release stream on the develop branch.

License

MIT; see LICENSE.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-develop.7 36 5/28/2026
0.1.0-develop.6 42 5/27/2026
0.1.0-develop.5 259 5/26/2026
0.1.0-develop.4 37 5/26/2026
0.1.0-develop.3 36 5/26/2026
0.1.0-develop.2 68 5/24/2026
0.1.0-develop.1 50 5/24/2026