# CLI reference

Commands, significant flags, and exit behavior.

| Command | Purpose |
| --- | --- |
| patchflow init | Write a starter configuration |
| patchflow run | Run one package migration |
| patchflow watch | Poll and migrate configured packages |
| patchflow retry | Create a new attempt from a previous run |
| patchflow status | List recent local runs |

## run

```
patchflow run -p <package> [--from <version>] [--to <version>]
  [--repo <url>] [--starting-ref <ref>]
  [--setup-command <command>] [--test-command <command>]
  [--test-gate auto|checks|local] [--config <path>] [--force]
```

## watch

```
patchflow watch [--once] [--config <path>]
```

## retry

```
patchflow retry <run-id-or-prefix> [--config <path>] [--force]
```

## Exit codes

| Result | Code |
| --- | --- |
| ready | 0 |
| needs_attention or error | 1 |
