# CLI reference

Every `mt` command by group, each linking to its page of flags, notes and generated transcripts.

Your task files are plain text, and you can edit them in any editor. `mt` does the fiddly parts for you: it stamps status dates, writes link paths, fills template slots and checks every task. Each command prints its result, and its exit code reports whether it succeeded.

The build generates these pages from the binary: the commands and flags come from `mt`’s own argument parser ([`mt _cli --json`](https://mlavrinenko.github.io/mindtape/agents/index.md)). Each example is a command the build ran in a terminal, most of them in `examples/api-service`, a sample backend project’s backlog, so what you see is what that run printed.

```
$ mt --version
mt 0.6.0
```

`mt --help` ends on these lines:

Every status is a command too, like `mt wip <task>` and `mt done <task>`.\
Run `mt flip --list` to see them all.\
Put `@name` first, as in `mt @work ls`, to run in a project or set `mt at` lists.

## Hints

Every refusal ends on a hint that states what to do next, and the command it gives is one `mt` provides: `mt check`, `mt flip`, `mt allow`. The hint never gives a `just` recipe from this repository’s own `Justfile`, because `mt` installs into projects that have no `Justfile`. There, `just check` fails before it can fix anything.

`just lint no-just-in-output` holds that rule over the strings the binary prints, and points at the file and line of a hint that breaks it. `tests/it/cli_text_e2e.rs` holds the reflected help text to the same rule. A doc comment may mention a recipe: a reader of the source is in this repository, and a user of the binary never sees the comment.

## Global flags

Every command takes these flags:

- `-w, --worktree <PATH>`: Use the project at PATH, not the one the current directory is in
  PATH is the directory holding `.mindtape/`. Without the flag, mt searches up from the current directory. Defaults to `$MINDTAPE_WORKTREE`.
- `-v, --verbose…`: Print more logging: `-v` for info, `-vv` for debug, `-vvv` for trace
  It also lists every site of a Typst warning that `mt` would otherwise print once, with its count and files.
  `repeatable`
- `--color <WHEN>`: When to color the output
  - `auto`: Color when the output is a terminal and `NO_COLOR` isn't set
  - `always`: Always color
  - `never`: Never color`default: auto`
- `--path-separator <SEP>`: Write the separator between folders in every path mt shows you
  Defaults to your platform's own, `\` on Windows and `/` elsewhere. Paths a program reads keep `/`: the JSON and CSV `file` field, and every path mt stores.

### Paths

`mt` shows you each path in your platform’s own separator, `\` on Windows and `/` everywhere else. That’s the `file` column, `--format path`, the location an error names, and every path in a message, so you can paste any of them straight into your shell.

A path a program reads uses `/` on every platform. That’s the `file` field of `--json` and `--format csv`, the `file` and `place` of `mt check --json`, and every link `mt` writes into a task. A script reads the same output on every machine, and a task file has the same paths in every checkout.

`--path-separator` picks the separator of the paths shown to you, as it does in ripgrep and fd. What a program reads keeps its `/`.

```
$ mt --path-separator '\' ls ready -n 2 --format path
tasks\index-the-orders-by-customer.typ
tasks\reject-expired-sessions-on-token-refresh.typ
$ mt --path-separator '\' ls ready -n 2 --json | jq -r '.tasks[].file'
tasks/index-the-orders-by-customer.typ
tasks/reject-expired-sessions-on-token-refresh.typ
```

## Files

| [`mt add`](https://mlavrinenko.github.io/mindtape/cli/add/index.md) | File a new task from a template |
| --- | --- |
| [`mt import`](https://mlavrinenko.github.io/mindtape/cli/import/index.md) | Import tasks from JSON (the \`mt ls --json\` format), checking them all first |
| [`mt mv`](https://mlavrinenko.github.io/mindtape/cli/mv/index.md) | Rename a task's file and update every link that points to it |
| [`mt go`](https://mlavrinenko.github.io/mindtape/cli/go/index.md) | Open a task in your editor, set by \`\[go\] editor\` |
| [`mt eval`](https://mlavrinenko.github.io/mindtape/cli/eval/index.md) | Evaluate one task file and print it, even outside a project |

## Fields

| [`mt set`](https://mlavrinenko.github.io/mindtape/cli/set/index.md) | Change one field of a task: \`mt set \<task\> \<field\>=\<value\>\` |
| --- | --- |

## Listing

| [`mt ls`](https://mlavrinenko.github.io/mindtape/cli/ls/index.md) | List tasks, optionally filtered |
| --- | --- |
| [`mt find`](https://mlavrinenko.github.io/mindtape/cli/find/index.md) | Find tasks that contain every word you give |
| [`mt board`](https://mlavrinenko.github.io/mindtape/cli/board/index.md) | Show one row per project: its open, ready and blocked counts and what's next |

## Graph

| [`mt graph`](https://mlavrinenko.github.io/mindtape/cli/graph/index.md) | Draw tasks and the links between them, as Graphviz DOT or Mermaid |
| --- | --- |

## Links

| [`mt link`](https://mlavrinenko.github.io/mindtape/cli/link/index.md) | Link tasks: one link at a time, or many from a file |
| --- | --- |

## Status

| [`mt flip`](https://mlavrinenko.github.io/mindtape/cli/flip/index.md) | Change the status of tasks: \`mt flip done \<task\>...\` |
| --- | --- |
| [`mt review`](https://mlavrinenko.github.io/mindtape/cli/review/index.md) | Mark a task as reviewed today |

## Recurring tasks

| [`mt recur`](https://mlavrinenko.github.io/mindtape/cli/recur/index.md) | Write the next occurrence of a recurring task |
| --- | --- |

## Validate and inspect config

| [`mt check`](https://mlavrinenko.github.io/mindtape/cli/check/index.md) | Check every task and every template against your project's rules |
| --- | --- |
| [`mt dicts`](https://mlavrinenko.github.io/mindtape/cli/dicts/index.md) | List the project's dictionaries, or one dictionary's entries |
| [`mt templates`](https://mlavrinenko.github.io/mindtape/cli/templates/index.md) | List the templates \`mt add\` accepts, with the kind each sets |
| [`mt config`](https://mlavrinenko.github.io/mindtape/cli/config/index.md) | Show the config mt uses |
| [`mt schema`](https://mlavrinenko.github.io/mindtape/cli/schema/index.md) | Print or check the JSON Schema for a machine output |

## Retire

| [`mt rm`](https://mlavrinenko.github.io/mindtape/cli/rm/index.md) | Delete tasks, keeping links to them findable in git history |
| --- | --- |

## Setup

These commands write the files that [Quickstart](https://mlavrinenko.github.io/mindtape/quickstart/index.md), [Configuration](https://mlavrinenko.github.io/mindtape/config/index.md) and [For AI agents](https://mlavrinenko.github.io/mindtape/agents/index.md) describe.

| [`mt init`](https://mlavrinenko.github.io/mindtape/cli/init/index.md) | Create \`.mindtape/config.toml\` in the current directory |
| --- | --- |
| [`mt install`](https://mlavrinenko.github.io/mindtape/cli/install/index.md) | Install the Typst package, defaults, schema and completions |
| [`mt fix`](https://mlavrinenko.github.io/mindtape/cli/fix/index.md) | Rewrite the files an mt upgrade left behind |
| [`mt packs`](https://mlavrinenko.github.io/mindtape/cli/packs/index.md) | Fetch the pack sources \`.mindtape/packs.lock\` pins, or move the lock |
| [`mt allow`](https://mlavrinenko.github.io/mindtape/cli/allow/index.md) | Trust the commands your config runs in this repo |
| [`mt at`](https://mlavrinenko.github.io/mindtape/cli/at/index.md) | List the \`@name\`s of \`at.toml\`, or the projects one of them holds |
| [`mt preset`](https://mlavrinenko.github.io/mindtape/cli/preset/index.md) | Save this project's setup as a preset for \`mt init\`, or list presets |

> **Note:** If a script or an agent drives `mt`, [For AI agents](https://mlavrinenko.github.io/mindtape/agents/index.md) collects the JSON output, exit codes and environment variables it reads.
