Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

rustmanifest CLI reference

Global options: -v/-vv/-vvv (verbosity). Every analysis command takes [PATHS]... defaulting to . and accepts --resolution <FILE> where noted.

Resolution overlay: a JSON file written by the resolve step (e.g. resolution.json at a workspace root) that lets a call into a library state the type it hands back instead of refusing. If such a file exists for the workspace under review, pass --resolution resolution.json to overview, report, facts, coverage, ask, and meaning for strictly more facts. An overlay written for a different workspace fails to parse — if the engine rejects the file, continue without it and say so; a stale overlay is worse than none.

check — run all bundled rules

rustmanifest check [PATHS]... --format <auto|json|sarif|tty>
                          [--severity-filter <error|warning|info|hint>]
                          [--config FILE] [--cache DIR] [--delegate-clippy]
                          [--fix] [--scip INDEX] [--max-file-size BYTES]
  • auto picks tty on a terminal, json when piped.
  • json: canonical pretty-printed array of findings (see reporting.md).
  • sarif: SARIF 2.1.0 document — use for CI integration.
  • --severity-filter sets the minimum severity to report (default hint = everything); use error or warning for a quick high-severity pass.
  • --config points at a rustmanifest.toml; defaults to one in the cwd.
  • --cache DIR enables a content-addressed persistent findings cache (never serves stale entries; the semantic tier is not cached).
  • --delegate-clippy also runs cargo clippy and surfaces its diagnostics as advisory findings; needs a Cargo.toml directly inside the first analyzed path; best-effort, never fails the run.
  • --fix applies only machine fixes proven safe, then re-runs the analysis. Requires the user’s explicit ask for fixes — it edits files.
  • --scip INDEX overlays name-resolved call edges (from rust-analyzer scip .) so invariants are checked through calls the syntactic resolver cannot bind.

Example — full workspace review to a file, then aggregate:

rustmanifest check crates --format json > /tmp/findings.json
jq -r 'group_by(.severity)[] | "\(.[0].severity): \(length)"' /tmp/findings.json

explain — rationale for one rule

rustmanifest explain <RULE_ID>        # e.g. RM-SEC-001

Prints severity, tier, rationale URI, then the methodology excerpt the URI resolves to.

overview / report — whole-project knowledge

rustmanifest overview [PATHS]... [--top N] [--resolution F]
rustmanifest report   [PATHS]... [--top N] [--resolution F]

One combined report of everything the engine knows; --top caps every ranked list (default 10).

ask — why a function carries an effect

rustmanifest ask <FUNCTION> <EFFECT> [PATHS]...

FUNCTION — qualified or bare name. EFFECT — one of fs, net, process, env, console, db-read, db-write, db (a provably sent statement with its kind unproven), unsafe. The answer is a step-by-step inference over recorded facts.

facts — behavioral facts as JSON

rustmanifest facts [PATHS]... [--filter SUBSTR] [--active] [--features]
                   [--expand] [--scip INDEX] [--resolution F]

Per function: reads, writes, constructions, error types, effects, parameter ownership, derived behavioral role. --active keeps only functions with at least one write, effect, or error type. --expand macro-expands crates via cargo +nightly rustc -Zunpretty=expanded so macro-generated functions become facts (test modules are absent from the expanded universe). --scip overlays name-resolved call edges from a rust-analyzer scip . index.

coverage — how much the engine understands

rustmanifest coverage [PATHS]... [--unresolved] [--expand] [--scip INDEX]

--unresolved lists every unresolved use target with its occurrence count — the inspectable form of the “unresolved” bucket. Run this before trusting a review of a dependency-heavy crate: low coverage means blind spots.

meaning — outside-world behavior

rustmanifest meaning [PATHS]... [--format text|json] [--resolution F]

What the program does for an observer outside the process; text is an aligned table of entry points, json one object per entry point.

graph — architecture diagram

rustmanifest graph [PATHS]... --kind <modules|types> --format <...>

modules: one node per module, one edge per resolved intra-crate dependency. types: one node per structure, one edge per aggregating field.

prescribe — the canonical form’s code

rustmanifest prescribe [PATHS]... [--why]

Prints the code the canonical form asks for and what it buys; --why adds the counts before/after and the facts each count rests on.

learn — per-role convention clauses

rustmanifest learn [PATHS]... [--clauses N] [--epochs N] [--seed N]

Deterministic training (identical seeds yield identical clauses); output is an auditable JSON rule list of conventions learned from the codebase itself.

audit — tier-3 external tool orchestration

rustmanifest audit [PATH] [--profile pr|nightly]

Runs available external verification tools and aggregates their output. pr profile runs fast checks (clippy, cargo-deny, cargo-audit, cargo-udeps); nightly adds heavier checks (miri, cargo-careful, cargo-fuzz, cargo-semver-checks, cargo-mutants, cargo-hakari). Missing tools are reported, not treated as hard failures.

versions — workspace version synchronisation

rustmanifest versions [PATH] [--fix]

Reports MSRV, toolchain channel, and ra_ap_* dependency alignment. With --fix, aligns ra_ap_* versions in the workspace manifest when possible.

document — compiler documentation index

rustmanifest document [PATH] [--toolchain nightly]

Emits the compiler documentation index for the workspace. Uses a nightly toolchain by default because the emitter is unstable. Missing toolchains or emitter failures are reported as operational errors.

resolve — resolution overlay

rustmanifest resolve [PATH] [--out FILE]

Produces a resolution overlay (default resolution.json in the workspace root) for type/call-aware analysis. Other commands consume it via --resolution.

rustmanifest-ci — CI generator

A separate binary that generates CI configuration from a job catalog; one file per job, the main workflow holds only triggers and job references.

rustmanifest-ci [-r ROOT] init --platform <github|gitlab> [--jobs a,b] [--force]
rustmanifest-ci [-r ROOT] enable --job <id> [-p <github|gitlab>]
rustmanifest-ci [-r ROOT] disable --job <id> [-p <github|gitlab>]
rustmanifest-ci [-r ROOT] list [-p <github|gitlab>]
  • init writes .github/workflows/ci.yml plus _<job>.yml per job (GitHub) or .gitlab-ci.yml plus .gitlab-ci/jobs/<job>.yml (GitLab). Existing files are never overwritten without --force; --jobs narrows the catalog, which defaults to all of: fmt, clippy, test, coverage, audit, deny, versions, docs.
  • enable/disable toggle a job by commenting its reference in the main file; the job file itself stays untouched. Provider is detected from the files present unless -p is given.
  • list prints every catalog job with its current state (enabled, disabled, not generated).