> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nika.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI reference

> Every nika subcommand, flag, and environment variable.

export const STATUS = {
  head: "95962d5cd",
  branch: "main",
  version: "0.91.0",
  cratesWorkspace: 39,
  cratesAdmitted: 39,
  cratesTarget: "42",
  wipCrates: [],
  libTests: 2989,
  clippyWarnings: 0,
  adrs: 62,
  adrsAccepted: 42,
  adrsProposed: 18,
  providers: 32,
  capabilityRules: 49,
  hygieneVectors: 38,
  hygieneGreen: 28,
  hygieneYellow: 3,
  hygieneRed: 0,
  lastUpdated: "2026-06-25"
};

<Info>
  This page mirrors the current docs build (`v{STATUS.version}` from the status
  snapshot). Tagged release binaries can lag main; `nika --help` remains the
  executable source of truth for the binary installed on your machine.
</Info>

## Core commands

| Command                             | What it does                                                               |                                    |                                 |
| ----------------------------------- | -------------------------------------------------------------------------- | ---------------------------------- | ------------------------------- |
| `nika check <file>`                 | Static pre-flight audit before any run                                     |                                    |                                 |
| `nika run <file>`                   | Execute a checked workflow                                                 |                                    |                                 |
| `nika inspect <file>`               | Static anatomy: tasks, verbs, DAG, cost, permits                           |                                    |                                 |
| `nika graph <file>`                 | Project the workflow graph as JSON, Mermaid, or DOT                        |                                    |                                 |
| `nika explain <code>`               | Explain a `NIKA-XXXX` error code                                           |                                    |                                 |
| `nika doctor`                       | Diagnose providers plus editor/agent readiness                             |                                    |                                 |
| `nika init [dir]`                   | Scaffold schema wiring, `AGENTS.md`, and Cursor rules                      |                                    |                                 |
| `nika wire <target>`                | Explicitly wire MCP for `cursor`, `vscode`, `windsurf`, `claude`, or `all` |                                    |                                 |
| `nika spec [--canon]`               | Print the embedded spec or canon                                           |                                    |                                 |
| `nika schema`                       | Print the embedded JSON Schema                                             |                                    |                                 |
| \`nika examples list                | show                                                                       | run\`                              | Browse or run embedded examples |
| `nika new --from <template> <dest>` | Instantiate an embedded workflow template                                  |                                    |                                 |
| `nika completions <shell>`          | Generate shell completions                                                 |                                    |                                 |
| \`nika trace replay                 | show\`                                                                     | Replay or summarize a recorded run |                                 |
| `nika lsp`                          | Run the language server over stdio                                         |                                    |                                 |
| `nika mcp`                          | Run the read-only MCP server (`nika_check`, `nika_explain`)                |                                    |                                 |

## Global flags

| Flag              | Command        | Description                                     |         |                         |
| ----------------- | -------------- | ----------------------------------------------- | ------- | ----------------------- |
| `--json`          | `check`, `run` | Machine-readable output                         |         |                         |
| `--infer-permits` | `check`        | Print the tightest inferred `permits:` boundary |         |                         |
| `--output json`   | `run`          | Print typed workflow outputs as one JSON object |         |                         |
| `--dry-run`       | `run`          | Plan only; execute zero effects                 |         |                         |
| `--no-progress`   | `run`          | Deterministic non-animated render               |         |                         |
| `--quiet`         | `run`          | Compact final verdict card                      |         |                         |
| \`--format json   | mermaid        | dot\`                                           | `graph` | Choose graph projection |
| `--force`         | `init`, `new`  | Overwrite existing generated files              |         |                         |

## Environment variables

| Var                  | Description            |
| -------------------- | ---------------------- |
| `ANTHROPIC_API_KEY`  | Anthropic provider     |
| `OPENAI_API_KEY`     | OpenAI provider        |
| `GEMINI_API_KEY`     | Google Gemini provider |
| `MISTRAL_API_KEY`    | Mistral provider       |
| `GROQ_API_KEY`       | Groq provider          |
| `DEEPSEEK_API_KEY`   | DeepSeek provider      |
| `XAI_API_KEY`        | xAI provider           |
| `OPENROUTER_API_KEY` | OpenRouter provider    |

The MCP server is intentionally read-only. It lets agents call `nika_check`
and `nika_explain`; effectful execution stays behind `nika run`.
