Skip to content

Configuration file ​

quarry reads ~/.config/quarry/config.toml (or $XDG_CONFIG_HOME/quarry/config.toml). The first time it runs it writes this file with every option and a comment explaining it. Every option is optional: delete a line to get the default back.

  • quarry --default-config prints that commented file, so you can start over from it any time: quarry --default-config > ~/.config/quarry/config.toml.
  • --config FILE uses a different file for one run.
  • QUARRY_CONFIG_DIR changes the whole config directory.
  • A syntax error stops quarry with the file, line and column. Unknown keys are ignored.
  • quarry rewrites the file when you use --save, --setup-llm or the TUI's connection manager. It keeps the previous version as config.toml.bak, but comments are not kept.

[main] ​

Appearance ​

KeyDefaultValuesMeaning
theme"tokyo-night"A theme nameColour theme for the REPL, and for the TUI until you pick one there
table_format"rounded"An output formatHow results are printed in the REPL
row_linestruetrue, falseA line between rows in the boxed formats (rounded, unicode, double, ascii)
icons"nerd"nerd, unicode, asciiIcons in the prompt, the TUI and messages. nerd needs a Nerd Font.
expanded"auto"on, off, autoVertical output. auto: when a table is wider than the terminal.
null_string"NULL"Any textHow NULL is shown
max_field_width500Number, 0 = no limitCut longer values and add …. Machine formats are never cut.
less_chattyfalsetrue, falseSkip the banner and goodbye message
prompt"auto"auto or a formatThe REPL prompt. See the prompt.
prompt_continuation"… "Any textPrefix for the second and later lines of a statement (custom prompts)

Behaviour ​

KeyDefaultValuesMeaning
row_limit1000Number, 0 = never askAsk before showing more rows than this (REPL)
timingtruetrue, falseShow how long each statement took
multi_linetruetrue, falseEnter runs only finished statements
vifalsetrue, falseVi keys in the REPL and vim mode in the TUI's editor
enable_pagertruetrue, falsePage output that doesn't fit the screen
pagernot setA commandPager command. Not set: $PAGER, then less -SRXF.
history_size10000Number (minimum 100)History entries to keep
log_queriesfalsetrue, falseAppend every statement to quarry.log in the data directory
destructive_warningsee belowList of rulesStatements that ask before running. [] never asks. See Staying safe.

destructive_warning defaults to:

toml
destructive_warning = ["drop", "truncate", "shutdown", "unconditional_update", "unconditional_delete"]

Completion ​

KeyDefaultMeaning
smart_completiontrueSuggest by context. Off: every keyword, table and column.
complete_while_typingtrueOpen the completion menu as you type (Tab always opens it)
join_suggestionstrueSuggest JOIN … ON … clauses from foreign keys
keyword_casing"auto"upper, lower or auto (follow what you type)
auto_suggesttrueGrey suggestions from history in the REPL
auto_refresh_catalogtrueReload table and column names after CREATE, ALTER, DROP and similar

TUI ​

KeyDefaultMeaning
mousetrueMouse support in the TUI
transparentfalseKeep the terminal's own background instead of the theme's (e.g. a translucent terminal). Also in the palette: Toggle transparent background.

[llm] ​

How \llm reaches a model. quarry --setup-llm writes this section for you. See Asking a model for SQL.

KeyDefaultMeaning
provider"anthropic"anthropic, openai (any OpenAI-compatible API), claude-code or codex
model"claude-opus-5-5"Model name. Empty means the CLI's own default (claude-code, codex).
base_urlnot setServer for the openai provider, e.g. http://localhost:11434/v1

API keys are not stored here; they go in credentials.toml in the data directory.

[keys] ​

TUI key bindings, one line per action: a key or a list of keys, [] for none. A line replaces the action's default keys; a key you bind is taken away from any action that had it by default. See Key bindings and vim mode for the action names and the rules.

toml
[keys]
run_statement = ["ctrl+enter", "ctrl+e"]
run_all = "f9"
themes = "alt+t"

[connections.NAME] ​

One table per saved connection. See Saved connections.

KeyDefaultMeaning
urlThe target: a URL or SQLite file
password_commandnot setShell command that prints the password
sshnot setSSH tunnel: [user@]host[:port]
readonlyfalseOpen in read-only mode
colornot setTag colour in the TUI, e.g. "red": "#rrggbb" or a colour name
init_commands[]SQL to run after connecting

A complete example ​

toml
[main]
theme = "catppuccin-mocha"
table_format = "psql"
row_limit = 5000
vi = true
keyword_casing = "upper"
destructive_warning = ["drop", "truncate", "alter", "unconditional_update", "unconditional_delete"]
prompt = "\\t \\u@\\h:\\d\\T> "

[keys]
run_all = "f9"

[llm]
provider = "openai"
model = "qwen2.5-coder"
base_url = "http://localhost:11434/v1"

[connections.local]
url = "postgres://me@localhost/app"

[connections.prod]
url = "postgres://deploy@db.internal/app?sslmode=verify-full"
password_command = "pass show db/prod"
ssh = "deploy@bastion.example.com"
readonly = true
init_commands = ["SET statement_timeout = '30s'"]

Released under the MIT licence.