Skip to content

Add --quiet flag to impeccable detect for CI / pre-commit use #238

@fuleinist

Description

@fuleinist

What problem does this solve?

When impeccable detect is wired into a pre-commit hook or CI pipeline, the per-finding text dump (the per-file grouped listing with line numbers, snippets, and descriptions) is noisy and most consumers only need the final summary line and the exit code to gate the build. Today there is no way to suppress the per-file listing without also losing machine-readable JSON via --json.

Proposed solution

Add a --quiet flag to impeccable detect that, in text mode, suppresses the per-file grouped listing of findings and prints only the summary line (N anti-patterns found.) to stderr. The exit code stays as today (2 if any findings, 0 if clean) and --json mode is unaffected (still emits the full findings array on stdout). Compatible with --gpt / --gemini provider flags.

Where the change would go

cli/engine/cli/main.mjs in detectCli():

  1. Parse --quiet alongside --json / --help / --fast.
  2. In the output section (lines ~248-254 in the current main), when --quiet is set and jsonMode is false, write only the summary line: process.stderr.write(\${allFindings.length} anti-pattern${allFindings.length === 1 ? '' : 's'} found.\n`)`.
  3. Update printUsage() to document --quiet in the options block.

Estimated diff: ~6-10 lines in one file.

Use case

  • pre-commit config that runs impeccable detect --quiet src/ — fails the commit on exit 2, prints just 12 anti-patterns found. to the developer's terminal.
  • CI logs (GitHub Actions, etc.) that want a single line of pass/fail signal + count to surface in the job summary, with the full per-file detail still available in the verbose run on failure.
  • Editor integrations that just need the exit code + count to surface a status bar badge.

Alternatives considered

  • Add a summary block to the top of the existing --json output: would break consumers parsing the array shape; not backward compatible.
  • Add a --summary flag emitting a separate aggregate JSON: more useful for dashboards, but a separate, larger feature; this --quiet flag is the minimal CI-friendly change that pairs well with --json and unblocks more granular work later.
  • Auto-quiet when stdout/stderr is not a TTY: surprising; users piping output to tee / less would lose detail unexpectedly. Explicit flag is clearer.

Provider(s) this applies to

This is a CLI-level change in cli/engine/cli/main.mjs, not a provider-specific skill, so the provider list doesn't apply directly. The --quiet flag works in any environment where npx impeccable detect runs (local dev, CI, pre-commit hooks) regardless of which AI agent is invoking it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions