@tttinkl/codemaps-viewer
v0.2.0
Published
Local viewer + parser-backed validator for task-driven call-path-slice codemaps. Ships the `codemap-viewer` CLI with `serve` and `validate` subcommands.
Downloads
214
Maintainers
Readme
@tttinkl/codemaps-viewer
Local viewer + parser-backed validator for codemaps — task-driven
call-path-slice documentation files (.codemaps/<slug>.md).
Ships the codemap-viewer CLI with two subcommands: a local web viewer
(Cytoscape graph + source preview) and a validate mode that emits
machine-readable diagnostics for SKILL / CI repair loops.
Part of the codemaps-skill project.
Install
Run on demand with no install:
npx -y @tttinkl/codemaps-viewer # → starts the viewer at :4676
npx -y @tttinkl/codemaps-viewer validate FILEOr install globally:
pnpm add -g @tttinkl/codemaps-viewer
codemap-viewer --helpRequires Node ≥ 20.
Subcommands
serve (default)
Start the local viewer over HTTP. Defaults to scanning ./.codemaps on
port 4676 (auto-increments on EADDRINUSE).
codemap-viewer # ./.codemaps, port 4676
codemap-viewer serve --dir docs/codemaps # custom directory
codemap-viewer serve --port 5000 # custom portOpen http://localhost:4676 to browse the codemaps in your project.
v0.2 live freshness: the viewer auto-detects when referenced source files change. The browser opens a Server-Sent Events stream to /api/freshness/stream; once a source file is edited, the badge on the list row and detail page flips to stale-changed (or stale-missing on delete) within ~1 second — no manual refresh. The watcher fails silently if it cannot start (e.g. inotify limits), degrading to the v0.1.x request-time computation. Ctrl+C triggers a graceful shutdown that stops the watcher before exiting.
validate <file|->
Parse a codemap file (or stdin) against the
@tttinkl/codemaps-parser
schema and print a single diagnostic on failure.
codemap-viewer validate .codemaps/login-flow.md
echo "$markdown" | codemap-viewer validate -Exit codes: 0 valid · 1 schema violation · 2 IO / usage error.
Diagnostic output (stderr, on exit 1):
.codemaps/foo.md:22:1 - error: Invalid codemap: duplicate code node id "1a" in section 1 (also defined as "1a")
22 | - **1a** dup — `b.ts:1`
| ^
hint: pick the next unused letter (a..z) within this sectionDesigned for the SKILL repair loop: the LLM that generated the file pipes its in-memory markdown via stdin, parses the diagnostic line-by-line, edits, and re-validates — typically converging in 1–2 attempts.
License
MIT © lisilu
