# Tool Inspection Surface

Capsulang is intended to be inspected by agents. The reference CLI exposes stable JSON surfaces for repair loops, graph analysis, release planning, and compileability.

## Core JSON commands

```bash
caps check file.caps --json
caps ir file.caps
caps agent-graph --json file.caps
caps repair-plan --json file.caps
caps doctor --json
caps release-preview --json file.caps
caps compile-plan file.caps --target all
caps cost --json file.caps
caps test file.caps --json
caps manifest file.caps --json
```

## Diagnostics

Use `caps explain` for on-demand learning:

```bash
caps explain E_EFFECT_NOT_DECLARED
caps explain E_TYPE_MISMATCH --json
```

## Formatting

```bash
caps fmt file.caps
caps fmt --check file.caps --json
caps fmt --write file.caps
```

`fmt --check` exits non-zero if the file is valid but not canonicalized.
