runemarkv0.3.1

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.io 0.3.1npm 0.3.1Rust 1.85+Node 20+
site audit
⚠ Site audit v1.2.0

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

● Accessibility violations (2)
  - Image missing alt attribute [a11y/img-alt]
  - Low contrast ratio on hero button [a11y/contrast]

Next steps:
  • Run the auto-fixer for formatting issues
    $ audit --fix
required dependency (unicode-width)
1
prebuilt Node platforms
6
minimum Rust version
1.85
ecosystems, one renderer
2

What it does

  1. Semantic, not cosmetic

    Callers say what a line means – success, warning, error, a verdict, a finding. runemark decides how it looks, so related tools read the same.

  2. Predictable colour policy

    Auto emits styles only to an interactive terminal and honours NO_COLOR; Always and Never are explicit. Redirected output stays plain and deterministic.

  3. Reports that fit the terminal

    Compact or detailed, with metrics, grouped findings and next steps. Given a width, narrow layouts stack metrics and wrap messages with a hanging indent.

  4. Safe with untrusted text

    Control characters in messages, paths and URLs are neutralised; hyperlinks are only emitted for http and https targets.

Generated at build time

All examples →
⚠ Site audit v1.2.0

  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

Every terminal on this site is rendered by @casoon/runemark during the build – the same renderer as the crate. No screenshots.

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 }))