Configuration¶
nanocode reads a single TOML file, ~/.nanocode/config.toml by default. Generate a
commented starter with nanocode --init-config, or point at another file with
--config <path>.
Only the [provider] block is required. Every other key falls back to
a built-in default, so a minimal config is just a provider. Inspect the resolved configuration
at any time with /config.
Providers¶
Define one or more [provider.<name>] blocks and pick the active one with
[provider] active:
[provider]
active = "default"
[provider.default]
url = "https://api.deepseek.com"
key = "sk-..."
model = "deepseek-v4-flash"
Switch providers within a session with /provider [NAME] and models with /model [MODEL].
Provider options¶
Key |
Default |
Meaning |
|---|---|---|
|
— |
Base URL of the API |
|
— |
API key |
|
— |
Model name |
|
|
Request format: |
|
|
Reasoning effort: |
|
|
Chat-API reasoning format: |
|
|
Stable prompt-cache key; use |
|
|
Request timeout, in seconds |
|
— |
Models offered by |
|
— |
Sampling temperature (omit to use the server default) |
|
— |
Cap on output tokens (omit to use the server default) |
|
|
Emit strict tool-call schemas where supported (OpenAI, DeepSeek); toggle live with |
For well-known hosts, auto settings pick sensible defaults for you, so
url, key, and model are usually all you need. Anything you set
explicitly is always respected. Tested with DeepSeek, OpenCode, Alibaba Cloud, and ZenMux;
other OpenAI-compatible and Anthropic endpoints work too.
Runtime¶
Optional; the defaults shown are used when omitted.
Key |
Default |
Meaning |
|---|---|---|
|
|
Start without confirmation prompts |
|
|
Context budget before automatic compaction |
|
|
Maximum tool steps in one turn |
|
|
Maximum shell-command lifetime, in seconds |
|
|
Foreground wait before a running command becomes a background job; |
|
|
Maximum read-only tool calls executed concurrently; |
|
|
Delete inactive saved sessions older than this at startup; |
|
|
Terminal theme: |
Selected tuning values can be changed for the current session with /set (Tab completion
lists the supported keys). /yolo toggles yolo.
Data location¶
[paths]
data_dir = "~/.nanocode" # sessions, code index, OAuth tokens, user skills, update cache
Sessions live under <data_dir>/sessions/.