Add optional TOML config file support via --config flag#112
Open
aufam wants to merge 3 commits into
Open
Conversation
added 3 commits
April 20, 2026 15:32
Load configuration from a TOML file. The `agg.toml` file will be searched for in the user's config directory if no explicit path is provided via the `--config` flag. Command-line arguments override TOML configurations. The `#[serde(skip_deserializing)]` attribute is used on the `Theme` enum to prevent deserialization issues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello, thanks for making this awesome project.
I frequently find myself running agg with the same set of flags over and over. So I figured a config file would be a nice quality-of-life improvement.
This PR adds support for an optional TOML configuration file, making it easy to persist preferred settings in one place.
Usage
If
--configis not specified, agg will look foragg.tomlin the user's config directory (via thedirscrate):If no config file is found, everything works exactly as before — no breaking changes.
Priority order
CLI arguments > config file > default values
Explicitly passed CLI flags always win. The
--helpoutput continues to display default values as before.Config file format
The config struct mirrors
agg::Configand uses kebab-case keys:Changes
--configCLI flagserdeandtomlcratesdirscrate for resolving the default config directoryHappy to adjust anything — thanks for your time reviewing!