Skip to content

feat(gh-aliases): add GitHub CLI aliases plugin #13194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed unnecessary helper function
  • Loading branch information
3dyuval committed Jun 30, 2025
commit 0b657cd76d3cfd7804bd6a4da21f70bed8e260c3
73 changes: 0 additions & 73 deletions plugins/gh-aliases/gh-aliases.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -309,76 +309,3 @@ function ghpc-current() {
gh pr create
}

# ============================================
# Plugin Info Functions
# ============================================

# Function to list all gh aliases
function gh-aliases() {
alias | grep '^gh' | sed 's/=/ = /' | sort
}

# Function to search gh aliases
function gh-alias-search() {
if [[ -z "$1" ]]; then
echo "Usage: gh-alias-search <search-term>"
return 1
fi
alias | grep '^gh' | grep -i "$1" | sed 's/=/ = /'
}

# Function to show gh cheatsheet
function gh-cheat() {
cat <<'EOF'
GitHub CLI (gh) Aliases Cheatsheet
==================================

Authentication:
ghal = gh auth login ghas = gh auth status
ghaw = gh auth switch ghao = gh auth logout

Repository:
ghrc = gh repo clone ghrv = gh repo view
ghrl = gh repo list ghrf = gh repo fork
ghrn = gh repo create ghrs = gh repo sync

Issues:
ghic = gh issue create ghiv = gh issue view
ghil = gh issue list ghie = gh issue edit
ghix = gh issue close ghir = gh issue reopen

Pull Requests:
ghpc = gh pr create ghpv = gh pr view
ghpl = gh pr list ghpm = gh pr merge
ghpo = gh pr checkout ghpd = gh pr diff

Workflows:
ghwl = gh workflow list ghwr = gh workflow run
ghrnl = gh run list ghrnv = gh run view

Other:
ghs = gh status ghb = gh browse
gha = gh api ghh = gh help

Helper Functions:
ghrc-cd <repo> - Clone and cd into repo
gh-status - Show comprehensive status
gh-aliases - List all gh aliases
gh-cheat - Show this cheatsheet
EOF
}

# ============================================
# README Generation Function
# ============================================

function _gh_plugin_readme() {
cat <<'EOF'
# gh plugin

This plugin provides aliases and functions for the [GitHub CLI](https://cli.github.com/).

To use it, add `gh` to the plugins array in your zshrc file:

```zsh
plugins=(... gh)