-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
bugSomething isn't workingSomething isn't workingcliCommand-line interface and usabilityCommand-line interface and usabilitydeveloper-experienceDX, tooling, and ergonomicsDX, tooling, and ergonomicstriagedIssue has received an initial AI or manual triageIssue has received an initial AI or manual triage
Description
Currently, some commands (including --help) fail or behave unexpectedly if a config file is missing. This is due to logic in the root command eagerly loading config or performing work before Click has a chance to dispatch subcommands.
Problem
The root command appears to evaluate configuration at startup, preventing Click from lazily handling flags like --help, --version, etc. When the config is missing, even introspection commands fail — which is not expected behavior for CLI tools.
Solution
Refactor the CLI architecture so that:
- The root command does not load or validate config directly
- Any work that depends on config is pushed down into subcommands
- Add a decorator or helper (e.g.
@with_config(optional=True)) to selectively load config only when needed - Use
click.Context.objto store config state if needed across commands
This ensures:
--help,--version, etc., work regardless of the filesystem- Config validation only happens where relevant
- Cleaner separation of command responsibility
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcliCommand-line interface and usabilityCommand-line interface and usabilitydeveloper-experienceDX, tooling, and ergonomicsDX, tooling, and ergonomicstriagedIssue has received an initial AI or manual triageIssue has received an initial AI or manual triage