Add 'dispatch tags' to list tags with per-tag session counts#257
Merged
Conversation
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>
# Conflicts: # cmd/dispatch/cli.go # cmd/dispatch/main.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a headless
dispatch tagscommand that lists every tag in use with thenumber of sessions that carry it.
Text output:
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.
--jsoncloses thatgap and matches the shape of
dispatch stats --json.Behavior notes
that no longer exist are not counted. This keeps the taxonomy honest.
Changes
cmd/dispatch/tags.go:runTags,parseTagsArgs,buildTagsReport, and text/JSON writershandleArgsincmd/dispatch/cli.gocmd/dispatch/main.gocmd/dispatch/tags_test.gocover report building, orphan filtering, text output, JSON output, argument parsing, loader errors, and the arg dispatch pathTesting
go build ./...go test ./... -count=1go vet ./...golangci-lint runAll green.
Closes #256