Skip to content

CLI substrate package

State: open/verified · Kind: module · Audience: system

  • @sksizer/cli-tool supplies 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 prior devlink and toolconfig packages plus a new substrate entry, per D-LLJY-cli-tool-substrate and S-0015-standalone-cli-shape.

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.

  • CliIo/processIo/captureIo output seam and CliContext (io, cwd, env) so commands never touch process globals directly
  • EXIT constants and the 0/1/2/10-63 exit-code band
  • defineCli — a commander-backed flag declaration builder with two-tier help (short + --all) and typed parse() results
  • runMain bin shim: sets process.exitCode instead of calling process.exit, catches thrown errors as one stderr line
  • ./config: project/machine config files and the paths: 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
  • 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
  • packages/ts/cli-tool/
  • packages/ts/cli-tool/define-cli.ts
  • packages/ts/cli-tool/run-main.ts
  • packages/ts/cli-tool/exit.ts
  • packages/ts/cli-tool/io.ts
  • packages/ts/cli-tool/config/
  • packages/ts/cli-tool/devlink/
  • packages/ts/cli-tool/trust/
  • packages/rust/cli-config/

← Back to Capabilities