Skip to content

feat(cli): prioritize local config and fix arg parsing#184

Open
dandye wants to merge 2 commits intogoogle:mainfrom
dandye:cli_arg_order
Open

feat(cli): prioritize local config and fix arg parsing#184
dandye wants to merge 2 commits intogoogle:mainfrom
dandye:cli_arg_order

Conversation

@dandye
Copy link
Contributor

@dandye dandye commented Feb 12, 2026

Fixes global flag parsing order and adds local configuration support.

Changes

  • CLI Argument Parsing: Fixed issue where global flags (e.g., --output) were ignored when placed after subcommands.
  • Local Configuration: Added support for ./.secops/config.json in the current directory, which overrides global settings.
  • Environment Variable Support: Added SECOPS_LOCAL_CONFIG_DIR to specify a custom directory for local configuration.
  • Requirements: Split dependencies into requirements.txt and requirements-dev.txt.

Examples

Managing Multiple Configurations

You can use SECOPS_LOCAL_CONFIG_DIR to switch between different configurations without changing directories:

# Setup configuration for Project A (e.g. in /path/to/project-a)
export SECOPS_LOCAL_CONFIG_DIR=/path/to/project-a/.secops
mkdir -p $SECOPS_LOCAL_CONFIG_DIR
secops config set --local --project-id project-a

# Setup configuration for Project B
export SECOPS_LOCAL_CONFIG_DIR=/path/to/project-b/.secops
mkdir -p $SECOPS_LOCAL_CONFIG_DIR
secops config set --local --project-id project-b

# Use Project A config
export SECOPS_LOCAL_CONFIG_DIR=/path/to/project-a/.secops
secops search ...

Verification

  • Verified secops help --output json works as expected.
  • Verified local config overrides global config.

- Fixes global flag parsing order (e.g., )
- Implementation of local configuration support () with precedence over global config
- Adds  flag to  command
- Splits dependencies into  and
@dandye dandye requested a review from mihirvala08 as a code owner February 12, 2026 20:25
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.

1 participant