RazorConsole.Cli
0.7.0
See the version list below for details.
dotnet tool install --global RazorConsole.Cli --version 0.7.0
dotnet new tool-manifest
dotnet tool install --local RazorConsole.Cli --version 0.7.0
#tool dotnet:?package=RazorConsole.Cli&version=0.7.0
nuke :add-package RazorConsole.Cli --version 0.7.0
RazorConsole.Cli
razorconsole drives RazorConsole apps from the command line. It starts an app in a pseudoterminal, presses keys and clicks, waits for the screen to reach a state, and reads the app's component tree, focus, route, errors and logs. Results can be JSON with fixed exit codes, for shell scripts, CI jobs and AI agents.
Install
dotnet tool install --global RazorConsole.Cli --prerelease
razorconsole doctor
Needs .NET 8 or newer. Sessions run in ConPTY on Windows 10 version 1809 or later, and in a POSIX PTY on Linux and macOS.
Each GitHub release also has a Native AOT build as razorconsole-<version>-<platform>.zip (Windows) or .tar.gz (Linux and macOS), for x64 and arm64. Unpack it and run razorconsole; it needs no .NET runtime of its own, though the apps it runs (--project, --dll) still do.
Use
razorconsole start demo --project ./MyApp # build, run, wait for the first frame
razorconsole wait --text "Welcome"
razorconsole tree --depth 2
razorconsole click --element hook:save # a real mouse click on the element
razorconsole assert --text "clicked: 1" # exit 1 if it does not hold
razorconsole screen
razorconsole stop
The terminal commands work with any program. The app commands (tree, find, inspect, focus, route, errors, logs, stats, and --element selectors) need the app's diagnostics endpoint, which a RazorConsole app registers only when its host environment is Development or its entry assembly is a Debug build. Release builds never do.
MCP server for AI agents
razorconsole mcp serves the same operations as an MCP server over stdio: tools for sessions, input, the screen, waits and asserts, and the app layer, resources for the sessions, screen and tree, and prompts for keyboard-accessibility and layout checks. It shares the session host with the command line, so an agent and a developer see the same sessions.
claude mcp add razorconsole -- razorconsole mcp
For VS Code, add {"servers":{"razorconsole":{"type":"stdio","command":"razorconsole","args":["mcp"]}}} to .vscode/mcp.json. Tool results are the --json output of the commands, a failed operation is a result with isError and the same error code, and long results are cut with a truncated marker. See the documentation for the tools and limits.
When an app crashes
A crash ends the app's process and its diagnostics endpoint with it, so errors and logs cannot be read afterwards. Every later command fails with exit 6 (process_exited), and the error carries the exit code, outputTail (the end of the terminal output as plain text, where .NET prints an unhandled exception) and lastErrors (the last errors the app reported before it went away). In text mode they are printed after the message.
Documentation
The full guide, with every command, the selectors, the JSON output and the exit codes: https://razorconsole.com/blog/cli/
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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 |
|---|---|---|
| 1.0.0-alpha.20261205-042216 | 0 | 12/5/2026 |
| 1.0.0-alpha.20261203-204736 | 52 | 12/3/2026 |
| 1.0.0-alpha.20261129-221008 | 84 | 11/29/2026 |
| 1.0.0-alpha.20261129-200106 | 72 | 11/29/2026 |
| 1.0.0-alpha.20261129-194142 | 82 | 11/29/2026 |
| 1.0.0-alpha.20261129-190152 | 71 | 11/29/2026 |
| 1.0.0-alpha.20261129-184041 | 73 | 11/29/2026 |
| 1.0.0-alpha.20261129-181928 | 77 | 11/29/2026 |
| 1.0.0-alpha.20261128-185002 | 69 | 11/28/2026 |
| 1.0.0-alpha.20261127-220721 | 65 | 11/27/2026 |
| 1.0.0-alpha.20261127-190100 | 64 | 11/27/2026 |
| 1.0.0-alpha.20261125-220642 | 76 | 11/25/2026 |
| 1.0.0-alpha.20261117-180734 | 84 | 11/17/2026 |
| 1.0.0-alpha.20261114-204534 | 69 | 11/14/2026 |
| 1.0.0-alpha.20261114-195449 | 68 | 11/14/2026 |
| 1.0.0-alpha.20261113-234942 | 69 | 11/13/2026 |
| 1.0.0-alpha.20261112-203431 | 77 | 11/12/2026 |
| 1.0.0-alpha.20261109-055639 | 70 | 11/9/2026 |
| 0.7.0 | 115 | 11/9/2026 |
| 0.7.0-alpha.20261109-024851 | 63 | 11/9/2026 |