Skip to content

feat(config): look up config in XDG config dir - #11

Merged
bfirestone merged 1 commit into
mainfrom
feat/xdg-config
Oct 28, 2026
Merged

bfirestone merged 1 commit into
mainfrom
feat/xdg-config

Conversation

@bfirestone

Copy link
Copy Markdown
Contributor

Argus now searches for config in this order: --config, then ./.argus.yaml, then $XDG_CONFIG_HOME/argus/config.yaml (default ~/.config/argus/config.yaml). A project-local file wins over the global one. ~/.argus.yaml is no longer read.

Go's os.UserConfigDir returns ~/Library/Application Support on macOS. The new config.Dir resolves the XDG path itself, so macOS and Linux both use ~/.config/argus. The update-channel file moves there too.

argus config init --global writes the global file. The README documents the new lookup order.

To verify, run go test ./.... Then in an empty directory run argus config init --global and argus config validate. Validate should report the ~/.config/argus path. Add a local .argus.yaml and validate should switch to it.

To migrate, run mkdir -p ~/.config/argus && mv ~/.argus.yaml ~/.config/argus/config.yaml.

Argus now reads ./.argus.yaml first and then ~/.config/argus/config.yaml. It no longer reads ~/.argus.yaml. Go's os.UserConfigDir returns ~/Library/Application Support on macOS, so config.Dir resolves $XDG_CONFIG_HOME itself and the update-channel file moves there too.
@bfirestone
bfirestone merged commit 9f0e243 into main Oct 28, 2026
1 check passed
@bfirestone
bfirestone deleted the feat/xdg-config branch October 28, 2026 18:14
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