# CLI scripting — CapInt power user

## Environment flags

| Variable | Values | Effect |
|----------|--------|--------|
| `CAPINT_DEBUG` | `1`, `true` | stderr debug JSON on `route` / `pipeline` |
| `CAPINT_DEFAULT_CONFIRM` | `apply_now`, `plan_first`, `analyze_only` | Overrides matrix default confirm option |
| `CAPINT_LOCAL_CONTEXT` | `1` | Enables local context pack on route (v0.4.2+) |

Examples:

```bash
export CAPINT_DEFAULT_CONFIRM=plan_first
capint route "refactor auth module"
```

```powershell
$env:CAPINT_DEBUG = "1"
capint pipeline "prd hazırla"
```

## capint pipeline

Health + optional route in one command:

```bash
capint pipeline                    # doctor + status + ide check
capint pipeline "debug login"      # + route
capint pipeline --json "i18n"      # machine output
capint pipeline --skip-ide         # skip IDE projection check
capint pipeline --force            # exit 0 even on FAIL (CI advisory)
```

## Shell helpers

Shipped in package `scripts/`:

- **`capint-task.sh`** — bash: pipeline preflight + compact route JSON
- **`capint-task.ps1`** — PowerShell equivalent

```bash
./scripts/capint-task.sh "lang files inconsistent"
```

## CI advisory pattern

```bash
capint pipeline "$TASK" --json --force | jq '.pass'
capint route --json "$TASK" | jq '.execution_intent.resolution_status'
```

Fail closed when `resolution_status` is `not_installed`.

## jq one-liners

```bash
capint route --json "prd hazırla" | jq '.execution_intent | {capability, resolution_status, confirm_default_option}'
capint route --json "prd hazırla" | jq '.execution_intent.explanation.files_to_read[]'
```
