gh-cli
БесплатноБез исполняемых скриптовНе проверенUse GitHub CLI (gh) for common operations like creating PRs, viewing GitHub Actions logs, managing issues, GitHub Projects boards (gh project field/item…
от ericmjl★ 45 звёзд на GitHubОб этом скилле
GitHub CLI Operations
This skill provides quick access to common GitHub CLI operations for managing repositories, pull requests, issues, and GitHub Actions.
Requirements
gh(GitHub CLI) - must be authenticated with your GitHub account- Run
gh auth loginif not already authenticated
Common operations
Merge policy (PRs)
When merging with gh pr merge, always use rebase merge (--rebase): it reapplies the PR commits on top of the base branch for a linear history. Standing user rule (Eric, 2026-08-26: "rebases only, never any type of merge"): never squash (--squash), never a merge commit (--merge / plain merge), unless Eric explicitly asks for that style on a specific PR.
Merge commissions execute immediately (same turn)
When Eric commissions merges — "can be merged. use rebase", "we can merge all
PRs with rebase", "merge them all" — that message IS the execute signal, not a
discussion prompt. Run gh pr merge <n> --rebase --delete-branch for every
named PR in the SAME turn as the commission (validated 2026-08-27, website PRs
#291/#292; substituting deliberation for the merge commands drew a
"Take action now" interrupt — memories #2006/#2012).
For a STACK of PRs (a PR whose base is another PR's branch), merge bottom-up in
dependency order (e.g. #84 -> #85 -> #86), independent PRs in any order. Do NOT
pre-deliberate GitHub merge internals in prose (rebase-merge SHA replay, patch-ID
dedup, stacked-PR auto-retargeting when a base branch is deleted) — mechanics
questions resolve by ACTING then verifying: after each merge, check the next PR
with gh pr view <next> --json state,baseRefName before merging it. Mechanics
speculation is the stall form, not diligence (instance 2026-08-27: six-PR
rebase commission over two stacks answered with four paragraphs of GitHub
rebase-merge theory and zero tool calls, interrupted before any merge ran).
Pull requests
Create a new PR:
gh pr create --title "Your PR title" --body "Description of changes"
Create a PR with auto-fill (from commit messages):
gh pr create --fill
Create a draft PR:
gh pr create --draft --title "WIP: Feature X"
Create a PR with a rich markdown body (shell-escaping workaround):
PR bodies with backticks, parentheses (), dollar signs, or other shell-special
characters fail when passed inline via --body "..." because zsh/bash
interprets them. This is the most common failure when creating PRs with code
blocks, markdown links like [text](url), or any non-trivial formatting.
Use --body-file instead — write the body to a temp file first:
cat > /tmp/pr-body.md <<'EOF'
## Summary
Rich markdown with `backticks` and [links](https://example.com) here.
EOF
gh pr create --title "Title" --body-file /tmp/pr-body.md
The --body-file flag is supported by gh pr create, gh pr edit,
gh issue create, gh issue comment, and gh pr review. Use it as the
DEFAULT whenever the body is more than a simple one-liner — it avoids all
shell-escaping surprises.
List PRs:
# List open PRs
gh pr list
# List all PRs (including closed)
gh pr list --state all
# List your PRs
gh pr list --author @me
View a PR:
# View PR in terminal
gh pr view 123
# Open PR in browser
gh pr view 123 --web
Check out a PR locally:
gh pr checkout 123
Review a PR:
# Approve
gh pr review 123 --approve
# Request changes
gh pr review 123 --request-changes --body "Please fix the typo"
# Comment
gh pr review 123 --comment --body "Looks good overall"
Merge a PR (default to rebase; see Merge policy):
# Preferred: rebase and merge (linear history)
gh pr merge 123 --rebase
# Auto-merge when checks pass (still use rebase)
gh pr merge 123 --auto --rebase
# Only when explicitly desired: merge commit
gh pr merge 123 --merge
# Only when explicitly desired: squash and merge
gh pr merge 123 --squash
gh pr merge --auto requires BOTH repo settings: auto-merge enabled AND an allowed merge method
gh pr merge --auto --<method> fails permanently when the repo does not permit
it. TWO independent repo settings gate it:
- Auto-merge must be enabled on the repo (
allow_auto_merge: true— this is OFF by default). - The flag's merge method must be allowed (
allow_rebase_merge/allow_squash_merge/allow_merge_commit). A rebase-only repo rejects--squashno matter what.
Diagnose before writing merge flags into a workflow:
gh api repos/{owner}/{repo} \
--jq '{allow_auto_merge, allow_squash_merge, allow_rebase_merge, allow_merge_commit}'
In GitHub Actions, make the auto-merge step degrade gracefully instead of failing the job:
- name: Enable auto-merge
env:
GH_TOKEN: ${{ github.token }} # GH_TOKEN is gh's canonical env var
run: |
if ! gh pr merge --auto --rebase; then
echo "::warning::Auto-merge unavailable (disabled
Установить gh-cli в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл gh-cli?
Use GitHub CLI (gh) for common operations like creating PRs, viewing GitHub Actions logs, managing issues, GitHub Projects boards (gh project field/item automation), reviewing PRs, and more. When merging PRs via gh, use rebase merge only (--rebase) — standing user rule (Eric, 2026-08-26: "in general i want to do rebases only, never any type of merge"): never merge commits, never squash-merge, unless Eric explicitly requests otherwise for a specific PR.
Как установить скилл gh-cli?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл gh-cli запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic