Skip to content

feat(cli): add compare, watch, tag, prune, aliases, scoped resume, stats --csv, batch export#317

Merged
jongio merged 1 commit into
mainfrom
feat/swarm-cli-commands
Jul 17, 2026
Merged

feat(cli): add compare, watch, tag, prune, aliases, scoped resume, stats --csv, batch export#317
jongio merged 1 commit into
mainfrom
feat/swarm-cli-commands

Conversation

@jongio

@jongio jongio commented Jul 17, 2026

Copy link
Copy Markdown
Owner

What

Add eight session-management CLI commands, integrating parallel "swarm" work rebased onto current main (which already has the git status feature from #316):

Command Issue
dispatch compare <a> <b> [--json] - side-by-side session comparison #264
dispatch export --filter ... - batch-export filtered sessions #265
dispatch watch [--once] - monitor session attention outside the TUI #271
dispatch tag <id> [add/remove/set/list] - manage session tags from the CLI #273
dispatch aliases [--json] - list session aliases with orphan detection #275
dispatch open --current - resume the most recent session scoped to the current repo/branch/folder #276
dispatch prune [--apply] - clean stale session config entries #277
dispatch stats --csv - CSV output for stats #279

Why

These round out the non-interactive CLI surface so sessions can be scripted, filtered, and maintained without the TUI. Each was a tracked idea backlog item; this batch clears eight of them for the next release.

Closes #264
Closes #265
Closes #271
Closes #273
Closes #275
Closes #276
Closes #277
Closes #279

How

The commands live in cmd/dispatch/ (compare.go, watch.go, tag.go, prune.go, aliases.go, plus stats.go/export.go/open.go extensions) and are wired through cli.go/main.go. open gains a --current flag that auto-detects the repo/branch from the working directory for a scoped "resume most recent".

This work was developed in parallel with the git status feature and was rebased onto current main. The overlap (open.go, keys.go, the parseOpenArgs arity, and the pre-existing test-compile fixes) was resolved in favor of keeping both features: parseOpenArgs now returns the 8-value form for --current, and keys.go keeps the current bindings (the CLI commands add no TUI keybindings).

Testing

  • go build ./cmd/dispatch/ passes
  • go test ./... passes (full suite green, incl. race detector via mage install)
  • go vet ./... passes
  • New tests added for every command (compare_test.go, watch_test.go, tag_test.go, prune_test.go, aliases_test.go, stats_test.go, export_test.go, open_test.go)
  • Existing tests still pass; git status feature (feat(tui): add git status overlay with inline + preview push/pull stats #316) intact

Quality Gates

Gate Status Notes
build / vet PASS
test (+ race) PASS full suite via mage install
golangci-lint PASS fixed one exhaustive gap in tag.go
gofmt / gofumpt PASS
deadcode PASS

Screenshots

CLI commands (no UI). Run dispatch --help to see the new subcommands and flags.

…ats --csv, batch export

Add eight session-management CLI commands (integrated from parallel swarm work,
rebased onto current main):

- dispatch compare <a> <b>  side-by-side session comparison as text/JSON (#264)
- dispatch export --filter   batch-export filtered sessions (#265)
- dispatch watch             monitor session attention outside the TUI (#271)
- dispatch tag               add/remove/set/list session tags from the CLI (#273)
- dispatch aliases           list session aliases (#275)
- dispatch open --current    resume the most recent session scoped to the current
                             repo/branch/folder (#276)
- dispatch prune             clean stale session config entries (#277)
- dispatch stats --csv       CSV output for stats (#279)

Closes #264
Closes #265
Closes #271
Closes #273
Closes #275
Closes #276
Closes #277
Closes #279

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 524cf702-8922-4cfd-b23f-4069b734e09b
@jongio
jongio force-pushed the feat/swarm-cli-commands branch from ab9ca4b to cea169f Compare July 17, 2026 19:43
@jongio
jongio merged commit a820b56 into main Jul 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment