# `jadpo config`

Check and set local settings.

Settings are what `config.jadpo` declares: values a deployment provides, each read from the environment variable named after it in capitals. `check` lists every setting as set, default, missing or invalid against this machine's values, the process's environment over `.env.local`, and shows each problem with the command that fixes it; it never prints a value. `set` asks for one setting's value at a prompt, hidden when it is secret, checks it against the setting's type and stores it in `.env.local`, which it keeps out of git. A value is never an argument, so it cannot reach a shell history, a log or a chat. `move` makes a constant a setting: a field of its name and type in `config { }` with its value as `default:`, the constant deleted and every read rewritten to `config.<name>`; it refuses, changing nothing, a type a setting can't hold, a name a setting has, and a read in a query, an update by `id`, a backfill or another constant.

```text
jadpo config <action> [field]
```

## Arguments

- `action`: What to do
- `field` (optional): The setting to store a value for, or the constant to move

## On every command

- `--json`: Print data for tools instead of text
- `--help`: Show every flag, with examples
- `--color <when>`: Choose when to use colour

`jadpo config --json` writes one JSON document to standard output instead of text, with the same exit code. The document has `schemaVersion`, `command` (`"config"`), `ok`, `data` (what the command produced, `null` when it failed) and `diagnostics` (each error with its `rule`, `reason`, `next` and `help`). A command that needs a terminal refuses `--json` and names the flags that do the same job.

## Examples

```text
# See which settings still need a value
jadpo config check
# Store a secret without typing it anywhere it is kept
jadpo config set session_signing_key
# List the settings as data for tools
jadpo config check --json
# Make a constant a value each deployment can set
jadpo config move limits.max_retries
```

## Errors

- [`cli.config_arguments`](../errors/cli.config_arguments.md): Config command has invalid arguments
- [`configuration.move_type_unsupported`](../errors/configuration.move_type_unsupported.md): Constant's type can't be a setting
- [`configuration.move_name_taken`](../errors/configuration.move_name_taken.md): A setting already has the constant's name
- [`configuration.move_read_unsupported`](../errors/configuration.move_read_unsupported.md): Constant is read where a setting can't be
- [`toolchain.artifact_write_failed`](../errors/toolchain.artifact_write_failed.md): Generated file could not be written
- [`configuration.value_missing`](../errors/configuration.value_missing.md): Required configuration is missing
- [`configuration.value_invalid`](../errors/configuration.value_invalid.md): Configuration value is invalid
- [`cli.config_tty_required`](../errors/cli.config_tty_required.md): Configuration entry requires an interactive terminal
- [`cli.config_prompt_failed`](../errors/cli.config_prompt_failed.md): Secure configuration prompt failed
- [`configuration.local_read_failed`](../errors/configuration.local_read_failed.md): Local configuration could not be read
- [`configuration.local_invalid_encoding`](../errors/configuration.local_invalid_encoding.md): Local configuration is not UTF-8 text
- [`configuration.local_syntax`](../errors/configuration.local_syntax.md): Local configuration syntax is invalid
- [`configuration.local_unsafe_target`](../errors/configuration.local_unsafe_target.md): Local configuration target is unsafe
- [`configuration.local_changed`](../errors/configuration.local_changed.md): Local configuration changed during the update
- [`configuration.local_write_failed`](../errors/configuration.local_write_failed.md): Local configuration could not be saved
