Registry stack documentation: machine-readable Markdown.
Index of all pages: https://docs.registrystack.org/llms.txt
Full corpus: https://docs.registrystack.org/llms-full.txt

# bregctl provision command reference

> Generated syntax and options for bregctl provision.

{/* Generated from crates/registry-cli-docs/catalog.json and the workspace version in Cargo.toml by scripts/generate-cli-reference.mjs. Run npm run generate. */}

Create the PostgreSQL roles, database and schemas a Registry needs, from its runtime file.

## Contract status

This page is generated from the public Clap command tree for Registry Stack source version `0.49.0` and catalog SHA-256 `5ee58a079f1cede7ba2da71f1d8945c0b683f5f54e8d871fdbcb8648c998872c`. Hidden implementation commands are omitted.

## Description

Create the PostgreSQL roles, database and schemas a Registry needs, from its runtime file. The runtime file's two database URLs name both roles, the database and both passwords. The administrator URL comes from a file or an environment variable, never from the command line. The command grants the runtime role CONNECT on the database: apply grants the rest. With --package, a package that needs PostGIS also gets its schema, extension and bounding-box role, which CREATE EXTENSION postgis needs a superuser for, and both roles get USAGE on the PostGIS schema.

## Usage

```text
bregctl provision [OPTIONS] --runtime-config <FILE>
```

## Constraints

| Condition | Requirement |
| --- | --- |
| Command invocation | `--admin-url-env <ADMIN_URL_ENV>` and `--admin-url-file <ADMIN_URL_FILE>` cannot be used together. |
| Command invocation | `--admin-url-env <ADMIN_URL_ENV>` and `--print-sql` cannot be used together. |
| Command invocation | `--admin-url-file <ADMIN_URL_FILE>` and `--print-sql` cannot be used together. |

## Options

| Option | Always required | Default | Values | Environment | Description |
| --- | --- | --- | --- | --- | --- |
| `--runtime-config <FILE>` | Yes | n/a | n/a | n/a | Runtime configuration file, the one the service runs with. A symbolic link at any component of this path is refused. |
| `--admin-url-file <ADMIN_URL_FILE>` | No | n/a | n/a | n/a | File holding the administrator PostgreSQL URL |
| `--admin-url-env <ADMIN_URL_ENV>` | No | n/a | n/a | n/a | Name of the environment variable holding the administrator PostgreSQL URL |
| `--print-sql` | No | n/a | n/a | n/a | Print the SQL script and connect to nothing |
| `--posture <POSTURE>` | No | n/a | n/a | n/a | Declared posture: development or production. Unset means production |
| `--package <ABSOLUTE_DIRECTORY>` | No | n/a | n/a | n/a | Absolute target package directory; a package that needs PostGIS adds the PostGIS steps. A symbolic link at any component of this path is refused. |
| `--format <FORMAT>` | No | `human` | `human`, `json` | n/a | Emit the selected command's report in this format |
| `-h, --help` | No | n/a | n/a | n/a | Print help (see a summary with '-h') |

## Generation contract

After changing a public command, argument, option, default, environment binding, or help description, run `cargo run --locked -p registry-cli-docs -- --write`, commit `crates/registry-cli-docs/catalog.json`, then run `npm run generate` from `docs/site`.