feat(cli): add dispatch alias to set and remove session aliases#337
Merged
Conversation
Aliases were list-only from the CLI (`dispatch aliases`); the only way to set or clear one was the TUI. This adds a `dispatch alias` mutator so aliases have the same CLI parity that `tag` and `notes` already have. Forms: dispatch alias <id> <name> assign or reassign an alias dispatch alias <id> --clear remove the alias on a session dispatch alias --remove <name> remove an alias by its name dispatch alias <id> <name> --json The <id> accepts the same short prefix that `dispatch open` does, and names reuse config's normalization and uniqueness rules so `dispatch open <alias>` keeps resolving to exactly one session. Wires the command into handleArgs, all four shell completion lists, usage, the man page examples, README, and CHANGELOG. Adds table-driven parser tests and runAlias coverage for set, reassign, clear, remove-by-name, duplicate rejection, unknown ID, and JSON output. Closes #331 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 732fe147-a68b-4784-8e17-ef089fb70ba3
# Conflicts: # CHANGELOG.md # cmd/dispatch/cli.go # cmd/dispatch/man.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
dispatch alias, a CLI mutator to set, reassign, clear, or remove a session alias. Aliases were list-only from the CLI (dispatch aliases); until now the only way to set or clear one was in the TUI. This gives aliases the same CLI parity thattagandnotesalready have.Forms
The
<id>accepts the same short prefix thatdispatch opendoes, and names reuse config's normalization and uniqueness rules, sodispatch open <alias>keeps resolving to exactly one session.Changes
cmd/dispatch/alias.go:runAlias,parseAliasArgs,resolveAliasSession,aliasResultcase "alias"intohandleArgsaliasto all four shell completion command lists (bash, zsh, fish, powershell)main.go, example in the man page,### Aliassection in README, CHANGELOG entrycmd/dispatch/alias_test.go: table-driven parser tests plusrunAliascoverage for set, reassign, clear, remove-by-name, duplicate rejection, unknown ID, and JSON outputVerify
go build ./...,go vet ./...,go test ./... -count=1all passgolangci-lint runreports 0 issuesmage deadcodeOKCloses #331