Expand description
TOML configuration.
One file per repository, conventionally drep.toml at the root. The shape
is deliberate: every field has a documented default, so a partial file
works. Missing keys are not an error - the section just inherits the
default. Providers are declared as [[llm]], an ordered array of tables:
a preference order, tried head first, each enabled entry a fallback for the
one before it.
The two things this module owns that are not obvious from the field list:
${VAR}expansion. An api key (or any string value) can name an environment variable instead of holding the secret. The file gets committed; the secret does not. An unset variable is an error rather than an empty string, because a silent empty credential produces a confusing 401 instead of a clear “API_KEY is not set”.max_tokensdefaults to None, meaning no cap is sent to the model. Modern reasoning models ship 256k-1M context, and inventing a ceiling truncates them mid-thought. The option stays available for capping spend.
§The second layer
This file is per-repository and drep init gitignores it, so a control
written here is per-developer and opt-in. site is the layer above it: a
machine-level policy file a checkout can tighten but never loosen.
load and validate know nothing about it and take no site argument.
The clamp is applied by the caller, after load returns, which is what keeps
ConfigError a statement about this file alone - every one of its messages
numbers [[llm]] entries in this file’s order, and a bare #2 that could
mean either file is exactly the ambiguity those messages exist to avoid.
Modules§
- site
- The machine-level site policy layer above
drep.toml.
Structs§
Enums§
- Backend
Kind - Which implementation serves one provider entry.
- Config
Error - What went wrong reading or validating the configuration.
- Reasoning
Effort - Reasoning effort accepted by the Codex CLI configuration contract.
Constants§
Functions§
- default_
config_ path - The conventional config file location:
drep.tomlin the current directory. - env_
var_ refs - Every
${NAME}reference ins, in the order they appear. - env_
var_ refs_ in - Every
${NAME}reference in any string value of a parsed TOML tree. - load
- Load and validate
path. - parse_
protocol - Parses a
protocol =value, orNonewhen it names nothing the SDK speaks. - required_
env_ var_ refs - Every
${NAME}reference thatsuper::loadwill actually try to substitute.