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

# Substrate CLI Reference — All Commands at a Glance

> Every command available in the Substrate v0.7.0 CLI — setup, running MCP and serve, human approvals, data management, and diagnostics at a glance.

Substrate is operated entirely from the command line. Every command works against the `.substrate/` directory in your current working directory — there is no global registry and no `--project` flag. Run `substrate --help` to see the version on its first line. Running `substrate` with no subcommand is an alias for `substrate serve`.

## Usage

```shell theme={null}
substrate <command> [args] [flags]
```

## Command Groups

### Setting Up

<CardGroup cols={3}>
  <Card title="init" href="/cli/init">
    Create a `.substrate/` in the current directory, optionally seeded from a template.
  </Card>

  <Card title="add" href="/cli/add">
    Apply a shared template into an existing `.substrate/`. Dry-run by default.
  </Card>

  <Card title="install-skill" href="/cli/install-skill">
    Refresh the packaged agent skill in `~/.claude/skills/`.
  </Card>
</CardGroup>

### Running

<CardGroup cols={2}>
  <Card title="mcp" href="/cli/mcp">
    Start the stdio MCP server. Spawned by agent runtimes.
  </Card>

  <Card title="serve" href="/cli/serve">
    Start the localhost read-only web inspector.
  </Card>
</CardGroup>

### The Human Channel

<CardGroup cols={3}>
  <Card title="pending-approval" href="/cli/pending-approval">
    List every task waiting on a human sign-off.
  </Card>

  <Card title="approve" href="/cli/approve">
    Set a `human_only` field on a task.
  </Card>

  <Card title="unapprove" href="/cli/unapprove">
    Revoke a mistaken approval.
  </Card>
</CardGroup>

### Data and Diagnostics

<CardGroup cols={3}>
  <Card title="backup" href="/cli/backup">
    Timestamped archive into `.substrate/backups/`.
  </Card>

  <Card title="export / import" href="/cli/export-import">
    Move a whole substrate as a `.tar.gz`.
  </Card>

  <Card title="validate" href="/cli/validate">
    Lint boards and policies without a server. CI-friendly.
  </Card>

  <Card title="diagnose" href="/cli/diagnose">
    Environment and substrate health.
  </Card>

  <Card title="logs" href="/cli/logs">
    Recent lines from the persistent log.
  </Card>

  <Card title="explain" href="/cli/explain">
    Self-contained HTML map of the substrate.
  </Card>
</CardGroup>

## Global Behaviour

**Working directory is the addressing scheme.** Every command operates on the `.substrate/` in the directory it runs from. There is no `--project` flag and no global registry. That rule is also how you point a process at another checkout — see [Worktrees and Clones](/agents/worktrees-and-clones).

**Unknown flags are rejected** per command, rather than silently ignored.

**Network: none.** No Substrate command fetches anything — including `add` and `init --template`. Templates are always local directories.

### Exit Codes

| Code | Meaning                                                                                                                                 |
| ---- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `0`  | Success. Advisory warnings still exit `0`.                                                                                              |
| `1`  | A handled Substrate error — the message says what and how to fix it. Also a failing `validate`, `diagnose`, or `install-skill --check`. |
| `2`  | An unexpected error. Prints a stack trace.                                                                                              |
