Skip to main content

Module config

Module config 

Source
Expand description

TOML configuration with XDG-style paths, .env files and environment overrides.

Resolution order, later wins:

built-in defaults < config file < shared .env < profile .env < environment

Secrets belong in .env (mode 0600) rather than in config.toml, which is the file people paste into issues; config.toml can then refer to them as ${NAME} (see crate::interpolate). There are deliberately no built-in endpoints or API keys.

Re-exports§

pub use migrate::baseline_path;
pub use migrate::plan as migration_plan;
pub use migrate::Change;
pub use migrate::Plan;

Modules§

migrate
eclipse config migrate — bringing a config file forward without touching what its owner chose.

Structs§

AgentConfig
AttachmentsConfig
[attachments]: where the pictures someone attaches are kept (#499).
BotConfig
[bots.<name>]: one named agent identity (#509).
Chain
The routes one run will use, in order.
CliConfig
Terminal behaviour. Every field here is read by the CLI; a setting nothing reads is a lie in the starter config.
Config
ContextPolicyConfig
[context]: how a request that no longer fits is shortened. The head (first turn) and the tail (newest turns) stay verbatim; what pays is the middle.
Dotenv
The .env files read for this profile, and what they set.
FlaresConfig
[flares]: what a run costs and how wide it may go (#171).
GatewayConfig
[gateway]: the one long-lived process that keeps the whole thing running.
HooksConfig
[hooks]: which in-process loop hooks run, and their settings.
InitReport
What config init did, so the caller can report it without re-deriving paths.
NamedRoute
A route with its name attached and the route table itself stripped off, so what is left is exactly one provider’s settings.
PluginsConfig
[plugins]: where plugins live and which ones may load.
ProviderConfig
RouteConfig
One [[provider.route]]: a name and a complete ProviderConfig.
SessionsConfig
Setting
One key a person can read and write: [section] key, its default and its current value.
SkillsConfig
ToolsConfig
UnknownKey
A key in a config file that no part of Config reads.
UpdateConfig
[update]: the notice that says a newer commit exists. It is the only request this tool makes that is neither a model call nor something the user asked for, so it has a switch.
UserConfig
[user]: the user model and the agent’s memory file.
VisionConfig
[skills]: how much of the prompt the skills index may take.
WebConfig
Where
Where this process is running from — the four answers Config::where_am_i fills in.

Enums§

Applies
When a changed key takes effect.
Approval
What the CLI does when a tool’s policy is ask.
ChainSource
Where a run’s chain of routes came from.
ClearOnExit
What an interactive exit does to the screen: [cli] clear_on_exit.
FetchHtml
What happens when the model asks for a tool. How fetch returns an HTML response by default.
Kind
The type a key holds, used both to validate what was typed and to say what went wrong.
Policy
ShellAsk
What the shell puts to a person when its policy is Policy::Ask.
ShellIsolate
What a shell command can reach once it runs. The mechanics are in eclipse_core::sandbox.
Track
Which branch a source install follows: [update] track.
UpdateCheck
How often the update notice asks the public repository for its latest commit.
VisionMode
The three modes, spelled in the file the way a person would say them.

Constants§

APP_DIR
BOT_ADAPTERS
The adapters this build can actually drive (#509). Slice 3 adds telegram; a name that is not here is reported by problems rather than refused, because the declaration is still worth writing down today — the bot answers on the web and the lane arrives with slice 3.
CONFIG_VERSION
The shape of config.toml this build writes, stamped into the file as config_version.
DEFAULT_ROUTE
The name [provider] itself goes by once routes exist.
DEFAULT_SESSION_TTL_HOURS
How long a dashboard login lasts before the browser has to sign in again.
ENV_ABOUT
One line per variable, for the manual: what it is for.
ENV_INTERNAL
Variables this tool sets in a child’s environment (a plugin, an MCP server, a spawned tool call). Nobody sets these by hand, and a value in .env would be overwritten anyway.
ENV_SHELL_ONLY
Variables read before a .env is opened, or from the process environment only. Setting one of these inside .env would be inert, which is worse than absent: it looks like a setting.
ENV_TEMPLATE
Every variable the shipped .env lists, in the order it lists them, with empty values.
STARTER_AGENT_MD
The starter AGENT.md, written on first install. The user is expected to edit it; the content is a shape and a set of instructions, not facts about the machine.
STARTER_PROFILE_CONFIG
The file a named profile starts from: an overlay, not a whole config. Only the keys a profile usually changes are here, uncommented examples included — a profile that restated every default would pin them, and then a change to the base config would stop reaching it.
STARTER_USER_MD
The starter USER.md: who the operator is. Edit it; it is the agent’s standing picture of the user, injected on every run.

Functions§

about
One line per key: what it does, in words a person choosing it can use.
choices
comment_in_text
Insert # key = under [section], which is how a shipped file says “this key exists and is not in use” for a key whose off state has no spelling (a number, a colour, an explicit boolean).
config_dir
Where config.toml, .env and the shared plugins/, skills/ and scripts/ live: the root itself. A --config elsewhere moves the file without moving the directory it is read from, which is what config_path is for.
config_path
$ECLIPSE_CONFIG or <config_dir>/config.toml.
default_api_session_ttl_hours
dotenv_var
The value of KEY in a .env file, if it has one.
ensure_layout
Create the directories the layout names, so that ls ~/.eclipse answers “where does the agent’s stuff go?” without reading a document. Idempotent, and it never touches a file.
env_about
What one variable is for, or "" — the same lookup shape as settings::about.
home_root
The one directory everything lives in: $ECLIPSE_HOME, or ~/.eclipse.
mcp_add
Add [[mcp]] entry — to config.toml, which is the file this edits (#352).
mcp_remove
Remove the [[mcp]] entry called name. Only that block goes.
mcp_set_disabled
Switch an entry off (or back on) in place: disabled = true inside its own block.
mcp_update
Change the [[mcp]] entry called name in place (#517).
parse_text
Parse config text exactly as the loader would. A writer uses this to prove what it is about to save is loadable before it replaces the user’s file.
parse_value
Parse one value as a person typed it.
process_env
profile_dir
<root>/profiles/<name>: a profile’s own config overlay, memory/, skills/, plugins/ and state/.
save_config_text
Write config text back with the same permissions as the starter (0600) — the file can carry api_key, and a config people paste into bug reports should still be readable only by them.
save_dotenv_var
Set KEY=value in a .env, creating it 0600 if it does not exist. An existing line for that key is replaced; every other line, comment included, is kept. Values are written raw: a .env is not TOML and the loader takes the rest of the line as the value.
seed_context_files
Seed the three context files in the memory directory, creating any that are missing.
set_in_text
Set path to value in this config text, returning the new text.
set_list_in_text
Set a list-valued key from items — plugins.enabled = ["a", "b"].
stamp_version
Write config_version = N into this TOML text, at the top, where the generated file puts it.
starter_config
The shipped config.toml: every setting this build reads, and no prose.
starter_env
The shipped .env: every variable, nothing set, and the dashboard token already generated.
state_dir
Machine-written files: sessions, REPL history, locks, install.json, update.json. Inside the root so that a backup, a move or a delete is one operation, and named for what it is rather than for who wrote it.
state_dir_for
State directory for a profile: the root’s own state/ for the default profile, otherwise profiles/<name>/state — beside that profile’s config, not inside the root’s state, so a profile is a subtree you can move or delete in one piece.
toml_comment_out
Comment [section] key = … out of this TOML text, so the file falls back to the default.
toml_set_string
Set [section] key = "value" in this TOML text and return the whole text back.
toml_set_value
Set [section] key = <value> where value is already TOML — 9000, true, ["a", "b"], "text" with its quotes. The line-editing rules are toml_set_string’s.
toml_value
The value [section] key = ... holds in this TOML text, unquoted, if the key is set. Commented-out template lines do not count: they are documentation, not config.
unknown_keys_in_file
Read one config file and report the keys in it that cfg does not read.
unset_in_text
Comment path out of this config text, so the file falls back to its default.
validate_profile_name
Profile names become directory names, so they are held to the same alphabet as session ids: [A-Za-z0-9_-], 1-64 characters.
write_starter_config
Write the starter config, and the .env where the loader will read it, with a freshly generated dashboard token (the token is never returned or printed).
write_target
The file a config write lands in (#571).

Type Aliases§

EnvFn
Environment lookup, injectable so tests never touch the process environment.