Expand description
mkit CLI crate, exposed as a library so integration tests can
drive commands in-process.
The binary is src/main.rs; everything else is a module here so
unit tests and integration tests can link without shelling out.
mkit-cli is explicitly publish = false — it is monorepo-internal
plumbing, not a stable API.
Modules§
- clap_
shim - Bridge between clap-derive command structs and mkit’s sysexits contract.
- cli
- CLI surface constants shared by the main dispatcher and the snapshot tests.
- commands
- Subcommand implementations. Each top-level command is its own module.
- config
.mkit/configparser / writer and XDG path helpers.- editor
$EDITOR/$VISUALspawn helper formkit commit.- exit
- sysexits(3)-style exit codes for the mkit CLI.
- format
- Human-oriented output formatters — the CLI’s thin presentation
layer. Anything that emits canonical on-disk or wire bytes belongs
in
mkit-core(serialize.rs,pack.rs, etc.), not here. - remote_
dispatch - URL-scheme →
Transportdispatch formkit push/mkit pull. - signal
- Signal handling — SIGINT / SIGTERM set a graceful-shutdown flag
that long-running operations (
push/pull/clone/log) poll at natural checkpoints, so aCtrl-Caborts cleanly withexit::TEMPFAIL(75) rather than leaving a half-finished transfer. - term
- Terminal helpers — ANSI color gating and POSIX getenv wrappers.
Functions§
- dispatch
- Dispatch a single argv invocation. Takes the full argv including
argv[0]. Returns the exit code the binary should pass tostd::process::exit.