Skip to main content
← Back to list
01Issue
FeatureTriagedSwamp CLI
Assigneesstack72

#346 Add a markdown output mode to `swamp report get`

Opened by bixu · 5/13/2026

Problem

swamp report get <name> --workflow <wf> produces output that uses terminal box-drawing characters and ANSI color escape codes. This is great for interactive terminal viewing, but it does not render as markdown:

  • Saving the output to a .md file produces something that looks broken in any markdown editor (GitHub PR body, Zed, VS Code preview, Obsidian, etc.) — the box-drawing characters and ANSI escapes show up as literal characters.
  • Pasting into a GitHub PR comment or Linear ticket shows the raw escape sequences rather than rendered tables.
  • --json is structured but requires hand-rewriting the markdown — every consumer ends up writing the same little render-tables-as-markdown script (we just did this in hivemq-terraform-harvester/scripts/render_kernel_cve_reports.py).

The report content (sections, summary lines, table rows) is already structured and rendered nicely — only the encoding of the tables and color is the gap.

Proposed solution

Add a --markdown flag (or --format markdown) to swamp report get that emits the same report content but with:

  • Markdown pipe-table syntax (| col1 | col2 | + | --- | --- | separators) instead of box-drawing characters
  • No ANSI escape sequences
  • Same section headings, summary lines, and table contents as the default output

So today's:

swamp report get @hivemq/kernel-cve-copy-fail --workflow kernel-cve-audit-dev

…would become, with the new flag:

swamp report get @hivemq/kernel-cve-copy-fail --workflow kernel-cve-audit-dev --markdown > report.md

…and report.md would open cleanly in any markdown renderer.

Alternatives considered

  1. Post-process the default output — strip ANSI escapes and translate box-drawing to pipes. Fragile (encoding-dependent, no clean way to detect column boundaries) and every consumer reinvents it.
  2. Build markdown from --json — works (we did this) but requires rebuilding every section heading, summary line, and table layout by hand for each report shape.
  3. A separate swamp report render subcommand — fine, but a flag on the existing command is the smallest surface change.

Why this matters

Reports are the canonical way to share security audit / compliance / cost / inventory output with humans, and "share with humans" today usually means GitHub, Linear, Slack, or a markdown file in a wiki — all of which speak markdown natively and none of which speak ANSI/box-drawing.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNEDCLASSIFICATION

Triaged

5/13/2026, 3:35:38 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack725/13/2026, 3:33:14 PM
Editable. Press Enter to edit.

bixu commented 5/13/2026, 12:23:31 PM

Agent inadvertently duplicated 345

Sign in to post a ripple.