CLI reference
Every flag of mantish diff, mantish git-config, mantish repo, mantish pr and the structural queries, with defaults and exit codes.
mantish diff
mantish diff [A B | REV | BASE...HEAD] [flags]
| Invocation | Compares |
|---|---|
mantish diff a.cs b.cs | Two files; /dev/null on a side = addition / deletion |
mantish diff dirA dirB | Two directories, paired by relative path |
mantish diff | The working tree against HEAD (untracked files included) |
mantish diff HEAD~1 | One commit against its parent |
mantish diff main...feature | A range, merge-base semantics (main..feature is an alias) |
Target flags
| Flag | Default | Meaning |
|---|---|---|
-C, --directory DIR | cwd | Use the repository at DIR instead of the current directory's |
--name PATH | — | Display path, and so language, for a two-file comparison (git difftool's $MERGED) |
Output flags
| Flag | Default | Applies to | Meaning |
|---|---|---|---|
--format FORMAT | auto | all | auto, tui, diff, json, side-by-side, markdown |
-U, --context N | 3 | text formats | Unchanged lines around each edit, 0 – 10 000 |
--width N | 160 | side-by-side | Widest a row may be, in cells; 40 or more |
--stats | off | diff, side-by-side, markdown | Also write the counts, coverage, each hunk's change types and what the selection left out |
--exit-code | off | text formats | Exit 1 while changes remain after filtering |
--summary | off | diff, json | Write the outline: every change by id, type, tags, verdict, lines and what it renamed, muted ones counted by reason — no code. The edits a change repeats across the comparison (tea.KeyMsg → tea.KeyPressMsg in 200 places) are listed once at the top, and the changes made of nothing else are left out of the files' lists |
--budget TOKENS | — | diff, json | Write the outline and the code of as many changes as TOKENS hold (about 4 bytes a token): spotlights first, then logic |
--expand ID | — | text formats | Write only the hunks of the change ID names; repeatable. Add --file PATH when two files hold the id. For a repeated edit's id (r…), every change making it and the code of the first (diff, json) |
Selection flags
| Flag | Meaning |
|---|---|
--mute a,b | Mute these tags for this run |
--no-mute | Mute nothing |
--hide a,b | Hide changes with these tags entirely |
--no-hide | Hide nothing |
--spotlight a,b | Spotlight these tags |
--no-spotlight | Spotlight nothing |
--whitespace MODE | exact, trim, ignorewhitespaceandempty |
--ignore LIST | Also ignore letter-case, punctuation, typos; "" ignores none |
Review-screen flags (--format tui only)
| Flag | Meaning |
|---|---|
--inline / --split | Open unified / side by side |
--collapse / --no-collapse | Fold / show unchanged regions |
--words / --lines | Word-level / line-level highlighting |
--syntax / --no-syntax | Syntax colouring on / off |
--show-muted | Open with muted changes revealed |
Configuration flags
| Flag | Meaning |
|---|---|
--profile NAME|PATH | Use this profile instead of diff.defaultProfile |
--no-profile | Read neither config.json nor any profile |
--config PATH | The TUI preference file (tui.json) — not a profile |
Shared flags
| Flag | Default | Meaning |
|---|---|---|
-s, --server URL | http://localhost:9010 | The engine to talk to; pins the address |
-t, --theme ID | from tui.json | Colour theme |
--keymap PROFILE | — | Keyboard layout profile (vim) |
--glyphs SET | auto | Glyph set — auto, unicode, basic |
--debug | off | Verbose logging beside tui.json |
Mutually exclusive pairs
--profile / --no-profile · --inline / --split · --mute / --no-mute · --hide / --no-hide · --spotlight / --no-spotlight · --collapse / --no-collapse · --words / --lines · --syntax / --no-syntax · --summary / --budget / --expand
mantish git-config
mantish git-config [--install] [--global | --local] [--exe PATH]
| Flag | Meaning |
|---|---|
--install | Run the git config commands instead of printing them |
--global | The user's git configuration (default) |
--local | The current repository's git configuration |
--exe PATH | The mantish path git runs (default: this binary) |
See Git integration.
mantish repo
mantish repo ls [--format text|json]
The repositories you saved in Mantish: their names and ids — what -r takes — each as its platform names it (owner/repo, an Azure DevOps org/project) and its platform. The one the directory you are in is a clone of is marked (this folder); --format json writes slug and current for each.
mantish pr
The pull requests of your saved repositories, for you and for a coding agent. Every command takes -r REPO: a saved repository's id, or its name when no other saved repository has it (case does not matter). A local repository has no pull requests.
mantish pr ls -r REPO [--state open|completed|abandoned|all] [--limit N] [--format text|json]
mantish pr queue -r REPO [--group GROUP [--skip N]] [--limit N] [--refresh] [--format text|json]
mantish pr show ID -r REPO [--format text|json]
mantish pr diff ID -r REPO [--revision BASE..HEAD] [--file PATH]… [mantish diff's output and selection flags]
mantish pr triage start ID -r REPO [--format markdown|json]
mantish pr triage set ID -r REPO [--run N] --input FILE|-
mantish pr triage finish ID -r REPO [--run N] [--summary TEXT | --summary-file FILE|-] [--incomplete]
mantish pr review start ID -r REPO [--format markdown|json]
mantish pr review finish ID -r REPO [--run N] [--summary TEXT | --summary-file FILE|-] [--incomplete]
mantish pr comment ls ID -r REPO [--source all|people|ai-tools|ai-review] [--state open|closed|all] [--file PATH] [--full] [--format text|json]
mantish pr comment add ID -r REPO [--run N] [--at PATH:LINE[-LINE]] [--side new|old] [--severity critical|major|minor|nit] (--body TEXT | --body-file FILE|-)
mantish pr comment follow-up ID -r REPO [--run N] --id N --status fixed|still-applies|obsolete [--note TEXT | --note-file FILE|-]
mantish pr note add ID -r REPO [--revision BASE..HEAD] [--at PATH:LINE[-LINE]] [--side new|old] (--body TEXT | --body-file FILE|-)
mantish pr note ls ID -r REPO [--full] [--format text|json]
| Command | What it does |
|---|---|
pr ls | Lists pull requests, newest first: --limit (default 30, at most 100), --state (default open) |
pr queue | The open pull requests in Mantish's review-queue groups — favorites, needs-you, in review, changes requested, approved, drafts — the first --limit of each (default 10); --group and --skip page one group; --refresh asks the platform |
pr show | The pull request, read without changing it: description, state, reviewers and votes, labels, checks, and its files and conversations as your agent rules let an agent see them |
pr diff | The pull request's diff, written as mantish diff writes a comparison and filtered by your tag sets; files your agent rules withhold are left out or listed without content. --revision refuses a pull request that moved past it; --file (repeatable) narrows it |
pr triage start | Starts the AI triage you asked for in Mantish, or resumes the one in progress, and prints the agent's brief (--format json: its context) |
pr triage set | Records verdicts, one JSON object per line; every line is checked and answered by its line number |
pr triage finish | Ends the run with a summary; --incomplete when not every file has a verdict |
pr review start | Starts the AI review you asked for in Mantish, or resumes the one in progress, and prints the agent's brief (--format json: its context) |
pr review finish | Ends the run with the agent's overall assessment and main risks; --incomplete when it stopped before it was done |
pr comment ls | The conversations on the pull request, then the AI Review comments of every run — the open ones unless --state says otherwise — each long comment cut short unless --full |
pr comment add | Adds an AI Review draft on lines of a file (--at, in the new file's numbering unless --side old) or on the whole pull request, and prints the code it landed on |
pr comment follow-up | Records what became of an earlier run's comment: fixed, still-applies or obsolete, with an optional note |
pr note add | Leaves the reviewer a private note — on lines or on the pull request; --revision refuses a pull request that moved past it |
pr note ls | The pull request's private notes, the reviewer's and the agent's |
The brief tells the agent which commands to run, with the run and revision filled in; --run defaults to the run in progress. Everything a pr command writes to stdout is written only once it is whole; the engine's refusals are printed with their code, for example Error: start the triage of pull request 42: … (agent_rules_unavailable).
mantish diagram
How the files a change touches depend on each other — the dependency diagram the desktop app and the review screen draw: the changed files in the groups Mantish finds for them, and the references between them by kind (uses, imports, implements, extends, tests, calls).
mantish diagram [REV | BASE...HEAD] [-C DIR] [--format text|json|mermaid]
mantish pr diagram ID -r REPO [--format text|json|mermaid]
It reads what mantish diff compares, as your agent rules let a coding agent see it: a file they withhold is not listed, one whose content they withhold is listed and never read.
Drawings: --format mermaid
mantish diagram, mantish flow and mantish impact — and their pr forms — write their answer as a Mermaid flowchart with --format mermaid, for a pull request's description or a comment, where GitHub and GitLab draw it.
$ mantish flow OrderService.Place --callers --format mermaid
flowchart LR
%% mantish-flow v1 — OrderService.Place(Order), through the repository
%% shown: 4 of 4 members, 3 of 3 calls
%% whole answer: mantish flow OrderService.Place --callers --format json
subgraph g34b1d43e["OrdersController"]
%% src/Api/OrdersController.cs:80
n6570e335["Create(OrderDto)"]:::unchanged
end
…
| Command | Blocks | Boxes | Arrows |
|---|---|---|---|
diagram | A group | A file, outlined by what happened to it | A reference, labelled by its kind and how many it stands for |
flow | A type, or a file for its free functions | A member, outlined by what the change did to it; the symbol rounded | A call from the caller; dashed when the receiver's type is not known |
impact | A file | Each changed declaration rounded and outlined by its effect — breaking the heaviest | From each caller, reference, implementation and test that depends on it, labelled by which |
A drawing shows at most 40 boxes; the rest collapse into +N more. Comments (%%) carry where each box stands, how much of the whole answer is shown — and whether it is a lower bound — and the command that writes the whole answer as JSON. A box keeps its id from one run to the next. Labels are escaped and a drawing holds no link, no click and no directive, so it renders as it is.
mantish usages and mantish flow
Where a symbol is used and who calls it, as Mantish's navigation binds names — not as a text search finds them: a comment, a string or another symbol of the same name is never a usage.
mantish usages SYMBOL... [--revision REV | BASE...HEAD] [-C DIR] [--implementations | --writes | --reads] [--constructor] [--side new|old] [--scope change|repository] [--index-wait D] [--limit N] [--format text|json]
mantish flow SYMBOL [--revision REV | BASE...HEAD] [-C DIR] [--up N] [--down N] [--callers | --callees] [--constructor] [--side new|old] [--scope change|repository] [--index-wait D] [--limit N] [--format text|json|mermaid]
mantish pr usages ID SYMBOL... -r REPO [--revision BASE..HEAD] [the same flags]
mantish pr flow ID SYMBOL -r REPO [--revision BASE..HEAD] [the same flags]
SYMBOL is a name — Place, OrderService.Place, OrderService.Place(Order) for one overload — or a place, path:line[:column]. A function a method's body declares — a local function, or a lambda a local holds — is named through the method, OrderService.Place.Total; the call graph holds no member of it, so mantish flow asked of one answers the method's flow and says so. Type.Type names a type's constructors; for a constructor its header declares — C#'s primary constructor and positional record, Kotlin's primary constructor, a Scala class's parameters, a Java record's canonical one — its usages and its callers are its creations alone, and --constructor asks the same of a type's place. A name several symbols bear exits 3 and lists each by the path:line:column that names it; a name nothing binds exits 4; a name the change does not declare while the repository could not be searched — its index still building, off, over its memory budget or unavailable — exits 5: it may be declared outside the change, so it is never "no such symbol". All three write their answer to stdout, in the format asked. Without --revision they read the working tree against HEAD; --revision REV reads one commit, --revision BASE...HEAD what a pull request from HEAD into BASE would show.
mantish usages takes several symbols at once — mantish usages OrderService.Place OrderService.Cancel — and answers each on its own, in the order named: the texts a blank line apart, --format json one document a line. It exits 3 when a name is ambiguous, else 5 when the repository was not searched for one, else 4 when one binds nothing, else 0; a failure of any writes nothing and exits 1.
| Command / flag | What it does |
|---|---|
usages | Every place the symbol is used, its declaration beside them; --implementations lists what implements, overrides or derives from it instead |
flow | Who calls the symbol, transitively, and what it calls — each member once, with what the change did to it; a call whose receiver's type is not known is marked possible |
--up N, --down N | Follow N calls up (callers) or down (callees); every one without them. --callers and --callees keep one way |
--writes, --reads | The places that write the symbol (an assignment, a compound assignment, an increment, an out or ref argument, a name in a target list) or that read it; a place that does both is in either list, and the other access is counted. --format json gives every usage its access — read, write or readwrite; a place whose file's content your agent rules withhold has none, and is left out and counted |
--side old | Read the symbol in the version before the change: what it deleted or renamed |
--scope | By default the repository when its index (Settings › Repositories) is ready, the change's files otherwise; change asks the change alone, repository refuses to answer from less |
--index-wait D | How long to wait for a repository index that is still building, then ask again: seconds (120) or with a unit (2m); default 30s, 0 answers at once from the change's files |
--limit N | The most places, members or candidates listed (default 50); the total is always said |
Every answer says what was searched. When it was not the whole repository — the index still building, the change asked alone, places in files your agent rules withhold — the text says at least and why, and --format json sets "complete": false with the reasons in "incompleteBecause": a count is then a lower bound, never proof that a symbol is unused. Your agent rules apply: a place in a file they withhold is counted, never listed; one in a file whose content they withhold is its path and line alone. Both need the Pro plan.
mantish impact
What a change may break: for every declaration it really changed — as the semantic diff judges it, never by the lines it touched — who is affected, ranked by how much.
mantish impact [REV | BASE...HEAD] [-C DIR] [--depth N] [--scope change|repository] [--limit N] [--format text|json|mermaid]
mantish pr impact ID -r REPO [--revision BASE..HEAD] [the same flags]
| Effect | When |
|---|---|
breaking | A reference the change left behind to a declaration it deleted, renamed or moved — or, for a signature it changed, a caller or an implementation it did not update |
contract | What the declaration offers others changed — a signature, a public name — and nothing is proven broken; parameters added with a default value are one |
behaviour | Its body changed: its callers, and the tests that reach it, are listed |
info | An addition that implements, overrides or derives from something that exists |
An entry lists its places — the references left behind and those that bind to another declaration now, the callers and implementations, the tests that reach it — ten of each, and names the mantish usages and mantish flow commands that list them all (--format json: "expand"). What the diff judged harmless — formatting, comments, imports, a move that arrived as it left, references updated for a rename — is skipped and counted. What was not examined — a file that is not code, a file too large to read, a declaration the time budget did not reach — is said apart, never read as safe.
| Flag | What it does |
|---|---|
--depth N | Follow callers up to N calls from a changed member (1 to 5, default 1); tests are looked for within as many |
--scope | As for usages: the repository when its index is ready, the change's files otherwise; change asks the change alone, repository refuses to answer from less |
--limit N | The most entries listed (default 50, at most 2000); the total is always said |
--revision | pr impact only: the revision you read the pull request at; refused once it moved past it |
As for usages, an answer that did not search everything says at least and why, and your agent rules apply. mantish impact never fails a run for what it finds. It needs the Pro plan.
mantish check
The gate for a pre-commit hook, CI or a coding agent's last step: it fails when the change has a spotlight, or a breaking entry of mantish impact.
mantish check [REV | BASE...HEAD] [-C DIR] [--fail-on LIST | --refactor-only] [--profile NAME | --no-profile] [--scope change|repository] [--limit N] [--format text|json]
$ mantish check
3 findings in the working tree against HEAD: 2 spotlights, 1 breaking — searched the repository
src/Orders/OrderService.cs:42: spotlight commented-out-code — the call to SaveAsync() is commented out
src/Orders/OrderService.cs:77 (old): impact breaking — OrderService.Cancel(int) is deleted and 2 usages remain: mantish usages src/Orders/OrderService.cs:77:17 --side old
tests/Orders/PlaceTests.cs:18: spotlight disabled-test — a test is skipped
A spotlight is a change of the comparison as mantish diff judges it under the same profile — a change your settings put forward, such as commented-out code or a disabled test — placed at its hunk's first changed line. A breaking entry is a reference the change left behind to what it deleted, renamed or moved, or a caller or an implementation it did not update for a signature it changed — never a parameter added with a default value; it is placed at the declaration, with the mantish usages command that lists what remains. Findings are ordered by path and line.
| Flag | What it does |
|---|---|
--fail-on LIST | What fails the gate, comma-separated: spotlight (every one), spotlight:REASON (one reason's: a tag such as disabled-test, or rename; agent-config takes its MCP servers', hooks' and permissions' too), behaviour (every change without a proof), impact and unchecked (every file the impact's time budget never reached). Default spotlight,impact,unchecked |
--refactor-only | The gate of a change meant to change nothing the code does: --fail-on behaviour,impact,unchecked |
--profile | Judge the comparison under this profile, as mantish diff --profile does; --no-profile reads no configuration file |
--scope | Where the impact looks, as for mantish impact: the repository when its index is ready, the change's files otherwise |
--limit N | The most findings listed (default 50); the total is always said |
What --fail-on leaves out is not read: --fail-on spotlight asks no impact, and so needs neither the Pro plan nor a newer engine. A check that could not cover everything — a file it could not analyse, one whose content your agent rules withhold, a repository not searched — says so, and passes when it found nothing; --format json sets "complete": false with the reasons. The one gap more time closes is not passed over: the impact stops at the engine's time budget, so mantish check asks again of the files it left, round after round, and a file no round reached is an unchecked finding with the command that checks it alone. So is a changed signature with more direct callers than the engine reads (over 5 000): one the change left as it was may stand past them, and the finding names the mantish flow … --callers --up 1 that lists every one. A changed body whose callers' walk stopped at its limit is listed under "callers cut at the walk's limit" and fails nothing. It judges the working tree, untracked files included — never the staged files alone.
--refactor-only is the gate for a large refactoring, by an agent or by hand: it passes only when every change is proved to leave the code doing what it did, and nothing breaks what depends on it. The proof is the engine's, read off each change — never your mute or hide settings, which the check leaves aside, comparing exactly: every tag says the code is the same (whitespace, formatting, code style, syntax sugar), the rename facts cover the whole change, or code moved where its place means nothing and arrived unchanged, or under renames the file proves. Anything else is a finding with the change's id, which mantish diff --expand ID writes the code of: logic, a heuristic tag such as a reorder or a logging line, an extracted method, a file renamed, one not analysed in full, line endings changed.
$ mantish check --refactor-only
1 finding in the working tree against HEAD: 1 without proof, 0 breaking — searched the repository
src/Orders/OrderService.cs:77 (old): behaviour no-proof — deleted:logic — Deleted method Cancel (change 7e10aa5d2f81a0c3)
Exit codes
| Code | Meaning |
|---|---|
0 | Success, changes or not |
1 | --exit-code only: changes remain after filtering |
2 | Any failure — bad flags, no engine, unreadable input; stdout empty |
130 | Interrupted (SIGINT) |
143 | Terminated (SIGTERM) |
mantish repo and mantish pr exit 1 on any failure — a refused pr triage set line included — and never use 2; 130 and 143 as above. mantish usages and mantish flow, and their pr forms, exit 1 on a failure, 3 for a name several symbols bear, 4 for one nothing binds and 5 for one the change does not declare while the repository was not searched — those three write their answer to stdout; asked of several symbols, 3 when any name is ambiguous, else 5 when any was not searched for, else 4 when any binds nothing. mantish impact and mantish pr impact exit 0 on any answer, whatever it finds, and 1 on a failure. mantish diagram and mantish pr diagram exit 0 when they wrote the diagram and 1 on a failure. mantish check exits as mantish diff --exit-code does: 0 when nothing fails the gate, 1 with findings — written to stdout — and 2 when it could not check, with nothing on stdout.
Environment
| Variable | Effect |
|---|---|
MANTISH_SERVER | Engine address; pins it, like --server |
MANTISH_HOME | Where config.json, profiles/ and the engine's state live |
XDG_CONFIG_HOME | Where mantish/tui.json lives (else ~/.config) |