Configure inputs for a command and run it with mmz ... as a prefix. mmz remembers the last successful run and skips further executions while those inputs remain unchanged.
For example, the demo project’s .mmz/config.yaml declares two commands and their inputs:
scopes:
data: ["data/*.json"]
bin: ["bin/*.sh"]
probes:
# jq's version is an input, but not a file.
jq-version:
run: jq --version
on_hit: "mmz: skipped {cache:command} (inputs unchanged)"
commands:
- name: ./bin/validate.sh
inputs: [data, bin, jq-version]
tags: [gate]
- name: ./bin/report.sh
inputs: [data, bin, jq-version]
outputs:
- out/report.txt
tags: [gate, report]Running mmz ./bin/validate.sh does the work:
validate: 4 orders, 2 customers OKRunning it again skips the command:
mmz: skipped ./bin/validate.sh (inputs unchanged)Then, you can put mmz --is-fresh --tag gate in your git pre-commit hook to refuse a commit when a gated check is out of date:
#!/usr/bin/env sh
# .git/hooks/pre-commit
mmz --is-fresh --tag gate || {
echo "run the gated checks first" >&2
exit 1
}No checks run during git commit, but you’re still covered.
See how it compares with other tools.
cargo install mmzQuickstart covers the prebuilt binaries, nix run, and scaffolding a manifest.
mmz --init # write a starter .mmz/config.yaml
mmz cargo test # skipped when its inputs are unchanged
mmz --status # each command's state and last-run age
mmz --is-fresh --tag gate # exit 0 if every gate-tagged command is up to date; runs nothing
mmz --prune # drop cache records for commands that no longer exist
mmz --import ../wt # copy cache records from another checkoutStart here
- Quickstart — Install mmz and watch a command skip.
- Concepts — How rules, records, and freshness fit together.
Writing a manifest
- Inputs — The files and tool versions a command depends on.
- Code inputs — Depend on a function or type instead of a whole file.
- Matching — How a command finds its rule, and how one rule can cover many files.
- Declared outputs — Declare what a run leaves behind.
- Gating with tags — Require a check to have passed, without running it again.
- Composition — Split one manifest across several files.
Reference
- Manifest reference — Every key .mmz/config.yaml can declare.
- CLI reference — Every action, flag, and exit code.
- Rust library — Use mmz as a Rust library.
More
- For AI agents — Machine-readable state and exit codes for agents.
- Comparison — With similar tools.
See CONTRIBUTING.md.
MIT.