Skip to main content

Settings File

Rusty stores its persistent configuration at ~/.rusty/settings.json. This file is created by the setup wizard on first run.
{
  "api_key": "sk-...",
  "api_base": "https://api.openai.com/v1",
  "default_model": "gpt-4o",
  "allowed_tools": [
    "bash:git status",
    "bash:cargo check"
  ],
  "credential_store": "keyring"
}

Fields

FieldTypeDescription
api_keystringAPI key for the LLM provider (stored if not using keyring)
api_basestringBase URL for the API endpoint
default_modelstringModel identifier to use by default
allowed_toolsstring[]Permanently allowed tool invocations
credential_storeenum"keyring" or "settings_file"

CLI Flags

All settings can be overridden at runtime via CLI flags:
FlagDescription
--modelOverride the model
--api-keyOverride the API key
--api-baseOverride the API base URL
--presetUse a named preset (overrides api_base and model)
--permissionsSet permission mode: default, accept-edits, bypass, plan
--max-turnsMaximum agent loop iterations
--max-tokensMaximum tokens in the response
--temperatureSampling temperature
--thinking-budgetToken budget for reasoning/thinking content
--plan-with-tasksEnable structured task tracking in responses
--cwdSet the working directory
--promptRun in headless mode with a single prompt
--headlessRun in stdin REPL mode
--resumeResume a saved session by ID
--list-sessionsList all saved sessions
--verboseEnable verbose logging
--setupForce the setup wizard to run

Environment Variables

VariablePurpose
OPENAI_API_KEYAPI key (lower priority than RUSTY_API_KEY)
RUSTY_API_KEYAPI key (higher priority)
OPENAI_BASE_URLAPI base URL
RUST_LOGLogging level (debug, info, warn)

Resolution Order

Settings are resolved in this order (later wins):
  1. Preset defaults
  2. ~/.rusty/settings.json
  3. Environment variables
  4. CLI flags