feat(cli): add --markdown flag to swamp report get#1385
Conversation
Report output currently uses ANSI escape sequences and box-drawing characters that don't render in markdown editors, GitHub PRs, or wikis. Add a `--markdown` flag that emits clean markdown (pipe tables, ## headings, no ANSI) so reports can be pasted or redirected to .md files directly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
CLI UX Review
Blocking
None.
Suggestions
-
Metadata line formatting (
report_get.ts:84): The metadata line in markdown mode —${source} | Scope: ${r.reportScope} | v${r.version} | ${r.createdAt}— is unstyled prose after a##heading. On GitHub/Linear it may look a bit unpolished. A>blockquote prefix or_italic_wrap would give it a distinct metadata treatment. Entirely optional given the stated use-case is piping to a file. -
ISO timestamp in markdown output (
report_get.ts:84):createdAtemits a raw ISO string (2026-01-15T10:00:00.000Z). Fine for scripts, slightly noisy in human-read docs. No action needed.
Verdict
PASS — --markdown is well-named, properly conflicts with --json, has a clear example (> report.md), produces verified ANSI-free output, and follows the same renderer pattern as log/json modes. Skill documentation is clear and complete.
There was a problem hiding this comment.
Code Review
Clean, well-structured PR that adds a --markdown output mode to swamp report get.
Blocking Issues
None.
Suggestions
None — the implementation follows existing patterns closely:
- Import boundary: CLI command imports from
libswamp/mod.ts✓ - Renderer pattern:
MarkdownReportGetRendererfollows the same class + factory switch pattern asLogReportGetRendererandJsonReportGetRenderer✓ - Type safety:
ReportOutputMode = OutputMode | "markdown"cleanly extends the existing type, and the switch increateReportGetRendererremains exhaustive ✓ - Mutual exclusion:
conflicts: ["json"]follows the same Cliffy pattern used elsewhere (e.g.,extension_list.ts,issue_ripple.ts) ✓ - Tests: 4 new tests cover the key behaviors (no ANSI escapes, varySuffix presence/absence, workflow source) ✓
- Skill docs: Quick reference table and markdown mode paragraph added in the right places ✓
- Copyright headers: All files have AGPLv3 header ✓
- No security concerns: Boolean flag, no user input flows into dangerous paths ✓
Summary
Closes swamp-club#346.
--markdownflag toswamp report getthat emits clean markdown (pipe tables,##headings, no ANSI escapes or box-drawing) instead of terminal-formatted output--jsonvia Cliffy'sconflictsdeclarationrenderMarkdownPlain()function which was previously unusedswamp-reportskill to document the new flagTest Plan
deno check/deno lint/deno fmtpass--markdownproduces clean markdown with real report data--markdown --jsoncorrectly errors with conflict message🤖 Generated with Claude Code