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 runemarknpm install @casoon/runemark⚠ 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
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.
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.
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.
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.tsQuickstart
Three steps from install to consistent output. The full walkthrough lives in the documentation.
- Add the crate or the npm package to your command-line tool.
- Pick a colour mode –
Autois right for most tools. - Pass your own data to semantic lines, reports, error blocks or diffs.
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."));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 }))