Skip to main content

Crate mkit_cli

Crate mkit_cli 

Source
Expand description

§mkit-cli

The mkit command-line tool: a content-addressed VCS with native attestation support. The published binary is mkit.

Published to crates.io so cargo install mkit-cli works; it also ships as a signed binary via GitHub Release archives (see docs/INSTALL.md). The crate is exposed as a library (mkit_cli::…) purely so integration tests can drive commands in-process without shelling out — that surface is not a stable API, is excluded from cargo-semver-checks, and should not be depended on. Depend on the mkit-core / mkit-attest / mkit-transport-* crates instead.

§Optional features

Most are off by default to keep the baseline build lean:

FeatureAdds
enc-transportmkit+enc:// dispatch and mkit serve --listen-enc (SPEC-TRANSPORT-ENC §6).
http-transportmkit serve --http — self-hosted mkit.transport.v1.TransportService Connect remote over axum (SPEC-TRANSPORT-CONNECT, issue #700).
git-bridge (alias git-export)mkit git … (SPEC-GIT-BRIDGE/SPEC-GIT-IMPORT).
sparse-checkoutVerifiable sparse-checkout (issue #158).
pack-shardsmkit pack-shard <hash> and shard-aware HTTP/S3 downloads (issue #159).
history-mmrAppend-only Merkle Mountain Range ref-write journal (issue #157).
bls-thresholdBLS12-381 threshold-signing exhaustiveness (compile-time only today).

See the top-level README and docs/CLI.md for the full command reference and agent-integration notes (mkit mcp).

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 published to crates.io so cargo install mkit-cli works, but its library surface (mkit_cli::…) is unstable, exists only for in-process testing, and is deliberately excluded from cargo-semver-checks — do not depend on it as 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/config parser / writer and XDG path helpers.
editor
$EDITOR / $VISUAL spawn helper for mkit 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.
progress
Honest transfer-progress reporting for clone/push/pull/fetch (#711).
remote_dispatch
URL-scheme → Transport dispatch for mkit 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 a Ctrl-C aborts cleanly with exit::TEMPFAIL (75) rather than leaving a half-finished transfer.
sparse_cache
On-disk bitmap cache for verified sparse-checkout deliveries.
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 to std::process::exit.