runemarkv0.10.0

CASOON Open Source

One way for your CLI tools to talk.

runemark renders status lines, reports, error blocks and file-change previews with one colour policy: TTY-aware, NO_COLOR-compliant, plain when redirected. The crate and the npm package share the same Rust renderer.

cargo add runemark
npm install @casoon/runemark
MITcrates.ionpmRust 1.85+Node 20+
A terminal running cargo run --example hero_demo --features progress: a progress bar fills as four pages are audited, then a site audit report appears with its metrics, two accessibility findings and a next step.
required dependency (unicode-width)
1
prebuilt Node platforms
5
minimum Rust version
1.85
ecosystems, one renderer
2

What it does

How it renders

One report, any width

Reports adapt to the terminal they're given, not to a fixed layout. Pass a known width and narrow terminals stack summary metrics and wrap finding messages with a hanging indent instead of truncating.

  • Verdict symbols survive NO_COLOR. A tone disappears without color; the verdict's own symbol does not — a failing metric still reads as failing piped to a file.
  • Compact or detailed, same data. The host CLI chooses detailLevel; runemark never asks for two separate report shapes. Compact output says how many findings it left out, and your tool words the pointer to the rest.
  • Determinism by construction. Identical input always walks the same path — no timing-dependent output, so fixtures can be committed and diffed.
44 columns
⚠ Content audit

  Errors: 0
  Warnings: 4 (+2)
  Score: 94/100 (+5%)

● Navigation (2)
  - The main navigation contains more links
    than can be reached comfortably with a
    keyboard [ux/nav-size]
  - Two landmarks share the label "Menu", so
    screen reader users cannot tell them
    apart [a11y/landmark-label]

Generated at build time

All examples →
⚠ Site audit v1.2.0
  Scope warnings: History partial, 1 file skipped

  Errors: 0   Warnings: 4 (+2)   Score: 94/100 (+5%)

● Accessibility violations (2)
  - [QUICK WIN] Image missing alt attribute [a11y/img-alt] (high confidence)
    at 
    Remedy: Add an alt="…" description to the <img> tag.
  - Low contrast ratio on hero button [a11y/contrast]
    at 

Next steps:
  • Run the auto-fixer for formatting issues
    $ audit --fix

These terminals and the ones in the showcase are rendered by @casoon/runemark during the build – the same renderer as the crate. Only the animation at the top is a recording, of the hero_demo example.

site/src/showcase.ts

Quickstart

Three steps from install to consistent output. The full walkthrough lives in the documentation.

  1. Add the crate or the npm package to your command-line tool.
  2. Pick a colour mode – Auto is right for most tools.
  3. Pass your own data to semantic lines, reports, error blocks or diffs.
main.rsRust
use runemark::{ColorMode, Console, Tone, Verdict};

let console = Console::stdout(ColorMode::Auto);

println!("{}", console.paint(Tone::Title, "site audit"));
println!("{}", Verdict::Warning.render(console, "3 findings need review"));
println!("{}", console.paint(Tone::Muted, "Run with --details for every finding."));
audit.cjsNode
const { RunemarkConsole, renderReport } = require('@casoon/runemark')

const console = new RunemarkConsole({ color: 'auto' })
console.writeWarning('3 findings need review')

process.stdout.write(renderReport({
  schemaVersion: 1,
  title: 'Site audit',
  verdict: 'warning',
}, { width: process.stdout.columns }))

New in v0.10.0

Changelog →

Frequently asked questions

Do the Rust crate and the Node package produce identical output?

Yes. The npm package wraps the same Rust renderer through a native addon — there is one presentation layer, not a port kept in sync by hand.

Does runemark work on Windows?

Semantic output, color policy, reports and progress do. The optional select menu talks to the terminal directly through termios and is Unix-only — on Windows it reports Outcome::Unavailable and the caller falls back to render().

What does output look like under NO_COLOR or when piped to a file?

Plain and deterministic. Tones disappear, but a verdict's own symbol stays, so a failing metric still reads as failing without color.

How do I test the output of my CLI?

Render with ColorMode::Never for deterministic text, or strip the escape sequences from a coloured string with strip_ansi. assert_plain_snapshot! compares the plain result against an expected block, and the Node package renders the same bytes.

Can I turn off symbols or hyperlinks without turning off colour?

Yes. Colour, the symbol set and OSC 8 hyperlinks follow one decision by default and can each be overridden: Console::with_theme chooses Unicode or ASCII symbols, Console::with_hyperlinks switches links.

Does runemark parse my CLI arguments or define my report data?

No. It owns terminal presentation only — color policy, layout, semantic tones. Argument parsing, configuration, domain finding types and output formats like JSON or SARIF stay yours.

Consistent CLI output in three steps.

Read the quickstart