Configuration
ox loads its configuration from a TOML file passed via -c / --config <path>, the OX_CONFIG environment variable, or XDG auto-discovery ($XDG_CONFIG_HOME/ox/config.toml, falling back to ~/.config/ox/config.toml).
Configuration loading is strictly read-only: ox follows symlinks and never creates or mutates files inside its configuration directory, so Nix, Home Manager, or dotfile-managed read-only trees work without wrapper scripts.
Directory Layout and Layering
Section titled “Directory Layout and Layering”Alongside config.toml, a configuration root may organize definitions into drop-ins and per-kind directories:
$XDG_CONFIG_HOME/ox/├── config.toml # Base settings and optional inline tables├── config.d/*.toml # Preference drop-ins, merged in filename order├── providers/<name>.toml # One ProviderConfig per file (stem = provider name)├── models/<name>.toml # One ModelConfig per file (stem = model key)├── profiles/<name>.toml # One profile per file (`model = "<key>"`)├── hooks/<name>.toml # One HookConfig per file, appended in filename order├── plugins/<name>.toml # One PluginConfig per file, appended in filename order├── themes/<name>.toml # Custom theme files, resolvable by bare stem name└── tui/<name>.toml # Custom TUI preset files, resolvable by bare stem nameHidden files (leading .) and non-.toml files are ignored. Layers merge deterministically from lowest to highest precedence:
- Declared
package_roots(in list order, deduplicated by canonical path) config.tomlconfig.d/*.toml(lexicographical filename order)- Per-kind directories (
providers/,models/,profiles/,hooks/,plugins/,themes/,tui/) - CLI flags (
--model,--profile,--base-url,--api-key,--reasoning-effort)
Map entries (providers, models, profiles) override by key, lists (hooks, plugins) append in order, and scalars (default_model, theme) take the highest-precedence non-empty value.
Package Roots
Section titled “Package Roots”package_roots lists directories that bundle reusable declarative configuration and resources using the same layout:
<package-root>/├── package.toml # Optional manifest (`name = "..."`)├── config.toml # Named entries and list items only├── config.d/*.toml # Additional drop-in entries├── providers/<name>.toml # Reusable provider definitions├── models/<name>.toml # Reusable model definitions├── profiles/<name>.toml # Reusable profile definitions├── hooks/<name>.toml # Reusable hooks├── plugins/<name>.toml # Reusable plugins├── themes/<name>.toml # Themes selectable by bare name├── tui/<name>.toml # TUI presets selectable by bare name├── skills/ # Skill directories (`SKILL.md`)├── prompts/ # Prompt section overrides└── AGENTS.md # Package-level instructionsRelative package root paths resolve against the configuration root directory. Symlinks are followed and roots are deduplicated by canonical path. Setting default_model, theme, [memory], attachments.policy, attachments.max_bytes, or package_roots inside a package root fails with an error naming the package and file. Named entries, list items (including [attachments.converters]), and top-level defaults under [compaction], [tui], and [statusline] are allowed and can be overridden by user configuration.
Example
Section titled “Example”default_model = "gemini"theme = "catppuccin-mocha"
[providers.google]wire = "google"api_key_file = "/path/to/gemini.key"timeout_ms = 30000max_retries = 3retry_base_delay_ms = 500
[providers.openai]wire = "openai"auth_command = ["op", "read", "op://vault/openai/api-key"]base_url = "https://api.openai.com/v1"extra_headers = { "X-Custom-Header" = "value" }extra_ca_certs = ["/path/to/ca.pem"]no_proxy = false
[providers.anthropic]wire = "anthropic"api_key = "sk-ant-..."
[models.gemini]provider = "google"model = "gemini-4-neon"max_output_tokens = 8192reasoning_effort = "medium"
[models.gemini-fast]provider = "google"model = "gemini-4-hydrogen"
[profiles]default = "gemini"fast = "gemini-fast"
[[hooks]]event = "PreToolUse"matcher = "mcp__*"command = ["/path/to/check-mcp-tool.sh"]timeout_ms = 5000on_error = "block"
[[plugins]]name = "mcp"command = ["ox-plugin-mcp", "--config", "/path/to/mcp.toml"]timeout_ms = 30000env = { RUST_LOG = "info" }Top-Level Fields
Section titled “Top-Level Fields”| Field | Type | Default | Description |
|---|---|---|---|
default_model |
string |
None | Key in [models.<name>] used when --model is not passed on the CLI |
theme |
string |
None | Built-in or custom theme name (default "catppuccin-mocha"), bare themes/<name>.toml stem, or path to a TOML file. See Themes. |
package_roots |
path[] |
[] |
Declarative package root directories loaded in list order before user configuration |
Models and Providers
Section titled “Models and Providers”[providers.<name>]
Section titled “[providers.<name>]”Each table under [providers.<name>] defines connection, authentication, and TLS settings for a named provider.
| Field | Type | Default | Description |
|---|---|---|---|
wire |
string |
Required | Wire protocol: "google", "openai", or "anthropic" |
base_url |
string |
None | Endpoint URL overriding the wire’s default base URL |
api_key |
string |
None | Inline API key (redacted in debug output) |
api_key_file |
path |
None | Path to a file containing the API key |
auth_command |
string[] |
None | Command whose stdout prints a bearer token or API key |
extra_headers |
map<string, string> |
None | Additional HTTP headers sent with every request (values redacted) |
extra_ca_certs |
path[] |
None | PEM CA certificate files used for TLS verification |
no_proxy |
boolean |
false |
Disable system and environment HTTP proxies |
timeout_ms |
integer |
None | Per-request HTTP timeout in milliseconds |
max_retries |
integer |
None | Maximum number of retry attempts for transient HTTP or transport errors |
retry_base_delay_ms |
integer |
None | Base backoff delay in milliseconds between retry attempts |
Credential Resolution Precedence
Section titled “Credential Resolution Precedence”Provider credentials are resolved in the following order, trimming surrounding whitespace:
api_keyapi_key_fileauth_command
If none of these fields are set in the provider entry, --api-key from the CLI is used when supplied.
[models.<name>]
Section titled “[models.<name>]”Each table under [models.<name>] binds a provider name to a wire-level model identifier.
| Field | Type | Default | Description |
|---|---|---|---|
provider |
string |
Required | Key into [providers.<name>] |
model |
string |
Required | Wire-level model identifier |
max_output_tokens |
integer |
None | Default maximum output token cap |
reasoning_effort |
string |
None | Default reasoning effort: off, minimal, low, medium, high, xhigh, or max |
[profiles]
Section titled “[profiles]”An optional table mapping user-defined profile names to keys in [models.<name>]. When a requested profile is not found, ox falls back to default_model. See the Models reference for catalog and profile details.
Agent Behavior
Section titled “Agent Behavior”[memory]
Section titled “[memory]”Optional per-project memory directory settings. See Project Memory for the field schema, storage layout, and prompt injection behavior.
[attachments]
Section titled “[attachments]”Optional multimodal attachment resolution settings controlling how non-text attachments are validated, passed through natively, or converted by plugins.
| Field | Type | Default | Description |
|---|---|---|---|
policy |
string |
"auto" |
Resolution policy: "auto", "native_only", "plugin_first", or "error" |
max_bytes |
integer |
20971520 |
Maximum payload size in bytes for native pass-through (default 20 MiB). Oversized inputs may convert. |
converters |
map<string, string> |
{} |
Optional MIME media type or wildcard pattern ("video/*") mapped to a configured plugin name override |
auto: passes through natively when the model supports the media type and the payload fits withinmax_bytes, otherwise routes to a matching converter plugin or errors if none is available.native_only: passes through natively when supported and withinmax_bytes, never invoking converter plugins.plugin_first: tries a matching converter plugin first, falling back to native pass-through when supported and withinmax_bytes.error: rejects all non-text attachments with an error.
[compaction]
Section titled “[compaction]”Optional conversation compaction settings controlling automatic context window compaction and summarization prompts. See Compaction for trigger thresholds, cut-point rules, deterministic preservation, and plugin overrides.
| Field | Type | Default | Description |
|---|---|---|---|
enabled |
boolean |
true |
Enable automatic compaction when latest-turn context fill reaches the effective threshold |
auto_compact_pct |
integer |
85 |
Percentage of the model context window (0..=100) that triggers automatic compaction |
reserve_tokens |
integer |
16384 |
Minimum token headroom reserved below the model context window |
keep_recent_tokens |
integer |
20000 |
Approximate token budget of recent messages preserved verbatim during compaction |
prompt |
string |
None | Optional inline summarization prompt overriding the built-in compaction template |
prompt_file |
path |
None | Optional path to a summarization prompt file overriding both prompt and the built-in default template |
Extensions
Section titled “Extensions”[[hooks]]
Section titled “[[hooks]]”Each [[hooks]] entry defines an out-of-process command hook that runs on an agent lifecycle event. See Command Hooks for the full field schema, supported events, matcher rules, and error policies.
[[plugins]]
Section titled “[[plugins]]”Each [[plugins]] entry defines a long-lived stdio JSON-RPC 2.0 plugin process whose advertised tools are registered into the agent tool registry and shut down cleanly on exit. See Plugin Protocol for the full field schema and wire protocol.
Optional declarative TUI settings and preset selection. See TUI for the field schema, built-in presets, and precedence order.
[statusline]
Section titled “[statusline]”Optional TUI statusline layout style, segment configuration, context usage thresholds, or external command replacement. See Statusline for the full field schema and JSON payload format.
[keybindings]
Section titled “[keybindings]”Optional table mapping kebab-case TUI action names to one or more key chord or key sequence strings, or [] to unbind an action. Each configured action replaces all default bindings for that action. See Customizing Keybindings for action names and chord syntax.