CLI Reference
This page is the readable entrypoint for the commands most users should learn first. For complete live behavior, run mdkg --help and command-specific help in your installed version.
Core commands
Section titled “Core commands”mdkg init --agentinitializes repo-local project memory for human and agent workflows.mdkg indexrebuilds local search and capability caches.mdkg statusinspects repo, package, graph, selected-goal, cache, and project DB health.mdkg newcreates graph nodes and workflow files.mdkg showinspects a node.mdkg searchfinds graph nodes.mdkg goalmanages long-running objectives and active work routing.mdkg taskstarts, updates, and completes task-like work nodes.mdkg packbuilds deterministic context for a work node.mdkg handoff createcreates copy-ready agent handoffs.mdkg validatevalidates graph integrity and warning categories.mdkg skillmanages repo-local agent skills and mirrors.mdkg fixplans and applies selected repairs, including ID repair.
Git lifecycle commands
Section titled “Git lifecycle commands”Use mdkg git when an agent run needs low-level Git lifecycle receipts around a
repo-backed mdkg checkpoint. The command family uses the system Git CLI;
authentication stays external through SSH, credential helpers, gh, CI/runtime
environment, or existing shell state. mdkg records sanitized refs, hashes,
policy names, and receipts rather than credentials or provider payloads.
mdkg git inspect --jsonreports the current repo, remotes, working-tree state, source descriptor, accepted commit, and tree hash.mdkg git materialize --request materialize-request.json --jsonverifies a strict request, exact commit and optional tree, then atomically publishes a contained source with a bounded receipt. See Verified Git materialization.mdkg git clone <repository-ref> --target <path> --branch <name> --jsonclones a real Git remote into an explicit contained target.mdkg git fetch --remote origin --branch main --jsonfetches an explicit remote and branch through system Git.mdkg git closeout --jsonvalidates mdkg state and writes static JSON and Markdown closeout receipts. When project DB state participated, closeout also seals SQLite snapshot evidence and writes a deterministic dump.mdkg git push-ready --remote origin --branch main --jsonis read-only and requires explicit remote/branch, a clean worktree, passing mdkg validation, credential-safe remote configuration, and required DB snapshot evidence.mdkg git push --remote origin --branch main --stage-all --message "agent checkpoint" --jsonwrites closeout evidence, stages changes, commits, reruns push readiness, and pushes only after the caller or runtime has approved the real remote update.
Advanced alpha commands
Section titled “Advanced alpha commands”The CLI also includes advanced graph, archive, bundle, subgraph, project DB queue, MCP, workflow mirror, and graph movement commands. Treat those surfaces as public alpha and validate them in your repo before depending on them.
Use these docs next:
- Read-only MCP
- Verified Git materialization
- Subgraphs and bundles
- Graph movement
- Demo graphs
- Project DB and queues
Maintainers can refresh this reference from the command contract with:
npm run docs:generatenpm run docs:checkFor integration metadata, see dist/command-contract.json in the mdkg repository.
v0.5.2 · Pre-v1 public alpha
Command reference for v0.5.2
Confirm the installed version, then use command help for the exact local contract.
mdkg --version
mdkg help <command>