Skip to content

feat: allow cli args to be set via env vars#88

Merged
MacroPower merged 1 commit intomainfrom
feat/env-vars
Aug 3, 2025
Merged

feat: allow cli args to be set via env vars#88
MacroPower merged 1 commit intomainfrom
feat/env-vars

Conversation

@MacroPower
Copy link
Copy Markdown
Owner

@MacroPower MacroPower commented Aug 3, 2025

Closes #83

This pull request introduces functionality to bind environment variables to any command-line flags in the CLI.

Environment variables are named using the KAT_<FLAG_NAME> convention, where flag names are converted to uppercase and dashes are replaced with underscores. We also update flag usage descriptions to include the corresponding environment variable names.

Order of precedence: arguments > environment variables > config file > default values

I considered using viper here but didn't like that it'd be adding a pretty large library with multiple dependencies just for this.

@MacroPower MacroPower merged commit 3be8abb into main Aug 3, 2025
3 checks passed
@MacroPower MacroPower deleted the feat/env-vars branch August 3, 2025 13:58
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.

Allow specifying Config file via env

1 participant