Configure
Configuration
None of it is required. smartly runs on defaults as long as `ANTHROPIC_API_KEY` is set.
Where the file lives
$XDG_CONFIG_HOME/smartly/config.yaml
If XDG_CONFIG_HOME is not set, ~/.config/smartly/config.yaml is used instead.
The config commands
smartly config init # write a default config.yaml
smartly config show # print the resolved config (secrets redacted)
smartly config path # print the resolved config file path
config show prints the configuration smartly actually resolved, which is the
fastest way to check whether a file you edited is being read at all. It never
prints the API key value.
Full schema
Every field is optional. A field you leave out keeps its default rather than being zeroed.
provider: anthropic # anthropic | openai | claude-cli | codex-cli
execution:
mode: auto # auto | confirm
context: light # none | light | full
log:
path: ~/.config/smartly/history.log
providers:
anthropic:
model: claude-opus-5
api_key_env: ANTHROPIC_API_KEY
api_key: "" # fallback only, used if the env var is unset
base_url: "" # optional: self-hosted/proxy endpoint
# also drives any OpenAI-compatible API — see Providers
openai:
model: "" # required if provider: openai — no default shipped
api_key_env: OPENAI_API_KEY
api_key: ""
base_url: "" # e.g. https://api.fireworks.ai/inference/v1
claude-cli:
model: haiku # required — see CLI-based authentication
binary: claude
max_budget_usd: 0.50
codex-cli:
model: "" # optional; omitted if unset
binary: codex
Key settings
provider
Which backend generates the command. Four values: anthropic, openai,
claude-cli, codex-cli. See Providers for what each one
needs and how they differ.
execution.mode
auto runs the generated command immediately. confirm prints it and asks
[y/N] first. Covered in Execution and
safety.
context
How much of your surroundings is sent with the request: none, light or
full. full includes shell history and should be turned on deliberately —
see Context.
log.path
Where the JSONL history log is written. YAML values are read literally, so a
leading ~ is expanded by smartly rather than by your shell. What the log
contains is described in Logging.
How API keys are resolved
For anthropic and openai, in order:
- The environment variable named by
api_key_env, if that variable is set. - The provider’s default environment variable —
ANTHROPIC_API_KEYorOPENAI_API_KEY. - The
api_keyvalue in the config file, as a fallback.
The key value is never printed by config show.