# Commands

> The dmn command line: asking about code, the project's shared notes, connecting agents, running the engine, and the reports on what DMN saved, with the flags you'll use most.

Source: https://getdmn.com/docs/commands/

Most commands need the engine running (open the app, or `dmn start`). They never start it for you, and they never index anything on their own. Every command also takes `--format json` for scripts.

## Ask about code

| Command | What it does |
|---|---|
| `dmn search "<question>" --curate` | Ranked code sections for a question in plain words, fitted to a token budget |
| `dmn search "<q1>" "<q2>" --curate` | Several questions in one call; a section that answers two shows once |
| `dmn search --mode symbol <name>` | Where a symbol is defined, and where it's used |
| `dmn search --mode trace <name>` | Who calls it |
| `dmn search --mode structure <path>` | A map of a folder: its files and what's in them |
| `dmn search --mode files "<glob>"` | Files that match a pattern, such as `"src/**/*.ts"` |
| `dmn context <symbol>` | A symbol's definition, its callers and what a change could affect, in one call |
| `dmn impact --symbol <symbol>` | What could break if it changes (`--path <file>` for a whole file) |
| `dmn grep "<exact text>"` | Exact matches, shown with the code around them; repeat the pattern to search for several |
| `dmn review --base main --head HEAD` | What changed between two git refs, file by file (`--mode semantic_diff` lists the symbols added, removed or changed) |
| `dmn repo` | Branch, status, recent commits, ahead and behind, and stashes in one call |
| `dmn projects` | The projects DMN tracks, their index status and their short names |

Flags that work on the search commands:

- `--budget <chars>` sets how much code comes back (8,000 characters by default), and `--compact` cuts it to 3,000.
- `--project <name>` (on `search`) or `--project-path <name>` (on `context`, `grep`, `impact`, `repo`) asks about another tracked project, by its short name from `dmn projects`. `dmn grep --path @<name>:src` does the same for one folder.
- `--top-k <n>` on `search` sets how many results it ranks (10 by default).

## The project's notes

| Command | What it does |
|---|---|
| `dmn memory list` | The project's shared notes, which every agent on the project reads |
| `dmn memory read <path>` | Print one note |
| `dmn memory write <path> --content "<text>"` | Write a note (or pipe the text in), replacing any note at that path |
| `dmn memory delete <path>` | Delete a note |
| `dmn memory search "<question>"` | Search records of past sessions: what they were asked, ran and concluded |
| `dmn gotchas list` | Lessons learned: errors agents fixed in two or more sessions, each with its one-line fix |
| `dmn gotchas forget <id>` | Stop handing out a lesson, for good |
| `dmn board list` | The project's open cards, and those done this week |
| `dmn board add "<title>"` | Post a to-do; with `--step`, something only you can do (an install, a sign-in, a decision) |
| `dmn automation list` | The project's automations and their unread results |

## Connect your agents

Each of these previews what it would change. Add `--apply` to write it, `--check` to verify it, and `--remove` to undo it.

| Command | What it does |
|---|---|
| `dmn skill-init` | Install the DMN skill, which teaches agents the `dmn` command line: Claude Code, Codex, Gemini CLI, Cursor and OpenCode (`--agent <name>` for one) |
| `dmn mcp-init` | Add DMN's MCP server to every client it finds: Claude Code, Codex, Cursor, Gemini CLI, Continue and Warp |
| `dmn hook-init` | Brief Claude Code with the project's notes at the start of each session and after a compact (`--agent codex` for Codex) |
| `dmn config verify` | Check every MCP entry, skill and hook in one go; read-only |

## Run the engine

| Command | What it does |
|---|---|
| `dmn start` / `dmn stop` / `dmn restart` | Start, stop or restart the engine |
| `dmn status` | Whether the engine is running |
| `dmn index` | Index the current folder (`--watch` waits until it's searchable) |
| `dmn index --list` | The files in the project's index |
| `dmn index --force` | Throw the index away and build it again |
| `dmn index --drop` | Delete the project's index without building a new one |
| `dmn doctor` | Check the engine, GPU, models, index, MCP config and hooks, and say what to do |
| `dmn whoami` | Which engine you're talking to: its version, folders and process |
| `dmn logs` | The engine's log (`-f` to follow it, `--level warn` for problems only) |
| `dmn config show` | The settings in effect, and the files and environment they came from |
| `dmn gpu install-cuda` | Download NVIDIA's CUDA runtime so indexing can use your NVIDIA GPU |

## What DMN saved you

| Command | What it does |
|---|---|
| `dmn stats` | How many fewer tokens of code DMN sent your agents than reading the same files whole, per agent and per day (`--days`, `--all-projects`) |
| `dmn bench` | A search benchmark built from your own code, with a report you can rerun |
| `dmn proxy enable` | Start the token-saving proxy and print the line that points Claude Code at it |
| `dmn proxy status` / `dmn proxy disable` | Whether the proxy is running; stop it |

## From an agent's pane

These need the DMN app: they act on the pane the agent runs in.

| Command | What it does |
|---|---|
| `dmn browser open <url>` | Open a page of your local dev server in a browser beside the pane |
| `dmn browser snapshot` | The page as an outline of headings and everything you can click or type in |
| `dmn browser shot` | A screenshot of the page |
| `dmn browser console` | The page's console messages, errors and failed requests |
| `dmn pane panes` | The open agent panes: what each is doing, who opened it, and whether it takes turns from agents |
| `dmn pane open "<task>"` | Open a pane beside the agent's own, with another agent working on the task (`--cli codex`, `--worktree`) |
| `dmn pane fork "<what to try>"` | Fork the agent's Claude Code conversation into a new pane that starts with everything so far (`--worktree` for a branch of its own) |
| `dmn pane send <pane> "<text>"` | Send another agent's pane a turn, typed in once that pane is idle |
| `dmn pane read <pane>` | What a pane shows now |
| `dmn pane interrupt <pane>` / `dmn pane close <pane>` | Stop a pane's running turn, or close the pane |
| `dmn limits` | The pane's usage limits and when they reset |
| `dmn automation add` | Schedule a run; it goes live at once unless [agent autonomy](/docs/workspace/#agent-autonomy) leaves arming to you |
| `dmn automation watch --pr <number>` | Wake the agent each time a pull request's checks, reviews or conflicts change |

[Agent autonomy](/docs/workspace/#agent-autonomy) decides which of these ask you first. A pane the agent opened is its own, so interrupting or closing it never asks. `dmn agent spawn "<task>"` hands a task to a headless teammate instead, and `dmn agent collect <id>` returns its result.
