Console.Lib.Inspector
5.42.3191
See the version list below for details.
{ "inputs": [ { "type": "promptString", "id": "CONSOLE_INSPECTOR_GROUP", "description": "Discovery multicast group override." }, { "type": "promptString", "id": "CONSOLE_INSPECTOR_PORT", "description": "Discovery multicast port override." }, { "type": "promptString", "id": "group", "description": "Discovery multicast group (default 239.255.77.91)." }, { "type": "promptString", "id": "port", "description": "Discovery multicast port (default 47892)." } ], "servers": { "Console.Lib.Inspector": { "type": "stdio", "command": "dnx", "args": ["Console.Lib.Inspector@5.42.3191+557c1cd12b6d6d12148fa084fa99ba21620acb58", "--yes", "--", "--group", "${input:group}", "--port", "${input:port}"], "env": { "CONSOLE_INSPECTOR_GROUP": "${input:CONSOLE_INSPECTOR_GROUP}", "CONSOLE_INSPECTOR_PORT": "${input:CONSOLE_INSPECTOR_PORT}" } } } }
.vscode/mcp.json settings file.
dotnet tool install --global Console.Lib.Inspector --version 5.42.3191
dotnet new tool-manifest
dotnet tool install --local Console.Lib.Inspector --version 5.42.3191
#tool dotnet:?package=Console.Lib.Inspector&version=5.42.3191
nuke :add-package Console.Lib.Inspector --version 5.42.3191
Console.Lib
A .NET library for building terminal applications with dock-based layouts, widgets, mouse/keyboard input, VT styling, and Sixel graphics rendering. AOT-compatible, targeting .NET 10.
This repo also ships mdcat — a cat-for-Markdown CLI built on the library (see below).
Features
- Dock-based layout — top/bottom/left/right/fill panels that recompute on terminal resize, built on DIR.Lib's surface-neutral
DockLayout<T>engine - Cell-surface layout —
CellLayoutpaints DIR.Lib's arrangedLayoutNodetrees (the same ones the pixel painter uses) to character cells, with click-region hit-testing - Widget system —
TextBar,TextInputBar,TextArea,ScrollableList<T>,TreeView<T>,Canvas<TSurface>,MarkdownWidget,MenuWidget - Sixel graphics — high-performance encoder (14× faster than ImageMagick's built-in Sixel writer); plus Unicode sextant and half-block fallbacks for terminals without Sixel
- VT styling —
VtStylewith 16-color SGR and TrueColor modes, automatic capability detection;StreamColorcolours a CLI's plain stdout or stderr (off when redirected or underNO_COLOR, Windows VT switched on per stream) - Markdown + LaTeX rendering — headings, tables, lists, fenced code, inline
[text]{color}syntax, OSC 8 hyperlinks for clickable links, inline + display math (\(...\),$$...$$,\[...\]),\ce{...}chemistry markup, and images (rasterized to Sixel / blocks, with alt-text fallback). Parsing is driven by LALR.CC grammars in DIR.Lib.Markdown; Console.Lib is the VT-output layer.MarkdownOutputwrites it to a CLI's standard output as mdcat does, with anOutputFormat(auto,rich,markdown,plain) for an--output-formatoption. - Input handling — unified keyboard + mouse events with UTF-8 codepoint decoding, SGR mouse tracking in alternate screen
- Menu system — arrow-key navigation, digit shortcuts, mouse support, alternate/normal mode
- Cross-platform — Windows VT I/O via Win32, native VT100 on Unix/macOS
Quick start
dotnet add package Console.Lib
var terminal = new VirtualTerminal();
await terminal.InitAsync();
terminal.EnterAlternateScreen();
var panel = new Panel(terminal);
var statusBar = new TextBar(panel.Dock(DockStyle.Bottom, 1));
var main = panel.Fill();
statusBar.Text(" Ready").Style(new VtStyle(SgrColor.BrightWhite, SgrColor.BrightBlack)).Render();
mdcat — cat for Markdown
mdcat is a tiny CLI that renders a Markdown file (or stdin) to styled terminal
output using Console.Lib's MarkdownRenderer — headings, bold/italic, lists, tables,
fenced code, OSC 8 hyperlinks, LaTeX math, and local images (Sixel / sextant /
half-block, auto-detected). Color support is auto-detected, with a richer GitHub-Dark
palette on truecolor terminals.
dotnet tool install --global mdcat # .NET global tool (needs the .NET 10 runtime)
mdcat README.md # render a file
cat notes.md | mdcat - # render from stdin
Prebuilt, self-contained native-AOT binaries (no runtime required) for Linux / Windows /
macOS on x64 and arm64 are on the Releases
page. See src/MdCat/README.md for all options, install methods,
exit codes, and math-font details.
Building
dotnet build src/Console.Lib
dotnet test src/Console.Lib.Tests
dotnet run --project src/MdCat -- README.md # build & run the mdcat CLI in place
Debug builds (Console.Lib.Debug)
ConsoleDebugInspector (the live inspector the Console.Lib.Inspector MCP sidecar drives) ships in the Release
Console.Lib too, from 5.27. It is inert: set DIR_INSPECTOR=1 and DIR_INSPECTOR_TOKEN=<a secret> in the app's
environment to start it, and run the sidecar with the same DIR_INSPECTOR_TOKEN, which it sends with every request.
With them unset nothing listens, and DIR_INSPECTOR=1 without a token refuses to start.
A trimmed or NativeAOT published app has no inspector at all unless it was published with
-p:DirInspectorSupport=true (DIR.Lib's feature switch, DebugInspectorCore.IsSupported): the default publish drops
the verbs and the command server, and DIR_INSPECTOR=1 then only prints one trimmed out of this build line on stderr.
tools/inspector-aot-probe is the proof.
Console.Lib.Debug is the same library at the same version, built Debug, and it depends on DIR.Lib.Debug; other
#if DEBUG types are only in it. Reference one or the other by configuration (Visual Studio needs a
restore after switching):
<ItemGroup Condition="'$(Configuration)' == 'Debug'">
<PackageReference Include="Console.Lib.Debug" Version="5.12.*" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' != 'Debug'">
<PackageReference Include="Console.Lib" Version="5.12.*" />
</ItemGroup>
Documentation
See src/Console.Lib/README.md for the full API reference, architecture diagram, and detailed usage guide.
License
| 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 |
|---|---|---|
| 5.45.3321 | 40 | 12/3/2026 |
| 5.44.3291 | 39 | 12/3/2026 |
| 5.43.3241 | 42 | 12/2/2026 |
| 5.42.3191 | 40 | 12/2/2026 |
| 5.41.3151 | 42 | 12/2/2026 |
| 5.40.3111 | 45 | 12/1/2026 |
| 5.39.3071 | 43 | 11/29/2026 |
| 5.38.3031 | 46 | 11/24/2026 |
| 5.37.3001 | 48 | 11/20/2026 |
| 5.37.2981 | 43 | 11/20/2026 |
| 5.36.2961 | 49 | 11/20/2026 |
| 5.35.2941 | 49 | 11/18/2026 |
| 5.34.2921 | 52 | 11/17/2026 |
| 5.33.2901 | 52 | 11/17/2026 |
| 5.32.2871 | 47 | 11/16/2026 |
| 5.31.2861 | 34 | 11/16/2026 |
| 5.30.2841 | 37 | 11/16/2026 |
| 5.29.2821 | 42 | 11/16/2026 |
| 5.28.2801 | 45 | 11/16/2026 |
| 5.27.2781 | 53 | 11/16/2026 |