Skip to content

fix(cli): honour audit filters and --no-scan, and fix piped and coloured output - #202

Merged
RealZST merged 1 commit into
mainfrom
fix/cli-flags
Nov 29, 2026
Merged

RealZST merged 1 commit into
mainfrom
fix/cli-flags

Conversation

@RealZST

@RealZST RealZST commented Nov 29, 2026

Copy link
Copy Markdown
Owner

Fixes

Problem Now
hk audit --kind and --severity were parsed and ignored They filter: --kind by extension kind, --severity by minimum finding severity
hk audit scanned twice, and --no-scan skipped only the second scan One scan by default, none with --no-scan
hk list --json | head -1 panicked with a broken-pipe error The command ends quietly (Unix)
Coloured cells counted ANSI codes as width, so columns were too wide Widths match the uncoloured table
hk list agents --json returned an error Prints JSON with name and detected per agent
--kind help left out cli Listed

Behaviour change

An unknown --kind or --severity value is now an error. hk list --kind <typo> used to list everything.

Notes

  • comfy-table's custom_styling feature adds eight transitive crates; libc is added on Unix for the SIGPIPE reset. hk serve keeps ignoring SIGPIPE.
  • The broken-pipe fix is Unix only. Windows is unchanged and untested.
  • The CLI reference (English and Chinese) is updated to match.

Testing

  • cargo fmt, cargo clippy -D warnings, cargo test -p hk-cli -p hk-core, website tests and build.
  • Each row above was reproduced before the change and re-run after it in an isolated home directory.

🤖 Generated with Claude Code

…red output

- hk audit --kind and --severity were parsed and ignored; they now filter.
- hk audit scanned twice and --no-scan skipped only the second scan; it now scans once, and not at all with --no-scan.
- Printing into a closed pipe (hk list --json | head -1) panicked on Unix.
- Coloured cells counted their ANSI codes as width, misaligning tables.
- hk list agents --json returned an error; it now prints JSON.
- An unknown --kind value is rejected instead of ignored, and the help lists cli.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@RealZST
RealZST merged commit 84839d5 into main Nov 29, 2026
5 checks passed
@RealZST
RealZST deleted the fix/cli-flags branch November 29, 2026 10:55
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