Skip to content

feat(cli): support environment variables for global options#52

Merged
danielrothmann merged 1 commit into42futures:mainfrom
sontags:feat/envvars
Feb 12, 2026
Merged

feat(cli): support environment variables for global options#52
danielrothmann merged 1 commit into42futures:mainfrom
sontags:feat/envvars

Conversation

@sontags
Copy link
Copy Markdown

@sontags sontags commented Feb 12, 2026

Summary

This PR addresses issue #50.

  • Add environment variable support for all global CLI flags: FIRM_WORKSPACE, FIRM_CACHED, FIRM_VERBOSE, FIRM_FORMAT
  • Enable clap env feature and add env attributes to each global arg
  • Document environment variables and their precedence (flag > env var > default) in CLI reference

Test plan

  • Verify FIRM_WORKSPACE=/path firm list task uses the specified workspace
  • Verify FIRM_FORMAT=json firm list task outputs JSON
  • Verify CLI flags override environment variables when both are set
  • Verify firm --help shows environment variable names for each global option

Add env attribute to clap for workspace, cached, verbose, and format
flags (FIRM_WORKSPACE, FIRM_CACHED, FIRM_VERBOSE, FIRM_FORMAT). Enable
the clap "env" feature. Update CLI reference with environment variable
names and precedence order (flag > env var > default).
Copy link
Copy Markdown
Member

@danielrothmann danielrothmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, neat that it could be done via clap args. Thanks!

@danielrothmann danielrothmann merged commit 4ef11c7 into 42futures:main Feb 12, 2026
1 check passed
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.

2 participants