Skip to content

feat(cli): add dispatch alias to set and remove session aliases#337

Merged
jongio merged 2 commits into
mainfrom
idea/alias-cli
Jul 20, 2026
Merged

feat(cli): add dispatch alias to set and remove session aliases#337
jongio merged 2 commits into
mainfrom
idea/alias-cli

Conversation

@jongio

@jongio jongio commented Jul 19, 2026

Copy link
Copy Markdown
Owner

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 that tag and notes already have.

Forms

dispatch alias <id> review     # assign or reassign an alias
dispatch alias <id> --clear    # remove the alias on a session
dispatch alias --remove review # remove an alias by its name
dispatch alias <id> review --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.

Changes

  • cmd/dispatch/alias.go: runAlias, parseAliasArgs, resolveAliasSession, aliasResult
  • Wired case "alias" into handleArgs
  • Added alias to all four shell completion command lists (bash, zsh, fish, powershell)
  • Usage line in main.go, example in the man page, ### Alias section in README, CHANGELOG entry
  • cmd/dispatch/alias_test.go: table-driven parser tests plus runAlias coverage for set, reassign, clear, remove-by-name, duplicate rejection, unknown ID, and JSON output

Verify

  • go build ./..., go vet ./..., go test ./... -count=1 all pass
  • golangci-lint run reports 0 issues
  • mage deadcode OK

Closes #331

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
@jongio jongio added the idea Feature idea from the idea pipeline label Jul 19, 2026
@jongio jongio self-assigned this Jul 19, 2026
# Conflicts:
#	CHANGELOG.md
#	cmd/dispatch/cli.go
#	cmd/dispatch/man.go
@jongio
jongio merged commit 28bd601 into main Jul 20, 2026
2 checks passed
@jongio
jongio deleted the idea/alias-cli branch July 20, 2026 17:22
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 dispatch alias to set and remove session aliases from the CLI

1 participant