Skip to content

add alias command#9

Merged
skarim merged 2 commits intomainfrom
skarim/alias
Mar 27, 2026
Merged

add alias command#9
skarim merged 2 commits intomainfrom
skarim/alias

Conversation

@skarim
Copy link
Copy Markdown
Collaborator

@skarim skarim commented Mar 27, 2026

Fewer keystrokes by aliasing gs to gh stack. Adds a helper command that will create (and remove) the alias for you.

New alias command functionality:

  • Added a new alias subcommand (AliasCmd) that lets users create or remove a shell alias (default: gs) for gh stack, installing a wrapper script in ~/.local/bin/. The command validates alias names, checks for conflicts, and handles removal, with special instructions for Windows. (cmd/alias.go)
  • Registered the new alias command in the root command so it is available as a top-level CLI subcommand. (cmd/root.go)
  • Updated the root command registration test to include the new alias command, ensuring it is listed among available subcommands. (cmd/root_test.go)

Testing and validation:

  • Added comprehensive tests for alias creation, removal, validation, idempotency, and edge cases, ensuring robustness and correct error handling. (cmd/alias_test.go)

@skarim skarim marked this pull request as ready for review March 27, 2026 07:44
Copilot AI review requested due to automatic review settings March 27, 2026 07:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new gh stack alias subcommand to install/remove a short wrapper executable (default gs) that forwards to gh stack, and wires it into the root command.

Changes:

  • Register new alias subcommand in the root CLI.
  • Implement alias creation/removal via a marked wrapper script under ~/.local/bin.
  • Add tests covering alias name validation and wrapper install/remove behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
cmd/root.go Registers the new alias subcommand.
cmd/root_test.go Updates subcommand registration expectations to include alias.
cmd/alias.go Implements gh stack alias command, wrapper creation/removal, and helpers.
cmd/alias_test.go Adds unit tests for alias validation and wrapper install/remove logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/alias.go
Comment thread cmd/alias.go
Comment thread cmd/alias_test.go Outdated
Comment thread cmd/alias_test.go
Comment thread cmd/alias_test.go
Copy link
Copy Markdown

Copilot AI commented Mar 27, 2026

Warning

This is an internal experiment to assess Copilot's ability to auto-approve PRs. Please 👍 this comment if the assessment below is correct and 👎 if not. Feedback in #f-ccr-auto-approve is appreciated!

Copilot thinks this PR is not ready to approve — see review comments for details.

@skarim skarim merged commit facd16d into main Mar 27, 2026
7 checks passed
@skarim skarim deleted the skarim/alias branch March 27, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants