# Bruno

Bruno generation is driven by `.soap/registry.json`.

Enable Bruno at project creation:

```bash
soap create users-api --api-client bruno --skip-install
```

Enable it later:

```bash
soap update config --add-api-client bruno
soap generate bruno
```

## Interactive Generation

```bash
soap generate bruno -i
```

Interactive mode analyzes the current collection before writing:

- detected routes
- existing Bruno files
- missing Bruno files
- modified generated Bruno files

Then choose:

- generate missing only
- regenerate all unmodified generated files
- generate E2E flow
- abort

Manual `.bru` edits are detected from the registry hash and are skipped unless you use `--force`.

## E2E Flow

```bash
soap generate bruno --e2e
soap generate bruno -i
```

E2E files are generated for resources with complete CRUD routes.

Auth collections use executable `test("...", fn)` blocks. JSON token delivery stores access and refresh tokens as runtime-only Bruno variables and sends bearer auth. Cookie modes assert `Set-Cookie` and rely on Bruno's per-run cookie jar. The generated auth sequence is `login → me → refresh → logout → me-after-logout (401)`; health is tested as well.

## Overwrite Behavior

```bash
soap generate bruno --force
soap generate bruno --write-new
soap generate bruno --on-conflict skip
```

Default behavior skips modified generated files.
