Skip to content

[GOOD FIRST ISSUE] Add a --verbose/-v flag as a shortcut for DOCKSEC_LOG_LEVEL=INFO #129

Description

@advaitpatel

Background

Split out from #52. DOCKSEC_LOG_LEVEL already exists as an env-var override for log verbosity (see docksec/utils.py:get_custom_logger), but there's no CLI flag for it — a user has to know the env var exists and set it separately from the docksec invocation.

Task

Add a -v/--verbose flag to the argparse parser in docksec/cli.py that is equivalent to setting DOCKSEC_LOG_LEVEL=INFO for the run (do this by setting os.environ["DOCKSEC_LOG_LEVEL"] = "INFO" early in main(), before any logger is created — follow the same pattern already used for --provider/--model writing to LLM_PROVIDER/LLM_MODEL env vars around cli.py:78-80).

Acceptance criteria

  • docksec Dockerfile --scan-only -v shows INFO-level log lines on stderr that are normally suppressed in CLI mode
  • Without -v, behavior is unchanged (still defaults to ERROR-only in CLI mode)
  • An explicit DOCKSEC_LOG_LEVEL env var set by the user still takes priority over -v (i.e. don't clobber it if already set)
  • --help documents the flag
  • README's flag list is updated
  • A test in tests/test_cli.py covers the flag being parsed and setting the env var as expected

Pointers

  • docksec/cli.py — argparse setup, look at how --compact-output sets DOCKSEC_COMPACT_OUTPUT
  • docksec/utils.py:get_custom_logger — the level resolution logic this flag needs to influence

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliChanges to the CLI entry pointenhancementNew feature or requestgood first issueGood for newcomers

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions