You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dispatch open <alias> resumes a session by its short alias, and the TUI can set aliases with A, but there is no way to list the aliases you have set from the command line. To see which alias maps to which session you have to open the TUI or read config.json by hand. dispatch tags already solves the same discovery problem for tags, so aliases are the odd one out.
flowchart TD
A[dispatch aliases] --> B[Load config SessionAliases]
B --> C[Load sessions from store]
C --> D{Alias target in store?}
D -->|yes| E[Show alias, id, summary, repo]
D -->|no| F[Mark as orphaned]
E --> G[Text or --json output]
F --> G
Loading
Proposed solution
Add a dispatch aliases command that lists every alias with the session it points at, mirroring the shape and flags of dispatch tags:
Print each alias, the target session ID (short form), and the session summary and repo when the session still exists.
Flag aliases whose target session is no longer in the store as orphaned, so stale entries are easy to spot.
Support --json for scripting, emitting a stable object with the alias list and counts.
Take no positional arguments; reject unknown flags with the same error style as the other subcommands.
Wire it into handleArgs, the usage banner, and shell completion (bash, zsh, fish, powershell) next to tags.
Acceptance criteria
dispatch aliases prints each alias with its target session ID, summary, and repo.
Aliases pointing at sessions that are no longer in the store are shown as orphaned.
dispatch aliases --json prints a stable JSON object with the alias entries and a total count.
With no aliases set, the command prints a clear empty-state message (and []/zero counts for --json).
The command is listed in dispatch help and all four completion scripts.
Unit tests cover the populated, empty, and orphaned cases, following the existing seam pattern.
Notes
config.SessionAliases already maps session ID to alias, and AliasFor/SessionIDForAlias exist. The session load path can reuse defaultStatsListSessions the way tags.go does.
Problem
dispatch open <alias>resumes a session by its short alias, and the TUI can set aliases withA, but there is no way to list the aliases you have set from the command line. To see which alias maps to which session you have to open the TUI or readconfig.jsonby hand.dispatch tagsalready solves the same discovery problem for tags, so aliases are the odd one out.flowchart TD A[dispatch aliases] --> B[Load config SessionAliases] B --> C[Load sessions from store] C --> D{Alias target in store?} D -->|yes| E[Show alias, id, summary, repo] D -->|no| F[Mark as orphaned] E --> G[Text or --json output] F --> GProposed solution
Add a
dispatch aliasescommand that lists every alias with the session it points at, mirroring the shape and flags ofdispatch tags:--jsonfor scripting, emitting a stable object with the alias list and counts.Wire it into
handleArgs, the usage banner, and shell completion (bash, zsh, fish, powershell) next totags.Acceptance criteria
dispatch aliasesprints each alias with its target session ID, summary, and repo.dispatch aliases --jsonprints a stable JSON object with the alias entries and a total count.[]/zero counts for--json).dispatch helpand all four completion scripts.Notes
config.SessionAliasesalready maps session ID to alias, andAliasFor/SessionIDForAliasexist. The session load path can reusedefaultStatsListSessionsthe waytags.godoes.