CLI configuration
Where the cruxy CLI reads settings from, the order they merge in, the environment variables it honors, and the defaults for each setting.
The CLI reads its settings from JSON config files and a few environment
variables, merges them over built-in defaults, and validates the result before
it does anything else. Your API key is never one of these settings: it comes
from CRUXY_API_KEY or the credential that cruxy login saves; see
Sign in from the CLI.
Config files
| File | Scope | How it is found |
|---|---|---|
~/.cruxy/config.json | Global: every project for your user. | Always read when it exists. |
cruxy.config.json or .cruxy/config.json | Project. | The first one found, checking the current directory and then each parent up to the filesystem root. cruxy.config.json is checked first in each directory. |
The file named by --config <path> | Explicit. | Replaces project discovery for that run. The path is resolved as given, and a missing file fails with CRUXY_E_CONFIG_NOT_FOUND. |
Each file holds one JSON object. Unknown keys and out-of-range values fail with
CRUXY_E_CONFIG_INVALID, which names each bad field and the file to start
with, and malformed JSON fails with CRUXY_E_CONFIG_PARSE. Both exit 3.
cruxy config path prints the global config path, the project file it found
(if any), and the file named by --config when there is one:
cruxy config pathPrecedence
Later layers win:
- Built-in defaults.
- The global file,
~/.cruxy/config.json. - The project file, or the file named by
--config. - Environment variables that map to a setting.
Objects merge key by key; an array or a single value replaces the earlier one. To see each resolved value and the layer it came from, run:
cruxy config list --originChange a setting
cruxy config set writes one value by its dot path. It validates the file
before writing, and turns true, false, and numbers into JSON booleans and
numbers.
# Global: ~/.cruxy/config.json
cruxy config set model.model saga
# Project: the discovered project file, or ./cruxy.config.json if there is none
cruxy config set --project test.command "pnpm test"cruxy config get <key> reads one resolved value, and cruxy config init
writes every default to ~/.cruxy/config.json if that file does not exist yet.
You can also edit the files by hand.
Environment variables
These override config or supply values the CLI reads only from the environment.
| Variable | Effect |
|---|---|
CRUXY_API_KEY | The API key. Wins over the saved credential. Never read from a config file. |
CRUXY_MODEL | Overrides model.model. |
CRUXY_PROVIDER | Overrides model.provider. The only accepted value is cruxy. |
CRUXY_LOG_LEVEL | Overrides logLevel. debug also makes errors show the underlying error. |
DEBUG | Any value other than empty, 0, or false makes errors show the underlying error. |
GITHUB_TOKEN, GH_TOKEN | The GitHub token cruxy pr uses. Without either, it tries gh auth token. |
TAVILY_API_KEY | The web search key, when web.enabled is on. web.apiKeyEnv names a different variable. |
HTTPS_PROXY, HTTP_PROXY, NO_PROXY | Honored when the CLI downloads the embedding model for semantic search. |
These change how the terminal output looks, not what the agent does.
TERM=dumb and screen-reader mode also turn off the full-screen session, so
cruxy falls back to plain output:
| Variable | Effect |
|---|---|
NO_COLOR | No ANSI color at all. |
FORCE_COLOR | Keep color when output is piped or redirected. |
CRUXY_ASCII | ASCII glyphs such as [ok] and -> instead of Unicode marks. |
CRUXY_SCREEN_READER, ACCESSIBLE | Screen-reader mode: status marks are spoken as words, decorative marks are dropped, and animation is off. |
NO_MOTION, CRUXY_REDUCED_MOTION, CRUXY_NO_SPINNER | No animation: spinners draw their end state once. |
CRUXY_NO_ALT_SCREEN | Keep the full-screen session in the normal terminal buffer. |
CRUXY_NO_MOUSE | Leave the mouse to the terminal, so text selection works without Shift. |
COLUMNS, LINES | Override the terminal size. Each takes a positive integer. |
TERM=dumb | No color, no cursor control, and ASCII glyphs. |
Except for COLUMNS, LINES, and TERM, any non-empty value turns a
variable on, including 0 and false; unset it or set it to the empty string
to turn it off. COLUMNS and LINES ignore a value that is not a positive
integer.
Model and routing
model.model is the tier every turn asks for: canto (Deep), saga
(Balanced), epos (Fast), or auto, the default, which lets the gateway pick
the tier for each request. To compare the tiers, see
Choosing a tier.
cruxy config set model.model canto/model changes it for the current session only. routing sends kinds of
work to different tiers. Its keys are the task classes main-turn, subagent,
plan, commit-msg, and summarize:
{
"routing": {
"default": "saga",
"map": {
"commit-msg": "epos",
"summarize": "epos"
}
}
}A class not in map takes routing.default. With no default, it takes the
tier model.model names, or goes out as auto when model.model is auto. A
class mapped to a tier the gateway does not offer fails with
CRUXY_E_ROUTING_TIER_UNAVAILABLE, never a silent substitute.
Former tier names
model.model, routing.default, and routing.map still accept the former names kavi, vaani, and mira,
and load them as canto, saga, and epos; see
Deprecated aliases. The same
goes for CRUXY_MODEL and for a name typed after /model, which switches to
the new tier and names it. If your team shares a project cruxy.config.json,
keep the former names in routing.default and routing.map until everyone runs
1.18.0 or later: 1.17 and earlier refuse to start on a config that sets them to
canto, saga, or epos.
Gateway URL
cruxy.gatewayUrl is where every request goes, and defaults to
https://api.cruxy.ai. A config that sets it to exactly https://api.cruxy.in
(with or without a trailing slash), the legacy name of the same service, is
resolved to https://api.cruxy.ai with a one-line warning; the file itself is
not edited.
The CLI sends a credential only over https://. Plain http:// is allowed
only to localhost, 127.0.0.1, and [::1], for a gateway on your own
machine. Any other URL fails before a request is made, with
CRUXY_E_CONFIG_INVALID (exit 3) titled "cruxy.gatewayUrl is not https, so no
credential was sent". This applies to every command that calls the gateway,
including cruxy login, cruxy logout, cruxy limits, and cruxy pr. The
config file still loads, so you can fix the value:
cruxy config set cruxy.gatewayUrl https://api.cruxy.aicruxy config path lists the files in effect, if you are not sure which one
sets it.
Approval is not a setting
approval.mode accepts only prompt. No config key or flag turns approvals
off: cruxy config set approval.mode auto fails with CRUXY_E_CONFIG_INVALID.
Running without prompts is a session mode that you switch on in the session it
affects, and a session resumed with --resume comes back in the last mode you
switched to during it; see
Projects, permissions, and context.
Settings you are most likely to change
| Setting | Default | Description |
|---|---|---|
model.model | auto | The tier: canto, saga, epos, or auto. |
model.maxTokens | 8192 | The max_tokens sent on each chat request. |
model.temperature | 0 | The temperature sent on each chat request, from 0 to 2. |
cruxy.gatewayUrl | https://api.cruxy.ai | The gateway every request goes to. https:// only, except to localhost. |
cruxy.memory.recall | true | Let the gateway recall your memory into each turn. |
cruxy.memory.capture | false | Let the gateway capture memory from each turn. |
cruxy.rules | true | Let the gateway add your organization's standing rules to each turn. |
cruxy.streamIdleTimeoutMs | 90000 | How long a stream may go without a byte before it counts as dead. A stream that dies before its first token is retried; one that dies after it is not. 0 turns it off. |
cruxy.maxRetries | 4 | Retries of a request that failed before its stream opened: a 429, a 5xx, or a connection that never opened. |
cruxy.streamRetries | 2 | Retries of a stream that dropped before its first token. |
agent.maxIterations | 25 | Agent loop turns per message in an interactive session. |
agent.maxIterationsOneShot | 40 | Agent loop turns for a one-shot cruxy run "<task>". |
agent.maxTokensPerTurn | 0 | A cap on input plus output tokens for one turn. 0 is off. |
agent.planMode | false | Start every session in plan mode. |
tools.fileEdit | true | false removes write_file, edit_file, and apply_patch. Reads stay. |
tools.shell | true | false removes run_command and run_tests. |
shell.timeoutMs | 120000 | Kill a command and its process tree after this many milliseconds. |
shell.maxOutputBytes | 102400 | Command output captured; the rest is truncated. |
shell.executable | unset | The shell to run commands through, overriding detection. |
context.maxTokens | 100000 | The approximate context budget, in tokens. |
context.compactThreshold | 0.75 | Summarize older history once it passes this fraction of context.maxTokens. |
git.protectedBranches | [] | Branches the CLI never commits or pushes to directly, added to main and master. |
git.defaultBase | unset | The base branch for generated pull requests. |
test.command | unset | The test command, instead of the test script in package.json. |
checkpoint.enabled | true | Snapshot the working tree before a run's first approved file change, shell command, test run, or pull request, which cruxy rollback restores. |
checkpoint.retention | 10 | Checkpoints to keep. |
sessions.enabled | true | Record sessions so they can be resumed. |
sessions.retention | 50 | Sessions to keep. The minimum is 10. |
sessions.maxAgeDays | 30 | Prune sessions untouched for this many days. |
memory.enabled | true | The CLI's local memory: recall at session start and the remember tool. |
memory.maxRecallTokens | 1000 | Token budget for recalled local memory. |
index.enabled | true | search_codebase and cruxy index. |
sandbox.enabled | false | Run shell and test commands in a container, as --sandbox does. |
sandbox.network | none | Container network: none, host-loopback, or full. |
hooks.enabled | false | Run configured hooks. |
mcp.enabled | false | Connect configured MCP servers. |
web.enabled | false | Give the agent web_search and web_fetch. |
usage.enabled | true | Record token usage locally for cruxy usage. |
usage.prices | unset | No longer used: cost is the gateway's own figure. Still accepted, and cruxy usage notes that you can remove it. The same goes for usage.currency. |
logLevel | info | debug, info, warn, error, or silent. |
Every default
cruxy config init writes this file in 1.19.0. cruxy config list prints every
key with its resolved value.
{
"model": { "provider": "cruxy", "model": "auto", "maxTokens": 8192, "temperature": 0 },
"cruxy": {
"gatewayUrl": "https://api.cruxy.ai",
"streamIdleTimeoutMs": 90000,
"maxRetries": 4,
"minRetryDelayMs": 1000,
"maxRetryDelayMs": 20000,
"streamRetries": 2,
"memory": { "recall": true, "capture": false },
"rules": true
},
"agent": { "maxIterations": 25, "maxIterationsOneShot": 40, "maxTokensPerTurn": 0, "planMode": false },
"tools": { "fileEdit": true, "shell": true },
"git": { "autoCommit": false, "protectedBranches": [] },
"shell": { "timeoutMs": 120000, "maxOutputBytes": 102400 },
"context": { "maxTokens": 100000, "compactThreshold": 0.75, "reserveTokens": 4500, "keepRecentMessages": 6 },
"approval": { "mode": "prompt" },
"index": {
"enabled": true,
"embedder": "fastembed",
"store": "auto",
"maxFileBytes": 1048576,
"chunk": { "windowLines": 60, "overlapLines": 15 },
"search": { "defaultK": 8, "tokenBudget": 1500, "maxSnippetLines": 40 }
},
"lsp": {
"enabled": false,
"servers": {},
"startupTimeout": 15000,
"requestTimeout": 10000,
"maxServers": 4,
"idleTimeout": 300000,
"maxResults": 100
},
"checkpoint": { "enabled": true, "retention": 10 },
"sessions": { "enabled": true, "retention": 50, "maxAgeDays": 30 },
"subagent": { "maxDepth": 1, "maxConcurrency": 3, "defaultBudget": { "maxIterations": 10, "maxTokens": 32000 } },
"jobs": { "enabled": false, "maxJobs": 5, "logBufferLines": 1000, "logFileLines": 20000 },
"test": { "maxIterations": 4, "captureBytes": 65536 },
"sandbox": {
"enabled": false,
"image": "node:20-bookworm-slim",
"network": "none",
"memory": "512m",
"pids": 512,
"cpus": 1,
"mounts": []
},
"hooks": { "enabled": false, "trustPrompt": true },
"routing": { "map": {} },
"memory": { "enabled": true, "maxRecallTokens": 1000 },
"usage": { "enabled": true, "retention": 50 },
"mcp": {
"enabled": false,
"servers": {},
"startupTimeout": 15000,
"requestTimeout": 30000,
"maxToolsPerServer": 32,
"maxDescriptionChars": 1024,
"maxSchemaBytes": 8192
},
"web": {
"enabled": false,
"provider": "tavily",
"apiKeyEnv": "TAVILY_API_KEY",
"maxResults": 5,
"snippetMaxChars": 500,
"fetchMaxBytes": 524288,
"timeoutMs": 15000,
"maxRedirects": 3,
"allowPrivateHosts": false
},
"logLevel": "info"
}Keys with no default appear only once you set them, such as
git.defaultBase, shell.executable, shell.dialect, test.command,
routing.default, subagent.defaultBudget.timeoutMs, sandbox.timeout, and
usage.prices. Until then, cruxy config get on one of them fails with
CRUXY_E_CONFIG_KEY_UNKNOWN, exit 2.