# Engine commands

**These commands are answered by the local engine. `niro` passes them on unchanged.** `niro <command> --help` shows the engine's own help. The exit code is the engine's. If the engine was stopped by a signal, the exit code is 128 plus the signal's number.

| Command | What it does | Needs sign-in |
| --- | --- | --- |
| `niro ask [TOOL key=value ...]` | Asks one graph tool and prints its answer. With no tool, lists the tools | yes |
| `niro ui [--port N] [--open]` | Draws the folder's graph in your browser, at 127.0.0.1 (port 8601 by default; 0 picks a free one). Runs until Ctrl-C | no |
| `niro env ...` | The settings this folder's code reads. See below | no |
| `niro base-url [value]` | Shows or sets the address this folder's service answers on. An empty value goes back to the address Niro worked out. `--module` names one service inside the folder | no |
| `niro route-rule ...` | Says where a path goes when the code does not. See below | no |
| `niro modules` | Lists the folders inside this one that are separate services | no |
| `niro clean [--dry-run]` | Removes, now, the graph of every folder missing from disk | no |
| `niro db status\|check\|remove` | The graph file: its status, a check that it opens, or its removal (`remove --delete-data`) | no |
| `niro journal [--limit N]` | Shows the tool-usage record waiting to be sent | no |
| `niro audit [--limit N] [--export DIR]` | Shows, or writes to a folder, the coverage audit waiting to be sent | no |
| `niro impact [--days N] [--project <name>] [--json]` | What Niro did for you in the last 7 and 30 days, from the record on this computer: tasks, answers, tokens against the by-hand estimate, searches avoided, look-ups avoided, round trips avoided, answers by kind, the median answer time, a line per project, good moments, and the graph kept current. See [Check what Niro did](https://help.niroai.dev/cli/evaluate-what-niro-did/) | no |
| `niro remove [--path <folder>] [--project <name>] [--branch <name>]` | Stops indexing a folder: its graph is removed and it is forgotten | no |
| `niro projects [--json]` | Lists every project on this computer and its folders | no |

## `niro env`

| Form | What it does |
| --- | --- |
| `niro env scan` | Finds the settings the code reads |
| `niro env list [--json] [--root\|--module NAME]` | Shows them |
| `niro env get KEY` | Shows one |
| `niro env set KEY=VALUE ...` | Sets values |
| `niro env set-from KEY=FILE ...` | Takes a value from a file |
| `niro env unset KEY` | Removes your value |
| `niro env files add\|remove\|list [file]` | Names extra env files to read address values from |

All forms take `--path` and `--project`. Passwords and tokens are refused and never stored. The older forms `env add` and `env remove` now print "This command moved: niro-local env files ...".

## `niro route-rule`

| Form | What it does |
| --- | --- |
| `niro route-rule list` | Shows your rules |
| `niro route-rule unconnected` | Shows the calls Niro could not link |
| `niro route-rule add PATTERN --to SERVICE [--from SERVICE] [--at URL] [--strip N] [--prefix P] [--id ID]` | Adds a rule |
| `niro route-rule remove ID` | Removes one |
| `niro route-rule replace FILE` | Replaces all rules with a JSON file |

At most 200 rules. A list with one bad rule is refused whole.

## Commands of the engine that `niro` does not pass on

The engine has more commands that `niro` uses itself or does not pass on yet: `init`, `build`, `status`, `mcp`, `config`, `receipts`, `docs` and `redact-files`. Use `niro init`, `niro build` and `niro status` instead. A released engine refuses `build`, `ask` and `init` typed by hand, because only `niro` hands it the licence.