Skip to content

Add 'dispatch tags' to list tags with per-tag session counts#257

Merged
jongio merged 2 commits into
mainfrom
idea/tags-cmd
Jul 7, 2026
Merged

Add 'dispatch tags' to list tags with per-tag session counts#257
jongio merged 2 commits into
mainfrom
idea/tags-cmd

Conversation

@jongio

@jongio jongio commented Jul 7, 2026

Copy link
Copy Markdown
Owner

What

Adds a headless dispatch tags command that lists every tag in use with the
number of sessions that carry it.

dispatch tags
dispatch tags --json

Text output:

Dispatch tags

Tags:     3
Sessions: 3 tagged

  work      2
  personal  1
  urgent    1

Tags are ordered by count (then name), so your busiest buckets come first.

Why

You can tag sessions in the TUI and filter the list by a tag, but there was no
way to see the full set of tags you have used or how many sessions each covers.
Once you have more than a few tags it is hard to keep track of which exist,
which are used once and could be retired, and which are your busiest. There was
also no scriptable way to read tags from outside the TUI. --json closes that
gap and matches the shape of dispatch stats --json.

Behavior notes

  • Counts are taken against the current session store, so tags left on sessions
    that no longer exist are not counted. This keeps the taxonomy honest.
  • Unknown flags and positional arguments are rejected with a clear error.

Changes

  • New cmd/dispatch/tags.go: runTags, parseTagsArgs, buildTagsReport, and text/JSON writers
  • Command wired into handleArgs in cmd/dispatch/cli.go
  • Help text updated in cmd/dispatch/main.go
  • Shell completions (bash, zsh, fish, powershell) list the command
  • README section added
  • Tests in cmd/dispatch/tags_test.go cover report building, orphan filtering, text output, JSON output, argument parsing, loader errors, and the arg dispatch path

Testing

  • go build ./...
  • go test ./... -count=1
  • go vet ./...
  • golangci-lint run

All green.

Closes #256

Adds a headless 'dispatch tags' command that prints every tag in use with the number of sessions that carry it, ordered by count. Counts are taken against the current session store, so tags on sessions that no longer exist are not counted. Supports --json for scripting, matching the shape of 'dispatch stats --json'.

Wires the command into arg dispatch, help text, shell completions (bash/zsh/fish/powershell), and the README.

Closes #256

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jongio jongio added the idea Feature idea from the idea pipeline label Jul 7, 2026
@jongio jongio self-assigned this Jul 7, 2026
# Conflicts:
#	cmd/dispatch/cli.go
#	cmd/dispatch/main.go
@jongio jongio merged commit dd1bae2 into main Jul 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

idea Feature idea from the idea pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a 'dispatch tags' command to list all tags with counts

1 participant