Expand description
Subcommand implementations. Each top-level command is its own module.
Dispatch lives in main.rs; business logic lives in library
crates; this module is the thin presentation shim.
Modules§
- add
mkit add <path>/mkit add .— stage a file (or the whole worktree) into.mkit/index.add -padditionally stages individual hunks interactively (seerun_patch).- attest
mkit attest— produce a signed DSSE attestation for a commit.- attest_
factory - Factory helpers for building a
Signerfrom CLI / config inputs. - bisect
mkit bisect start|good|bad|reset|skip— binary-search a history for the commit that introduced a regression. Backing state + search logic live inmkit_core::ops::bisect.- blame
mkit blame <file>— line-level attribution against HEAD.- branch
mkit branch— list / create / delete branches.- cat
mkit cat <hash>— decode and print an object by its hash.- cat_
file mkit cat-file (-t | -s | -p) <object>— inspect an object, likegit cat-file.- checkout
mkit checkout <branch>— switch HEAD to a branch and materialise the branch tip’s tree into the working directory.- cherry_
pick mkit cherry-pick <commit> | --continue | --abort— replay a single commit onto HEAD, with a resolvable-conflict workflow (#177).- clean
mkit clean— remove untracked files from the worktree (likegit clean).- clone
mkit clone <url> [<dir>]— initialise a new repo and pull from the URL. The destination defaults to the final path segment of the URL when<dir>is omitted.- commit
mkit commit— build a signed commit object from the staging index.- config_
cmd mkit config— show or set values.- conflict
- Shared CLI helpers for the resolvable-conflict workflow (#177).
- diff
mkit diff— show changes as a unified patch.- fetch
mkit fetch [<remote>]— likepullbut does NOT move HEAD. Downloads every object reachable from each remote ref and updates therefs/remotes/<remote>/<name>tracking refs.- for_
each_ ref mkit for-each-ref [--format=<fmt>] [<pattern>...]— iterate refs with an optional format string, likegit for-each-ref.- gc
mkit gc— reclaim unreachable objects (mark-and-sweep prune).- hash_
cmd mkit hash <file>— hash a file as a blob, store it, print the hash.- init
mkit init— create a fresh repository rooted at the current dir.- key
mkit keykeystore management commands.- keygen
mkit keygen— generate a fresh signing key for one of the three attestation algorithms.- log
mkit log [<rev>] [<A>..<B> | <A>...<B>]— walk commit history.- ls_
files mkit ls-files [-s] [-z] [--others] [--ignored] [--exclude-standard]— list files in the index or untracked worktree files, likegit ls-files.- ls_tree
mkit ls-tree [-r] [-z] <tree-ish> [<path>...]— list the entries of a tree, likegit ls-tree.- mcp
mkit mcp— a local Model Context Protocol server over stdio.- merge
mkit merge <branch> | --continue | --abort— merge a branch into HEAD, with a resolvable-conflict workflow (#177).- mv
mkit mv <source>... <dest>— move or rename tracked paths, staging the change (likegit mv).- pull
mkit pull [<remote>]— fetch refs from the configured remote (named, or the flat default) and fast-forward the current branch.- push
mkit push— push refs/packs to a remote with CAS safety.- rebase
mkit rebase [-i] <revspec> | --continue | --abort | --skip— replay commits onto a different base. The target is resolved through the shared revspec resolver, so a branch, tag,HEAD~n, or full/short hash all work.- reflog
mkit reflog [<ref>]— read-only view over the persisted ref-history journal (issue #231).- remote
mkit remote— show / add / set the configured remote.- reset
mkit reset [--soft|--mixed] [<commit>]— move the current branch (or detached HEAD) to<commit>, optionally resetting the index.- restore
mkit restore [--staged] [--worktree] [--source <rev>] [-f] <path>...— discard worktree changes for path(s), or unstage them.- rev_
parse mkit rev-parse [--verify] [--short[=N]] [--abbrev-ref] [--show-toplevel] [<rev>...]— resolve revisions to object ids, likegit rev-parse.- revert
mkit revert <commit> | --continue | --abort— create a new commit that undoes a previous commit, with the resolvable-conflict workflow.- revspec
- Shared revision-spec resolver (issue #227, parent #226).
- rm
mkit rm <pathspec>...— remove paths from the worktree and stage the deletion for the next commit.- serve
mkit serve <path>— speak the mkit-rpc SSH protocol on stdin/stdout against a local repository.- show
mkit show [<object>...]— display objects (defaultHEAD).- show_
ref mkit show-ref [--heads] [--tags]— list refs as<hash> <refname>, likegit show-ref. Output is sorted by full ref name; the hash is a 64-hex BLAKE3 id (vs git’s 40-hex SHA-1).- sparse_
checkout mkit sparse-checkout set|list|disable|reapply— manage the sparse checkout pattern set at.mkit/sparse-checkout. Pattern parsing + tree-materialisation live inmkit_core::ops::restore.- stash
mkit stash save|list|pop|drop|show— stash working-directory changes. Backing logic lives inmkit_core::ops::stash.- status
mkit status— show working-tree changes relative to HEAD.- symbolic_
ref mkit symbolic-ref [--short] <name> [<ref>]— read or write a symbolic ref (currently onlyHEAD), likegit symbolic-ref.- tag
mkit tag— list / create / delete tags.- tree
mkit tree— snapshot the working directory as a tree object, printing the resulting tree hash.- update_
ref mkit update-ref [-d] <ref> [<newvalue> [<oldvalue>]]— low-level guarded ref write/delete, likegit update-ref.- verify
mkit verify <rev>— verify the signature on a commit, remix, or signed tag.- verify_
attest mkit verify-attest— verify every attestation attached to a commit.
Constants§
- WORKTREE_
LOCK - Basename of the repo-level lock that serialises worktree/index
read-modify-write commands (
add,rm,commit,merge,checkout,rebase,cherry-pick,stash,sparse-checkout).
Functions§
- acquire_
worktree_ lock - Acquire the shared worktree/index lock for the repo rooted at
root. - ensure_
restore_ safe - Refuse a destructive restore when the index/worktree contains user work.
- ensure_
restore_ safe_ with_ options - Refuse a destructive restore when affected index/worktree paths contain user work.
- head_
branch_ name - Current branch name for recovery logging — empty for a detached HEAD or an unreadable/symbolic-only HEAD.
- not_
yet_ ported - Shared helper: emit a “not yet wired” notice and return the tempfail exit code. Commands whose backing state-machines haven’t been wired into the CLI yet say so honestly rather than pretending to work.
- open_
store_ configured - Open the object store for a mutating command, honoring the repo’s
configured durability schedule (
durability.objects, seecrate::config::Config::object_sync_policy). Falls back to the batched default when the config cannot be read — a broken config must not change write semantics silently, and Batch is the default contract. - read_
or_ seed_ index_ from_ head - Read the index, seeding an absent/empty one from HEAD when possible.
- record_
superseded - Record
superseded(the old branch tip a history-rewriting op is about to replace) in the recovery log somkit gckeeps it recoverable. - restore_
worktree_ and_ index - Materialise
tree_hashand align the index while preserving.mkitignoreentries. - sync_
index_ to_ tree - Rewrite
.mkit/indexso it exactly mirrorstree_hash. - usage_
error - Shared helper: print a usage error and return the USAGE exit code.
- write_
ref_ recording_ history - CLI-side ref-write helper that records every advance in the
branch’s history MMR when
history-mmris enabled.