Skip to content

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

Merged
mihirvala08 merged 9 commits intogoogle:mainfrom
dandye:cli_arg_order
Mar 31, 2026
Merged

feat(cli): prioritize local config and fix arg parsing#184
mihirvala08 merged 9 commits intogoogle:mainfrom
dandye:cli_arg_order

Conversation

@dandye
Copy link
Copy Markdown
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
@mihirvala08
Copy link
Copy Markdown
Collaborator

/run-integration-tests 9fa9f6f

@mihirvala08
Copy link
Copy Markdown
Collaborator

/run-integration-tests 0aaffae

@mihirvala08
Copy link
Copy Markdown
Collaborator

/run-integration-tests 45ca855

@mihirvala08 mihirvala08 merged commit 5aedb74 into google:main Mar 31, 2026
8 checks 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