Configuration
psql+ reads its configuration from a single TOML file and lets you override any value with environment variables. Out of the box it needs no configuration at all — the defaults give you a fully working psql-compatible shell with autocomplete and readable help. Configuration only comes into play when you want to enable AI or tune behavior.
Where configuration lives
The config file is read from:
~/.config/rillence/config.toml
If the file does not exist, psql+ uses built-in defaults. Create it only when you want to change something.
Sample configuration
[ai]
# AI is opt-in and off by default.
enabled = true
# Which provider to use for the `??` command.
provider = "anthropic"
# Name of the environment variable that holds your API key.
# psql+ reads the key from this variable — it is never written to disk.
api_key_env = "ANTHROPIC_API_KEY"
[history]
# Cross-session history is shared across all your psql+ sessions.
enabled = true
max_size = 10000
[output]
# Default expanded output, equivalent to starting with \x on.
expanded = false
# Show query timing by default, equivalent to \timing on.
timing = false
Environment overrides
Every setting can be overridden by an environment variable prefixed with RILLENCE_. Environment values take precedence over the config file, which makes them handy in CI or per-shell:
export RILLENCE_AI_ENABLED=true
export RILLENCE_AI_PROVIDER=anthropic
export RILLENCE_AI_API_KEY_ENV=ANTHROPIC_API_KEY
The pattern is RILLENCE_<SECTION>_<KEY> in uppercase — for example [ai] enabled becomes RILLENCE_AI_ENABLED.
Bring your own AI provider and key
AI is opt-in. You supply the provider and the key, and psql+ uses your account:
- Set
enabled = trueunder[ai]. - Set
providerto the provider you use. - Export your key in the variable named by
api_key_env, then pointapi_key_envat it.
psql+ reads the key from the environment variable you name; it is never stored in the config file or transmitted anywhere except to the provider you chose, and only when AI is enabled.
Disabling AI entirely
To turn AI off, set enabled = false (the default) or leave the [ai] section out:
[ai]
enabled = false
With AI off, the ?? command is inert. Every non-AI feature keeps working — full psql compatibility, schema-aware autocomplete, readable \h, and cross-session history all run with no key and nothing leaving your machine.