## Automation and JSON

Add `--json` to receive one result on stdout. Progress goes to stderr; secrets are omitted. Help and version remain plain text.

Save a result for a script to inspect:

```sh npm
npx --yes dinvolt setup --status --json > setup-result.json
```

```sh bun
bunx dinvolt setup --status --json > setup-result.json
```

```sh pnpm
pnpm dlx dinvolt setup --status --json > setup-result.json
```

```sh yarn
yarn dlx dinvolt setup --status --json > setup-result.json
```

`npx --yes` accepts npm's package-install prompt. Dinvolt also disables its own prompts when a TTY is missing or `CI` is `true` or `1`.

When supplying `create`, `setup` or Vercel choices in a terminal, include `--no-input` or `--json`.

### Result fields

Every result includes `schemaVersion: 1`, `command`, `status`, `project`, `completedSteps`, `database`, `administrators` and `nextSteps`.

Commands may add `configuration` or `details`. Failures include `error`.

For example, inspecting a public-only project returns:

```json
{
  "schemaVersion": 1,
  "command": "setup",
  "status": "completed",
  "project": { "name": "my-site", "path": "/projects/my-site" },
  "completedSteps": [],
  "database": [],
  "administrators": [],
  "details": { "projectType": "public", "connections": [] },
  "nextSteps": ["Use the project's dev script; no database setup is needed."]
}
```

| Status            | What to do                                             |
| ----------------- | ------------------------------------------------------ |
| `completed`       | Continue with the returned next steps.                 |
| `needs-attention` | Inspect pending environment results and next steps.    |
| `failed`          | Inspect the error and completed steps before retrying. |
| `cancelled`       | Inspect persisted state before retrying.               |

### Exit codes and retries

| Exit code | Meaning |
| --- | --- |
| `0` | Success, including deferred creation setup and read-only inspection. |
| `1` | Invalid input, failure or incomplete requested setup. |
| `130` | An interruption was observed. |

A failure can leave completed local or remote operations. During creation, `project` remains `null` until the project is saved.

Continue a saved project with `setup`. After partial Vercel setup, select the existing project with `--project`.


