# noust preview

Pull request previews: a short-lived copy of an application per pull request.

```bash
noust preview [OPTIONS] COMMAND [ARGS]...
```

Subcommands: [`approve`](#noust-preview-approve), [`create`](#noust-preview-create), [`disable`](#noust-preview-disable), [`dns`](#noust-preview-dns), [`enable`](#noust-preview-enable), [`list`](#noust-preview-list), [`logs`](#noust-preview-logs), [`pulls`](#noust-preview-pulls), [`redeploy`](#noust-preview-redeploy), [`reject`](#noust-preview-reject), [`remove`](#noust-preview-remove), [`start`](#noust-preview-start), [`stop`](#noust-preview-stop), [`sweep`](#noust-preview-sweep), [`vars`](#noust-preview-vars)

## noust preview approve

Approve the commit of a pull request that waits, and build it.

```bash
noust preview approve [OPTIONS] PREVIEW_DOMAIN
```

Arguments: `preview_domain`

| Option | What it does | Default |
|---|---|---|
| `--no-wait` | Record it and return; a console build follows. |  |
| `-v`, `--verbose` | Show the detail of each step. |  |
| `--dry-run` | Rehearse without changing anything. Read-only checks still run. |  |
| `--no-color` | Never emit colour. |  |
| `--json` | Print the preview as JSON. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust preview create

Make a preview by hand, from an open pull request, a branch or a tag.

```bash
noust preview create [OPTIONS] DOMAIN
```

Arguments: `domain`

| Option | What it does | Default |
|---|---|---|
| `--pr` | An open pull request's number. |  |
| `--branch` | A branch. |  |
| `--tag` | A tag. |  |
| `--allow-fork` | Preview a pull request whose branch is in a fork. |  |
| `--no-wait` | Record it and return; a console build follows. |  |
| `-v`, `--verbose` | Show the detail of each step. |  |
| `--dry-run` | Rehearse without changing anything. Read-only checks still run. |  |
| `--no-color` | Never emit colour. |  |
| `--json` | Print the preview as JSON. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust preview disable

Turn previews off for an application and remove the previews it has.

```bash
noust preview disable [OPTIONS] DOMAIN
```

Arguments: `domain`

| Option | What it does | Default |
|---|---|---|
| `--yes`, `-y` | Do not ask before removing existing previews. |  |
| `-v`, `--verbose` | Show the detail of each step. |  |
| `--dry-run` | Rehearse without changing anything. Read-only checks still run. |  |
| `--no-color` | Never emit colour. |  |
| `--json` | Print the previews removed as JSON. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust preview dns

Does the wildcard record of the previews of DOMAIN reach this server?

```bash
noust preview dns [OPTIONS] DOMAIN
```

Arguments: `domain`

| Option | What it does | Default |
|---|---|---|
| `--json` | Print the verdict as JSON. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust preview enable

Turn previews on for an application, or change their settings.

```bash
noust preview enable [OPTIONS] DOMAIN
```

Arguments: `domain`

| Option | What it does | Default |
|---|---|---|
| `--domain` | Base domain previews answer under; *.BASE must point at this server. Required to turn previews on; kept when changing other settings. |  |
| `--max` | How many previews may exist at once (1 to 20). [default: 3, or the current value] |  |
| `--ttl` | How long a preview lives without a push: 12h, 7d, 2w (1 hour to 90 days). [default: 7d, or the current value] |  |
| `--allow-bots`, `--no-allow-bots` | Build previews of pull requests opened or pushed to by bot accounts (Dependabot, Renovate). [default: no, or the current value] |  |
| `--exclude-env` | A variable never copied to previews; repeat for more. Replaces the current list; existing previews lose them at their next push. |  |
| `--no-exclude-env` | Copy every variable again (clear the excluded list). |  |
| `--env-mode` | Which of the application's variables a preview is given: 'allowlist' (only --allow-env, the default for previews turned on now) or 'all' (every one less --exclude-env, as before 4.0). |  |
| `--allow-env` | A variable an 'allowlist' preview copies; repeat for more. Replaces the current list. |  |
| `--no-allow-env` | Copy no variable of the application's (clear the allowed list). |  |
| `--data` | 'empty' gives each preview a database of its own, 'clone' a database of its own that starts as a copy of the application's, 'shared' lets it use the application's (a pull request can then write into production's). Default for previews turned on now: empty, when the application has a database. |  |
| `--domain-template` | How a preview is named, such as '{{pr_id}}-{{name}}.{{base}}' ({{pr_id}}, {{random}}, {{domain}}, {{name}}, {{base}}); '' goes back to pr-<n>-<name>.BASE. Applies to the previews made from now on. |  |
| `--noindex`, `--index` | Tell search engines to leave previews alone (X-Robots-Tag). [default: noindex] |  |
| `--forks` | 'refuse' (a pull request from a fork, or from someone not trusted with the repository, gets no preview) or 'approve' (it waits for an operator to approve each commit: noust preview approve). [default: refuse] |  |
| `-v`, `--verbose` | Show the detail of each step. |  |
| `--dry-run` | Rehearse without changing anything. Read-only checks still run. |  |
| `--no-color` | Never emit colour. |  |
| `--json` | Print the settings as JSON. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust preview list

List previews, of one application or of every one.

```bash
noust preview list [OPTIONS] [DOMAIN]
```

Arguments: `domain`

| Option | What it does | Default |
|---|---|---|
| `--json` | Print the settings and previews as JSON. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust preview logs

Show what a preview's process printed, or the log of its last build.

```bash
noust preview logs [OPTIONS] PREVIEW_DOMAIN
```

Arguments: `preview_domain`

| Option | What it does | Default |
|---|---|---|
| `--lines` | Journal lines. | `100` |
| `--build` | Show the log of its last build instead. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust preview pulls

List the open pull requests of an application's repository (GitHub App).

```bash
noust preview pulls [OPTIONS] DOMAIN
```

Arguments: `domain`

| Option | What it does | Default |
|---|---|---|
| `--json` | Print the pull requests as JSON. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust preview redeploy

Build a preview again, from the head of its branch as it is now.

```bash
noust preview redeploy [OPTIONS] PREVIEW_DOMAIN
```

Arguments: `preview_domain`

| Option | What it does | Default |
|---|---|---|
| `-v`, `--verbose` | Show the detail of each step. |  |
| `--dry-run` | Rehearse without changing anything. Read-only checks still run. |  |
| `--no-color` | Never emit colour. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust preview reject

Turn down the commit of a pull request that waits; the pull request is told.

```bash
noust preview reject [OPTIONS] PREVIEW_DOMAIN
```

Arguments: `preview_domain`

| Option | What it does | Default |
|---|---|---|
| `-v`, `--verbose` | Show the detail of each step. |  |
| `--dry-run` | Rehearse without changing anything. Read-only checks still run. |  |
| `--no-color` | Never emit colour. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust preview remove

Remove one preview now: its application, certificate and record.

```bash
noust preview remove [OPTIONS] PREVIEW_DOMAIN
```

Arguments: `preview_domain`

| Option | What it does | Default |
|---|---|---|
| `-v`, `--verbose` | Show the detail of each step. |  |
| `--dry-run` | Rehearse without changing anything. Read-only checks still run. |  |
| `--no-color` | Never emit colour. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust preview start

Start a preview that was stopped.

```bash
noust preview start [OPTIONS] PREVIEW_DOMAIN
```

Arguments: `preview_domain`

| Option | What it does | Default |
|---|---|---|
| `-v`, `--verbose` | Show the detail of each step. |  |
| `--dry-run` | Rehearse without changing anything. Read-only checks still run. |  |
| `--no-color` | Never emit colour. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust preview stop

Stop a preview without removing it.

```bash
noust preview stop [OPTIONS] PREVIEW_DOMAIN
```

Arguments: `preview_domain`

| Option | What it does | Default |
|---|---|---|
| `-v`, `--verbose` | Show the detail of each step. |  |
| `--dry-run` | Rehearse without changing anything. Read-only checks still run. |  |
| `--no-color` | Never emit colour. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust preview sweep

Remove expired previews, and those whose application is gone.

```bash
noust preview sweep [OPTIONS]
```

| Option | What it does | Default |
|---|---|---|
| `-v`, `--verbose` | Show the detail of each step. |  |
| `--dry-run` | Rehearse without changing anything. Read-only checks still run. |  |
| `--no-color` | Never emit colour. |  |
| `--json` | Print the previews removed as JSON. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust preview vars

The variables the previews of an application are given besides its own.

```bash
noust preview vars [OPTIONS] COMMAND [ARGS]...
```

Subcommands: [`list`](#noust-preview-vars-list), [`set`](#noust-preview-vars-set), [`unset`](#noust-preview-vars-unset)

## noust preview vars list

List the variables defined for the previews of an application (secrets hidden).

```bash
noust preview vars list [OPTIONS] DOMAIN
```

Arguments: `domain`

| Option | What it does | Default |
|---|---|---|
| `--json` | Print the variables as JSON. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust preview vars set

Define a variable previews are given; it wins over the application's own.

```bash
noust preview vars set [OPTIONS] DOMAIN NAME [VALUE]
```

Arguments: `domain`, `name`, `value`

| Option | What it does | Default |
|---|---|---|
| `--stdin` | Read the value from standard input. |  |
| `--secret`, `--not-secret` | Say whether it is a secret. |  |
| `--audience` | Who sees it. | `both` |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust preview vars unset

Stop giving previews variables.

```bash
noust preview vars unset [OPTIONS] DOMAIN NAMES...
```

Arguments: `domain`, `names`

| Option | What it does | Default |
|---|---|---|
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

