cli / cli/cli

Allow aliases for repos

Open
#13,104 5 comments 0 reactions 0 assignees View on GitHub
enhancement extension-idea gh-repo stale
Dominant language
Go
Stars
46.3k
Forks
9k
Avg merge
2d 9h
Merged PRs (30d)
89

Description

### Describe the feature or problem you’d like to solve

When doing cross-repo work using `gh`, typing things like `-R Acme-Incorporated/industrial-widget-registration-service` over and over is tiresome.

### Proposed solution

It would be so lovely to define aliases for the repos I frequently use so I could type `-R api`, `-R ux`, `-R cms`, especially since many repos have less-than-perfect names for historical reasons (and changing a repo name is no small task with so many references to it spread around so many places).

I would just mirror the `gh alias` functionality with a new `gh repo-alias` subcommand (with different argument validation, obviously).

gh repo-alias set api Acme-Incorporated/industrial-widget-registration-service

### Additional context

For example, with repo aliases, then deploying could look like:

gh -R api workflow run deploy-stg.yaml -r rel-1.4.9
gh -R cms workflow run deploy-stg.yaml -r rel-1.4.2
gh -R ux workflow run deploy-stg.yaml -r rel-1.4.7

where you run only the commands for repos that had a change to be released using appropriate timing.

Or I could quickly check for PR approval status in a related repo without having to chdir over to there:

gh -R proto pr-approval

because I have `gh alias set pr-approval 'pr list --json number,headRefName,reviewDecision --jq '\''.[]|[.number, (.reviewDecision | if 0 < length then . else "n/a" end), .headRefName]|join(" ")'\'`

I did try to create an alias via `gh alias set api ' -R Acme-Inc/widget-service'`, but that does not work (and it would be a significantly less useful solution).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.