The autouam status command fails with "Configuration file is required for this command" when using autouam status --config /path/to/config.yaml, even though the global autouam -c /path/to/config.yaml status works.
Current Behavior
# This works:
autouam -c /etc/autouam/config.yaml status
# This fails with "Error: No such option: --config":
autouam status --config /etc/autouam/config.yaml
Expected Behavior
# This should work (consistent with other CLI tools):
autouam status --config /etc/autouam/config.yaml
Root Cause
The CLI is designed such that:
- The global
autouam command accepts -c, --config PATH
- Individual commands like
status require obj.settings to be populated
- Individual commands do NOT accept their own
--config option
- This forces users to use the global
-c flag before the command
Impact
- Poor UX: Inconsistent with user expectations and common CLI patterns
- Container Unfriendly: Difficult to use in containerized environments
- Confusing: Users don't understand why
--config isn't accepted
- Inflexible: Can't specify config per command
Proposed Solution
Add --config option to individual commands that require configuration:
@main.command()
@click.option("--config", "-c", type=click.Path(exists=True), help="Configuration file path")
@click.pass_context
def status(ctx: click.Context, config: str) -> None:
"""Show current status."""
if config:
obj.settings = Settings.from_file(Path(config))
elif not obj.settings:
print_error("Configuration file is required for this command")
sys.exit(1)
# ... rest of function
Benefits
- User-friendly: Follows common CLI patterns (
kubectl --kubeconfig, docker --config)
- Container-friendly: Works well in Docker environments with mounted configs
- Explicit: Users know exactly which config is being used
- Backward compatible: Global
-c flag still works
- Consistent: All config-requiring commands work the same way
Affected Commands
At minimum: status, enable, disable, check (any command requiring API access)
Environment
- AutoUAM version: 1.0.0a7
- Deployment: Docker container
- Configuration: YAML config file
Additional Context
This issue was discovered during Docker container deployment where users expect to be able to specify config files per command rather than relying on global flags. The current design makes container usage unnecessarily complex.
The
autouam statuscommand fails with "Configuration file is required for this command" when usingautouam status --config /path/to/config.yaml, even though the globalautouam -c /path/to/config.yaml statusworks.Current Behavior
Expected Behavior
# This should work (consistent with other CLI tools): autouam status --config /etc/autouam/config.yamlRoot Cause
The CLI is designed such that:
autouamcommand accepts-c, --config PATHstatusrequireobj.settingsto be populated--configoption-cflag before the commandImpact
--configisn't acceptedProposed Solution
Add
--configoption to individual commands that require configuration:Benefits
kubectl --kubeconfig,docker --config)-cflag still worksAffected Commands
At minimum:
status,enable,disable,check(any command requiring API access)Environment
Additional Context
This issue was discovered during Docker container deployment where users expect to be able to specify config files per command rather than relying on global flags. The current design makes container usage unnecessarily complex.