## `dinvolt setup`

Run inside your generated project to complete database credentials, initial tables and the first administrator:

```sh npm
npx dinvolt setup
```

```sh bun
bunx dinvolt setup
```

```sh pnpm
pnpm dlx dinvolt setup
```

```sh yarn
yarn dlx dinvolt setup
```

Public-only projects have nothing to configure. For admin projects, setup preserves existing users and custom code.

### Inspect connection status

This reads connection status without changing files or databases:

```sh npm
npx dinvolt setup --status --json
```

```sh bun
bunx dinvolt setup --status --json
```

```sh pnpm
pnpm dlx dinvolt setup --status --json
```

```sh yarn
yarn dlx dinvolt setup --status --json
```

A successful connection alone does not confirm that tables or an administrator are ready.

### Complete an environment without prompts

```sh npm
npx dinvolt setup --complete development \
  --credentials-file ../database-credentials.json --json
```

```sh bun
bunx dinvolt setup --complete development \
  --credentials-file ../database-credentials.json --json
```

```sh pnpm
pnpm dlx dinvolt setup --complete development \
  --credentials-file ../database-credentials.json --json
```

```sh yarn
yarn dlx dinvolt setup --complete development \
  --credentials-file ../database-credentials.json --json
```

To also create the first administrator, add the [administrator options](/reference/create#credentials-and-administrator-output). Its environments must also appear in `--complete`.

| Option | Purpose |
| --- | --- |
| `--status` | Inspect connections. Cannot be combined with changes. |
| `--add-environments <environments>` | Enable comma-separated `development`, `staging`, `production`. |
| `--complete <environments>` | Verify credentials and initialize/check selected databases. |
| `--credentials-file <path>` | Supply credentials. Otherwise, use effective project/inherited values. |
| `--use-private-env` | Use an ignored alternative if the existing dotenv file is tracked. Requires `--complete`. |

Without an action, non-interactive setup only inspects connections. Initialization applies a compatible initial migration; incompatible schemas and later migrations need manual review.

Restart your development server after changing environment values. See [Database](/guides/database) and [Authentication](/guides/authentication) for application configuration.


