Skip to content

Add --author filter to hunk session comment list #489

Description

@fuleinist

What do you want to change?

Add an --author <name> filter to hunk session comment list so the CLI can return only comments written by one specific author.

Why?

The comment add and comment apply subcommands already let callers tag a comment with --author <name> (or the author field in the stdin JSON for apply), and comment list already supports --file <path> and --type <live|all|ai|agent|user> filters. The one missing dimension is author.

In a typical agent-assisted review a coding agent and a human both leave notes on the same session, and the JSON output of hunk session comment list --json ends up mixed. Right now the only way to pull out one author's notes is to pipe the JSON through jq:

hunk session comment list --json | jq '.[] | select(.author=="pi")'

That works, but it pushes what is conceptually a one-flag filter into every consumer that needs it. A native --author <name> flag mirrors the same ergonomics as --file and --type and keeps --json consumers thin.

How? (optional)

  • Add .option("--author <name>", "filter comments to one author") to the session comment list commander setup, parse it like the other string filters, and forward it through SessionCommentListCommandInput.
  • In the daemon/list handler, drop comments whose author does not match the flag (case-sensitive, exact match — same shape as --type).
  • Treat a missing author field as a separate value: add a companion --no-author (or --author="") flag that returns only comments without an author. Two flags keeps the matcher unambiguous and mirrors how comment clear already uses --include-user / --all.
  • Add unit coverage next to src/core/cli.test.ts for the new flag, plus a daemon-level test that the returned list honors the filter.
  • Update docs/agent-workflows.md (or the equivalent CLI reference) with one example: hunk session comment list --author pi --json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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