CLI substrate package
State: open/verified · Kind: module · Audience: system
Summary
Section titled “Summary”@sksizer/cli-toolsupplies what a standalone CLI needs before it does anything of its own: an injectable stdout/stderr output seam, one exit-code rule, flags declared once so the parser and help text cannot disagree, project/machine config, and running an installed tool from a development checkout.- One package with four subpath exports (
.,./config,./devlink,./trust), formed by merging the priordevlinkandtoolconfigpackages plus a new substrate entry, per D-LLJY-cli-tool-substrate and S-0015-standalone-cli-shape.
Statement
Section titled “Statement”A standalone CLI in this repo needs the same four things every time: somewhere to write output that a test can capture instead of monkeypatching a global, one rule for what an exit code means (0 ok, 1 state failure, 2 usage error, 10-63 the tool’s own outcomes), flags declared once so the parser and its help text stay in sync, and a way to read its config and run a dev checkout in place of the installed version. This package is that substrate, consumed by seven-plus standalone CLIs (sdlc, waypost, repo-cleaner, detect-runners, agent-dev, manifest-graph, obsidian-bases) instead of each hand-rolling its own copy.
What it provides
Section titled “What it provides”CliIo/processIo/captureIooutput seam andCliContext(io, cwd, env) so commands never touch process globals directlyEXITconstants and the 0/1/2/10-63 exit-code banddefineCli— a commander-backed flag declaration builder with two-tier help (short +--all) and typedparse()resultsrunMainbin shim: setsprocess.exitCodeinstead of callingprocess.exit, catches thrown errors as one stderr line./config: project/machine config files and thepaths:token map./devlink: resolving and running a development checkout in place of an installed tool, with link history./trust: per-repository consent to run that repository’s own scripts, remembered across runs
Underlying implementation
Section titled “Underlying implementation”- packages/ts/cli-tool/ (package root, four subpath exports)
- D-LLJY-cli-tool-substrate — the merge decision
- S-0015-standalone-cli-shape — the shape standard this package enforces
Locations
Section titled “Locations”packages/ts/cli-tool/packages/ts/cli-tool/define-cli.tspackages/ts/cli-tool/run-main.tspackages/ts/cli-tool/exit.tspackages/ts/cli-tool/io.tspackages/ts/cli-tool/config/packages/ts/cli-tool/devlink/packages/ts/cli-tool/trust/packages/rust/cli-config/