runemark
Opinionated, human-readable terminal presentation for Rust and Node.js command-line tools.
Runemark gives related CLI tools one consistent way to communicate progress, status, findings, and next steps. It owns presentation conventions—not command parsing, logging, domain models, or machine-readable report formats.
Website and documentation: casoon.github.io/runemark
Status:
0.3is released on crates.io and npm. The API remains intentionally small while it is validated in real CLI tools.
What it provides
Most command-line tools start with a mix of println!, ANSI snippets, and a
progress bar. That works until the tool needs consistent CI output, color
policy, grouped findings, compact summaries, detailed mode, or actionable next
steps.
Runemark is the shared presentation layer for those concerns:
- Semantic output: success, warning, error, info, muted text, and headings.
- Predictable color policy: TTY-aware by default,
NO_COLORcompliant, with explicitalwaysandnevermodes. - Plain, deterministic output when redirected or snapshot-tested.
- Report models for verdicts, summary metrics, finding groups, and next steps.
- Actionable error blocks, file-change previews, and clickable locations for compatible terminals.
- Small core dependency footprint;
indicatifis optional for progress bars.
Install
Add the core presentation layer to a Rust project:
For Node.js 20 or newer, install the native package:
Quick start
use ;
let console = stdout;
println!;
println!;
println!;
ColorMode::Auto emits styles only to an interactive terminal and honours the
NO_COLOR convention. Use Always for a forced
colorful local experience or Never for tests and plain logs.
Reports
Build reports from application-owned data and choose compact or detailed rendering in the host CLI. Runemark never defines domain-specific finding or machine-report types.
use ;
let report = new.add_group;
print!;
Adaptive layout
Applications can provide a known terminal width without giving Runemark access to their terminal environment. Narrow layouts stack summary metrics and wrap finding messages with a hanging indent.
use ;
# let report = new;
let output = report.render_with_options;
Progress
The optional progress feature adds an indicatif-backed terminal progress
sink. Auto uses a compact, line-oriented lifecycle when output is redirected,
so machine-readable stdout remains clean.
use ;
use IsTerminal;
let progress = stderr;
progress.start;
progress.advance;
progress.finish;
Design boundaries
| Runemark owns | Applications own |
|---|---|
| Terminal color policy and semantic tones | CLI arguments and configuration |
| Compact human-readable report layout | Domain finding types and business rules |
| Detail level conventions and next-step blocks | JSON, SARIF, Markdown, HTML, and other artifacts |
| Line-oriented terminal presentation | Logging, tracing, prompts, and full-screen TUIs |
Roadmap
The initial API is deliberately narrow. Future additions are driven by real consumer needs rather than speculative abstractions:
- Validate the current API in real CLI tools before expanding it.
Examples
Run the Rust examples directly from this repository:
Node.js examples are in examples/node. Build the local native package once, then run an example:
Development
Run the complete local validation suite:
See CONTRIBUTING.md for API and contribution guidelines. See NODE_API.md for the stable Node.js package contract. The npm package includes its own README with Node.js examples.
License
Runemark is licensed under the MIT license (LICENSE).