cli

software/cli · 0 open · 12 done

Small, clean, complete. A real --help (stdout, exit 0), a shared IO helper, README + CMake reconciled (codecs in core), stale binaries cleared, and convert/pack/unpack/compose/overlay all covered. 54/54 assertions green.

cli_11test.sh is red: a stale markdown assertion aborts the whole suite under set -eDone HIGH
bug · tests

Resolved 2026-06-20. The md->prisma codec emits nameless headings (def heading { ... }) after the anonymous-elements change; test.sh still asserted the old def heading "0" form, so it failed under set -e and aborted the whole suite. The assertion now checks the nameless form. The suite is green again: 25/25 assertions pass.

cli_2`convert --from`/`--to` argument parsing is untestedDone MED
task · tests

Resolved 2026-06-20. Added convert tests: --from json over a misleading .txt, --to prism, and exit-2 paths for unknown --from/--to, wrong positional counts, unknown flags.

cli_12`compose` and `overlay` subcommands have zero test coverageDone MED
task · tests

Resolved 2026-06-20. Added compose (flatten a real reference, missing-file, too-many-args) and overlay (later-wins override, missing base/layer, no-layer) tests.

cli_3`pack`/`unpack` error paths and `.prisma`-text bundles untestedDone MED
task · tests

Resolved 2026-06-20. Added a .prisma-text bundle round-trip plus pack/unpack error paths (regular file, non-bundle, unparseable, dotfiles-only).

cli_4README is stale: duplicate format name, missing compose/overlay/pack docs, wrong dependency claimDone LOW
task · organization

Resolved 2026-06-20. README fixed: real format names, compose/overlay synopsis + sections, core-only dependency; CMake dropped the bogus separate codecs requirement.

cli_5stale renamed binaries left in build/Done LOW
task · organization

Resolved 2026-06-20. build.sh now clears its product + stale prism/prisma binaries first; build/ holds only kinogaki.

cli_6no real `--help`; usage goes to stderr with exit 2 for any unrecognized commandDone LOW
bug · completeness

Resolved 2026-06-20. Added --help/-h/help printing usage to stdout with exit 0 via a shared printUsage(FILE*); the error path still goes to stderr with exit 2.

cli_7readFile/writeFile duplicated across translation unitsDone LOW
task · completeness

Resolved 2026-06-20. Hoisted readFile/writeFile into a shared src/Io.{h,cpp}; removed the duplicates from main.cpp and Pack.cpp.

cli_1usage string format-name drift fixedDone LOW
bug · completeness

Where: src/main.cpp:66

Resolution: The usage text now reads fmt = prisma | prism | json | markdown | html | svg | text | blob, exactly matching codecByName (Codecs.cpp:74-83) and codecName (Codecs.cpp:59-72). The earlier self-contradicting kinogaki value is gone, and the genuinely-valid prism name is advertised. Verified convert in out --from prism and --from prisma both parse; --from kinogaki correctly errors with exit 2. (The README at line 9 still has the old duplicated list — tracked under cli_4.) The stray comment at main.cpp:6 still says (prisma | kinogaki | text | blob), but that is an internal comment, not user-facing.

cli_8separation: cleanDone LOW
task · separation

Where: src/main.cpp, src/Pack.h/.cpp, kinogaki/Codecs.h

Why clean: Argument parsing and subcommand dispatch live in main.cpp (the convert flag loop at main.cpp:184-200); format/codec policy is wholly behind core's Codecs.h (decode/encode/codecByName/codecForPath), so the CLI hardcodes no format logic; bundle filesystem recursion is isolated in Pack.cpp (packInto/unpackInto); compose/overlay delegate straight to core (composeFile, overlay). The command bodies (cmdCheck, cmdConvert, cmdPack, cmdUnpack, cmdCompose, cmdOverlay) are thin and each owns one job. No business logic leaks into main.

Fix: none.

cli_9naming: cleanDone LOW
task · naming

Where: all CLI source

Why clean: Public/command functions read as verbs: readFile, writeFile, usage, cmdCheck/cmdConvert/cmdPack/cmdUnpack/cmdCompose/cmdOverlay, looksNative, looksBinary, packInto, unpackInto, sortedEntries, endsWith. The noun-named codecName/codecForPath/codecByName (from core) are conventional getters/lookups, not actions, so they are acceptable. No misleading or ambiguous names.

Fix: none.

cli_10filesize: cleanDone LOW
task · filesize

Where: all CLI source

Why clean: Largest source file is src/main.cpp at 203 lines; Pack.cpp is 112 and Pack.h is 13 (328 total). All files are far under the 1000-line threshold. No file flagged.

Fix: none.