Skip to content

feat: discover the config file in predefined locations - #2868

Closed
Lightning00Blade wants to merge 1 commit into
unified-config/5-tool-optionsfrom
unified-config/6-config-discovery
Closed

Lightning00Blade wants to merge 1 commit into
unified-config/5-tool-optionsfrom
unified-config/6-config-discovery

Conversation

@Lightning00Blade

Copy link
Copy Markdown
Collaborator

When --config is not passed, the MCP server, the CLI and the daemon look
for a config file in, from highest to lowest priority:

  1. ${CWD}/cd4a.config.json
  2. ${PLUGIN_DATA}/cd4a.config.json
  3. $XDG_CONFIG_HOME/cd4a/config.json (macOS/Linux) or
    %LOCALAPPDATA%/Google/cd4a/config.json (Windows), falling back to
    ~/.config/cd4a/config.json

Discovery is opt-in through a ConfigLocator passed to the ConfigParser so
that tests never pick up config files from the machine. The parser also
gets a reload() method that re-reads the resolved config file.


Stack created with GitHub Stacks CLI • Give Feedback 💬

@Lightning00Blade
Lightning00Blade force-pushed the unified-config/5-tool-options branch from 63b72eb to f791387 Compare September 29, 2026 21:43
@Lightning00Blade
Lightning00Blade force-pushed the unified-config/6-config-discovery branch from b130cfd to 923f0ee Compare September 29, 2026 21:43
When --config is not passed, the MCP server, the CLI and the daemon look
for a config file in, from highest to lowest priority:

1. ${CWD}/cd4a.config.json
2. ${PLUGIN_DATA}/cd4a.config.json
3. $XDG_CONFIG_HOME/cd4a/config.json (macOS/Linux) or
   %LOCALAPPDATA%/Google/cd4a/config.json (Windows), falling back to
   ~/.config/cd4a/config.json

Discovery is opt-in through a ConfigLocator passed to the ConfigParser so
that tests never pick up config files from the machine. The parser also
gets a reload() method that re-reads the resolved config file.
@Lightning00Blade
Lightning00Blade force-pushed the unified-config/6-config-discovery branch from 923f0ee to f270b5e Compare September 29, 2026 21:52
@Lightning00Blade
Lightning00Blade force-pushed the unified-config/5-tool-options branch from f791387 to 5f0202c Compare September 29, 2026 21:52
@Lightning00Blade
Lightning00Blade removed this pull request from stack #2873 September 29, 2026 22:12
@Lightning00Blade
Lightning00Blade deleted the branch unified-config/5-tool-options September 29, 2026 22:12
@Lightning00Blade
Lightning00Blade deleted the unified-config/6-config-discovery branch September 29, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant