From 355e21adb00544ea2ad4abc5dab60bc63531f585 Mon Sep 17 00:00:00 2001 From: minsoo-web Date: Mon, 2 Mar 2026 15:55:35 +0900 Subject: [PATCH 1/2] add gh skills --- .claude-plugin/marketplace.json | 7 +- plugins/gh-cli/.claude-plugin/plugin.json | 13 + plugins/gh-cli/README.md | 44 +++ plugins/gh-cli/skills/gh-cli/SKILL.md | 299 ++++++++++++++++++ .../gh-cli/references/auth-search-api.md | 237 ++++++++++++++ .../skills/gh-cli/references/prs-issues.md | 210 ++++++++++++ .../skills/gh-cli/references/repos-actions.md | 224 +++++++++++++ 7 files changed, 1033 insertions(+), 1 deletion(-) create mode 100644 plugins/gh-cli/.claude-plugin/plugin.json create mode 100644 plugins/gh-cli/README.md create mode 100644 plugins/gh-cli/skills/gh-cli/SKILL.md create mode 100644 plugins/gh-cli/skills/gh-cli/references/auth-search-api.md create mode 100644 plugins/gh-cli/skills/gh-cli/references/prs-issues.md create mode 100644 plugins/gh-cli/skills/gh-cli/references/repos-actions.md diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 030bb50..0242905 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -1,7 +1,7 @@ { "name": "kit", "description": "Community plugin & skills marketplace for Claude Code", - "version": "1.1.1", + "version": "1.2.0", "owner": { "name": "hamsurang", "email": "zlemzlem5656@naver.com" @@ -16,6 +16,11 @@ "name": "skill-review", "source": "./plugins/skill-review", "description": "Slash-command skill that reviews any SKILL.md against best practices and outputs a structured pass/fail report" + }, + { + "name": "gh-cli", + "source": "./plugins/gh-cli", + "description": "Auto-invoked skill for working with GitHub from the command line using the gh CLI tool" } ] } diff --git a/plugins/gh-cli/.claude-plugin/plugin.json b/plugins/gh-cli/.claude-plugin/plugin.json new file mode 100644 index 0000000..9405c92 --- /dev/null +++ b/plugins/gh-cli/.claude-plugin/plugin.json @@ -0,0 +1,13 @@ +{ + "name": "gh-cli", + "version": "1.0.0", + "description": "Auto-invoked skill for working with GitHub from the command line using the gh CLI tool", + "author": { + "name": "minsoo.web", + "github": "minsoo-web" + }, + "category": "git", + "license": "MIT", + "keywords": ["github", "gh", "cli", "pull-request", "issues"], + "skills": "./skills/" +} diff --git a/plugins/gh-cli/README.md b/plugins/gh-cli/README.md new file mode 100644 index 0000000..79c03d6 --- /dev/null +++ b/plugins/gh-cli/README.md @@ -0,0 +1,44 @@ +# gh-cli + +> Auto-invoked skill for working with GitHub from the command line using the `gh` CLI tool. + +```bash +claude plugin install gh-cli@hamsurang/kit +``` + +## What it does + +This skill activates automatically when you mention GitHub CLI operations — creating PRs, managing issues, checking CI runs, cloning repos, and more. It provides: + +- **Practical workflow patterns** for the most common daily tasks +- **JSON + jq examples** for scripting and automation +- **Quick reference** for flags, global options, and aliases +- **Extended references** for PRs/issues, repos/Actions, and auth/search/API + +## Trigger examples + +The skill activates on prompts like: + +- "create a PR for this branch" +- "list my open issues" +- "check if CI passed" +- "how do I merge this PR with squash?" +- "re-run the failed workflow" +- "fork this repo and clone it" +- "set a repo secret for CI" +- "gh auth is failing in CI" + +## Contents + +``` +skills/gh-cli/ +├── SKILL.md # Core workflow guide (loaded on trigger) +└── references/ + ├── prs-issues.md # Full PR & issue command reference + ├── repos-actions.md # Repo settings, Actions, secrets, variables + └── auth-search-api.md # Auth, search syntax, direct API calls +``` + +## License + +MIT diff --git a/plugins/gh-cli/skills/gh-cli/SKILL.md b/plugins/gh-cli/skills/gh-cli/SKILL.md new file mode 100644 index 0000000..5b521e1 --- /dev/null +++ b/plugins/gh-cli/skills/gh-cli/SKILL.md @@ -0,0 +1,299 @@ +--- +name: gh-cli +description: > + Use when working with GitHub from the command line using the gh CLI tool. Triggers on + "create PR", "open pull request", "gh command", "GitHub CLI", "list issues", "check CI", + "merge PR", "view workflow run", "gh auth", "clone repo", "fork repo", "create issue", + "review PR", "close issue", "release", or any GitHub operation from the terminal. + Always use this skill when the user wants to interact with GitHub repositories, + pull requests, issues, releases, or GitHub Actions via the command line — even if + they don't explicitly say "gh" or "GitHub CLI". +--- + +# GitHub CLI (gh) — Practical Workflow Guide + +The `gh` CLI lets you do everything GitHub without leaving the terminal. + +> **Version:** 2.85.0+ | **Docs:** [cli.github.com](https://cli.github.com) +> +> For detailed command options, see the `references/` files linked throughout. + +--- + +## Quick Start + +```bash +# Install +brew install gh # macOS +sudo apt install gh # Ubuntu/Debian +winget install --id GitHub.cli # Windows + +# Authenticate +gh auth login # Interactive (recommended) +gh auth status # Verify login +``` + +--- + +## Pull Requests + +### Create a PR + +```bash +# Interactive — gh fills in title/body from commit messages +gh pr create + +# One-liner +gh pr create --title "feat: add dark mode" --body "Closes #42" + +# Draft PR +gh pr create --draft --title "WIP: refactor auth" + +# Target a specific base branch +gh pr create --base develop --title "feat: add feature" + +# Open the new PR in browser immediately +gh pr create --web +``` + +### Review & Merge + +```bash +# List open PRs in current repo +gh pr list + +# View PR details (with diff) +gh pr view 123 +gh pr view 123 --web # Open in browser + +# Check out a PR locally +gh pr checkout 123 + +# Review: approve / request changes / comment +gh pr review 123 --approve +gh pr review 123 --request-changes --body "Please add tests" +gh pr review 123 --comment --body "Looks good, but minor nit below" + +# Merge (default: merge commit) +gh pr merge 123 +gh pr merge 123 --squash # Squash merge +gh pr merge 123 --rebase # Rebase merge +gh pr merge 123 --auto # Auto-merge when checks pass +``` + +### PR Status & Search + +```bash +# PRs assigned to you or mentioning you +gh pr list --author "@me" +gh pr list --assignee "@me" +gh pr list --search "review-requested:@me" + +# Filter by label or state +gh pr list --label "bug" --state open +gh pr list --state merged --limit 20 + +# Show all checks for a PR +gh pr checks 123 +``` + +--- + +## Issues + +### Create & Edit + +```bash +# Interactive +gh issue create + +# One-liner +gh issue create --title "Bug: login fails on Safari" --body "Steps to reproduce..." + +# With labels and assignee +gh issue create --title "feat: dark mode" --label "enhancement" --assignee "@me" + +# Edit an issue +gh issue edit 42 --title "Updated title" --add-label "priority:high" +``` + +### List & Close + +```bash +# List open issues +gh issue list + +# Filter +gh issue list --label "bug" +gh issue list --assignee "@me" +gh issue list --search "is:open label:bug created:>2024-01-01" + +# View issue +gh issue view 42 +gh issue view 42 --web + +# Close / reopen +gh issue close 42 +gh issue close 42 --comment "Fixed in #123" +gh issue reopen 42 +``` + +--- + +## Repositories + +```bash +# Clone a repo +gh repo clone owner/repo +gh repo clone owner/repo -- --depth 1 # Shallow clone + +# Fork and clone in one step +gh repo fork owner/repo --clone + +# Create a new repo +gh repo create my-app --public --clone +gh repo create my-app --private --description "My new project" + +# View repo info +gh repo view +gh repo view owner/repo --web + +# List repos for a user/org +gh repo list # Your repos +gh repo list my-org --limit 50 # Org repos +``` + +--- + +## GitHub Actions + +```bash +# List recent workflow runs +gh run list +gh run list --workflow ci.yml +gh run list --branch main --status failure --limit 10 + +# Watch a run in real time +gh run watch + +# View run logs +gh run view 12345678 +gh run view 12345678 --log + +# Re-run failed jobs only +gh run rerun 12345678 --failed + +# Trigger a workflow manually +gh workflow run ci.yml +gh workflow run deploy.yml --field environment=staging + +# List workflows +gh workflow list +gh workflow enable ci.yml +gh workflow disable old-workflow.yml +``` + +--- + +## Releases + +```bash +# List releases +gh release list + +# View latest release +gh release view + +# Create a release +gh release create v1.2.0 +gh release create v1.2.0 --title "v1.2.0 — Dark Mode" --notes "Added dark mode support" +gh release create v1.2.0 ./dist/*.tar.gz # Attach assets + +# Upload additional assets to an existing release +gh release upload v1.2.0 ./dist/app.zip +``` + +--- + +## JSON Output & Scripting + +`gh` returns rich JSON via `--json`. Pair with `jq` for powerful filtering. + +```bash +# List PR titles and numbers +gh pr list --json number,title --jq '.[] | "\(.number): \(.title)"' + +# Get PR's head branch name +gh pr view 123 --json headRefName --jq '.headRefName' + +# Check if all PR checks passed +gh pr checks 123 --json name,state --jq '[.[] | select(.state != "SUCCESS")] | length == 0' + +# Get issue labels +gh issue view 42 --json labels --jq '.labels[].name' + +# Find failing workflow runs +gh run list --json status,name,url --jq '.[] | select(.status == "failure") | .url' + +# Count open PRs by author +gh pr list --state open --json author --jq 'group_by(.author.login) | map({author: .[0].author.login, count: length})' +``` + +--- + +## Useful Global Flags + +| Flag | Description | +|------|-------------| +| `--repo owner/repo` | Target a specific repo (skip cd) | +| `--json field1,field2` | Return JSON for scripting | +| `--jq ` | Filter JSON with jq expression | +| `--web` | Open in browser | +| `--paginate` | Fetch all pages (use with `--json`) | +| `--limit N` | Limit results (default varies) | + +```bash +# Operate on a repo without cd-ing into it +gh pr list --repo facebook/react --limit 5 + +# Paginate all issues as JSON +gh issue list --paginate --json number,title,state +``` + +--- + +## Quick Aliases (save typing) + +```bash +# Set up convenient aliases +gh alias set prc 'pr create --web' +gh alias set prl 'pr list --assignee @me' +gh alias set isl 'issue list --assignee @me' + +# Use them +gh prc # open PR creation in browser +gh prl # list your PRs +gh isl # list your issues +``` + +--- + +## Common Troubleshooting + +| Problem | Fix | +|---------|-----| +| `gh: command not found` | `brew install gh` or see [install guide](https://cli.github.com) | +| `Not logged in` | `gh auth login` | +| Permission denied | `gh auth refresh --scopes repo,workflow` | +| Wrong repo targeted | Add `--repo owner/repo` or `cd` into the repo | +| Stale token | `gh auth refresh` | + +--- + +## More Detail + +For exhaustive flag lists and advanced options, see: + +- [`references/prs-issues.md`](references/prs-issues.md) — PR reviews, issue templates, milestones, projects +- [`references/repos-actions.md`](references/repos-actions.md) — repo settings, Actions secrets/variables, caches, artifacts +- [`references/auth-search-api.md`](references/auth-search-api.md) — auth flows, search syntax, direct API calls diff --git a/plugins/gh-cli/skills/gh-cli/references/auth-search-api.md b/plugins/gh-cli/skills/gh-cli/references/auth-search-api.md new file mode 100644 index 0000000..a02de68 --- /dev/null +++ b/plugins/gh-cli/skills/gh-cli/references/auth-search-api.md @@ -0,0 +1,237 @@ +# Auth, Search & API — Extended Reference + +## Authentication + +### gh auth login + +```bash +# Interactive (recommended — handles SSH key setup too) +gh auth login + +# Non-interactive: pipe token from stdin +echo "$GITHUB_TOKEN" | gh auth login --with-token + +# GitHub Enterprise Server +gh auth login --hostname enterprise.internal + +# Specific protocol +gh auth login --git-protocol ssh|https + +# Web-based OAuth +gh auth login --web +``` + +### Managing accounts + +```bash +gh auth status # Show all authenticated accounts +gh auth status --show-token # Display the actual token + +# Multiple accounts: switch between them +gh auth switch +gh auth switch --hostname github.com --user alice + +# Get token for scripting +gh auth token +export GH_TOKEN=$(gh auth token) + +# Refresh token / add scopes +gh auth refresh +gh auth refresh --scopes "repo,workflow,write:packages" +gh auth refresh --remove-scopes "delete_repo" + +# Log out +gh auth logout +gh auth logout --hostname github.com --user alice +``` + +### Environment variables for CI/CD + +```bash +# These env vars override stored credentials +export GH_TOKEN=ghp_xxxxxxxxxxxx # GitHub token +export GH_HOST=github.com # Override hostname +export GH_REPO=owner/repo # Override default repo +export GH_ENTERPRISE_HOSTNAME=ghe.company.com + +# Disable interactive prompts in CI +export GH_PROMPT_DISABLED=true + +# Example: use in GitHub Actions +- name: List PRs + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh pr list --state open +``` + +--- + +## Search + +### gh search — cross-repository + +```bash +# Search repositories +gh search repos "language:typescript stars:>1000" +gh search repos "org:vercel topic:react" --limit 20 +gh search repos "created:>2024-01-01 stars:>500" --json fullName,stargazersCount + +# Search issues and PRs +gh search issues "is:open label:bug repo:vercel/next.js" +gh search prs "is:merged author:@me merged:>2024-01-01" +gh search prs "review-requested:@me is:open" --json number,title,url + +# Search commits +gh search commits "fix auth" --repo owner/repo +gh search commits "merge" --author alice --limit 10 + +# Search code +gh search code "useState" --repo facebook/react --language typescript +gh search code "TODO" --owner my-org --language go +``` + +### Useful search qualifiers + +| Qualifier | Example | Description | +|-----------|---------|-------------| +| `is:` | `is:open`, `is:merged` | State filter | +| `author:` | `author:@me` | By author | +| `assignee:` | `assignee:@me` | By assignee | +| `label:` | `label:bug` | By label | +| `milestone:` | `milestone:"v2.0"` | By milestone | +| `created:` | `created:>2024-01-01` | Date range | +| `updated:` | `updated:<2024-06-01` | Last updated | +| `repo:` | `repo:owner/name` | Specific repo | +| `org:` | `org:vercel` | Organization | +| `language:` | `language:typescript` | Code language | +| `stars:` | `stars:>1000` | Star count | +| `sort:` | `sort:updated-desc` | Sort order | +| `no:` | `no:assignee` | Missing field | + +--- + +## Direct API Access + +`gh api` lets you call any GitHub REST or GraphQL endpoint with auth handled automatically. + +### REST API patterns + +```bash +# GET (default) +gh api repos/{owner}/{repo} +gh api user +gh api orgs/my-org/members + +# POST +gh api repos/{owner}/{repo}/issues \ + --method POST \ + --field title="Bug report" \ + --field body="Something is broken" \ + --field labels[]="bug" + +# PATCH +gh api repos/{owner}/{repo}/issues/42 \ + --method PATCH \ + --field state="closed" + +# DELETE +gh api repos/{owner}/{repo}/labels/123 --method DELETE + +# Pagination — fetch all pages at once +gh api repos/{owner}/{repo}/issues --paginate \ + --jq '.[].title' + +# Use {owner} and {repo} placeholders (auto-filled from current repo) +gh api repos/{owner}/{repo}/pulls --jq '.[].number' +``` + +### GraphQL + +```bash +gh api graphql -f query=' + query($owner: String!, $name: String!, $n: Int!) { + repository(owner: $owner, name: $name) { + pullRequests(last: $n, states: OPEN) { + nodes { + number + title + author { login } + } + } + } + } +' -f owner=facebook -f name=react -F n=5 + +# From a file +gh api graphql --input query.graphql +``` + +### jq cheat sheet for gh output + +```bash +# Extract a single field +gh api user --jq '.login' + +# Map over array +gh pr list --json number,title --jq '.[] | "\(.number): \(.title)"' + +# Filter array +gh run list --json status,name --jq '.[] | select(.status == "failure") | .name' + +# Count +gh issue list --json number --jq 'length' + +# Sort and limit +gh pr list --json number,createdAt --jq 'sort_by(.createdAt) | reverse | .[0:5]' + +# Nested access +gh api user --jq '.plan.name' + +# Key-value pairs +gh pr view 123 --json labels --jq '.labels | map(.name) | join(", ")' +``` + +--- + +## Configuration + +```bash +gh config list # Show all settings +gh config get editor +gh config set editor "code --wait" # VS Code +gh config set editor "nvim" +gh config set git_protocol ssh|https +gh config set prompt enabled|disabled +gh config set pager "less -R" +gh config set browser "open" + +gh config clear-cache # Clear HTTP cache +``` + +### Aliases + +```bash +gh alias list +gh alias set co 'pr checkout' # gh co 123 +gh alias set prc 'pr create --web' +gh alias set mine 'issue list --assignee @me' +gh alias set ready '!gh pr list --state open | fzf | cut -f1 | xargs gh pr ready' + +gh alias delete co +``` + +--- + +## SSH & GPG Keys + +```bash +# SSH keys +gh ssh-key list +gh ssh-key add ~/.ssh/id_ed25519.pub --title "My laptop" +gh ssh-key delete 12345 + +# GPG keys +gh gpg-key list +gh gpg-key add ./public-key.asc +gh gpg-key delete ABC123 +``` diff --git a/plugins/gh-cli/skills/gh-cli/references/prs-issues.md b/plugins/gh-cli/skills/gh-cli/references/prs-issues.md new file mode 100644 index 0000000..1928d54 --- /dev/null +++ b/plugins/gh-cli/skills/gh-cli/references/prs-issues.md @@ -0,0 +1,210 @@ +# PRs & Issues — Extended Reference + +## Pull Requests: Full Options + +### gh pr create + +```bash +gh pr create \ + --title "feat: dark mode" \ + --body "Closes #42" \ + --base main \ + --head my-feature-branch \ + --draft \ + --assignee "@me" \ + --reviewer alice,bob \ + --label "enhancement,frontend" \ + --milestone "v2.0" \ + --project "Roadmap" +``` + +### gh pr list + +```bash +gh pr list --state open|closed|merged|all +gh pr list --base main # PRs targeting main +gh pr list --head feature-branch # PRs from a specific branch +gh pr list --author "@me" +gh pr list --assignee alice +gh pr list --label "bug" +gh pr list --search "is:open review:approved" +gh pr list --search "review-requested:@me is:open" +gh pr list --draft # Draft PRs only +gh pr list --limit 100 +``` + +### gh pr view + +```bash +gh pr view # Current branch's PR +gh pr view 123 +gh pr view 123 --comments # Show comments +gh pr view 123 --json number,title,state,body,labels,reviews +``` + +### gh pr edit + +```bash +gh pr edit 123 --title "New title" +gh pr edit 123 --body "Updated description" +gh pr edit 123 --add-label "priority:high" --remove-label "needs-triage" +gh pr edit 123 --add-reviewer alice --remove-reviewer bob +gh pr edit 123 --add-assignee "@me" +gh pr edit 123 --milestone "v2.0" +``` + +### gh pr merge + +```bash +gh pr merge 123 # Interactive merge type selection +gh pr merge 123 --merge # Create merge commit +gh pr merge 123 --squash # Squash and merge +gh pr merge 123 --rebase # Rebase and merge +gh pr merge 123 --auto # Enable auto-merge (when checks pass) +gh pr merge 123 --delete-branch # Delete head branch after merge +gh pr merge 123 --squash --delete-branch --body "squash commit message" +``` + +### gh pr review + +```bash +gh pr review 123 --approve +gh pr review 123 --request-changes --body "Please add unit tests" +gh pr review 123 --comment --body "Style nit on line 42" +``` + +### gh pr checks + +```bash +gh pr checks 123 +gh pr checks 123 --watch # Watch until all checks complete +gh pr checks 123 --fail-fast # Exit as soon as any check fails +gh pr checks 123 --json name,state,link +``` + +### gh pr diff / comment + +```bash +gh pr diff 123 +gh pr diff 123 --patch # Output as .patch file +gh pr comment 123 --body "LGTM!" +gh pr comment 123 --body-file comment.md +gh pr comment 123 --edit-last # Edit your last comment +``` + +### gh pr close / reopen / lock + +```bash +gh pr close 123 +gh pr close 123 --comment "Closing in favor of #456" --delete-branch +gh pr reopen 123 +gh pr lock 123 --reason "resolved|off-topic|too heated|spam" +gh pr unlock 123 +``` + +--- + +## Issues: Full Options + +### gh issue create + +```bash +gh issue create \ + --title "Bug: login fails" \ + --body "Steps: 1. Go to /login 2. Click submit 3. See error" \ + --label "bug,priority:high" \ + --assignee "@me,alice" \ + --milestone "Sprint 5" \ + --project "Bug Tracker" + +# From a template +gh issue create --template bug_report.md +``` + +### gh issue list + +```bash +gh issue list --state open|closed|all +gh issue list --assignee "@me" +gh issue list --author alice +gh issue list --label "bug" +gh issue list --milestone "Sprint 5" +gh issue list --mention "@me" +gh issue list --search "is:open label:bug no:assignee" +gh issue list --search "is:open created:>2024-06-01 sort:updated-desc" +gh issue list --limit 200 --json number,title,state,labels +``` + +### gh issue view / edit / close + +```bash +gh issue view 42 --comments +gh issue view 42 --json number,title,state,body,labels,assignees,comments + +gh issue edit 42 \ + --title "Updated: login bug" \ + --add-label "regression" \ + --remove-label "needs-triage" \ + --add-assignee alice \ + --remove-assignee bob + +gh issue close 42 --comment "Fixed in PR #123" +gh issue close 42 --reason "completed|not planned" +gh issue reopen 42 +``` + +### gh issue comment / lock / pin / transfer + +```bash +gh issue comment 42 --body "Still reproducible on v2.1" +gh issue comment 42 --body-file update.md +gh issue comment 42 --edit-last + +gh issue lock 42 --reason "resolved|off-topic|too heated|spam" +gh issue unlock 42 + +gh issue pin 42 +gh issue unpin 42 + +gh issue transfer 42 owner/other-repo +``` + +### gh issue develop (linked branches) + +```bash +# Create a branch linked to an issue +gh issue develop 42 +gh issue develop 42 --name "fix/login-safari" --base develop + +# List branches linked to an issue +gh issue develop 42 --list +``` + +--- + +## Labels + +```bash +gh label list +gh label create "priority:high" --color "FF0000" --description "Urgent" +gh label edit "priority:high" --name "p1" --color "D93F0B" +gh label delete "wontfix" + +# Clone labels from another repo +gh label clone owner/source-repo +``` + +--- + +## Milestones (via API) + +```bash +# List milestones +gh api repos/{owner}/{repo}/milestones --jq '.[].title' + +# Create milestone +gh api repos/{owner}/{repo}/milestones \ + --method POST \ + --field title="v2.0" \ + --field due_on="2024-12-31T00:00:00Z" +``` diff --git a/plugins/gh-cli/skills/gh-cli/references/repos-actions.md b/plugins/gh-cli/skills/gh-cli/references/repos-actions.md new file mode 100644 index 0000000..0ec9217 --- /dev/null +++ b/plugins/gh-cli/skills/gh-cli/references/repos-actions.md @@ -0,0 +1,224 @@ +# Repos & GitHub Actions — Extended Reference + +## Repositories + +### gh repo create + +```bash +gh repo create my-app --public --clone +gh repo create my-app --private --description "My project" --clone +gh repo create org/my-app --internal --team "backend" + +# From a template repo +gh repo create my-app --template owner/template-repo --clone + +# With homepage and topics +gh repo create my-app --public \ + --description "Awesome app" \ + --homepage "https://myapp.io" \ + --add-readme \ + --gitignore Node \ + --license MIT +``` + +### gh repo clone / fork / sync + +```bash +gh repo clone owner/repo +gh repo clone owner/repo -- --depth 1 --branch main + +# Fork (creates fork in your account) +gh repo fork owner/repo +gh repo fork owner/repo --clone # Fork and clone immediately +gh repo fork owner/repo --fork-name my-fork +gh repo fork owner/repo --org my-org # Fork into org + +# Sync fork with upstream +gh repo sync # Sync current fork's default branch +gh repo sync --branch main +gh repo sync owner/fork --source owner/upstream +``` + +### gh repo view / edit + +```bash +gh repo view +gh repo view owner/repo --web +gh repo view owner/repo --json name,description,visibility,url,defaultBranchRef + +gh repo edit \ + --description "New description" \ + --homepage "https://new-url.io" \ + --visibility public|private \ + --default-branch main \ + --enable-issues \ + --disable-wiki \ + --enable-auto-merge \ + --enable-squash-merge \ + --enable-rebase-merge \ + --delete-branch-on-merge +``` + +### gh repo archive / delete / rename + +```bash +gh repo archive owner/repo +gh repo delete owner/repo --confirm # DESTRUCTIVE — no undo +gh repo rename new-name +``` + +### gh repo deploy-key + +```bash +gh repo deploy-key list +gh repo deploy-key add ./id_rsa.pub --title "CI deploy key" --allow-write +gh repo deploy-key delete 12345 +``` + +--- + +## GitHub Actions + +### Workflow Runs + +```bash +# List runs +gh run list +gh run list --workflow ci.yml +gh run list --branch main +gh run list --status failure|success|in_progress|queued|cancelled +gh run list --user alice +gh run list --commit abc1234 +gh run list --event push|pull_request|workflow_dispatch +gh run list --limit 50 + +# View a run +gh run view 12345678 +gh run view 12345678 --log +gh run view 12345678 --log-failed # Only failed job logs +gh run view 12345678 --job 98765432 # Specific job + +# Watch run in real time +gh run watch +gh run watch 12345678 +gh run watch 12345678 --exit-status # Exit with run's exit code + +# Re-run +gh run rerun 12345678 # Re-run all jobs +gh run rerun 12345678 --failed # Re-run only failed jobs +gh run rerun 12345678 --job 98765432 # Re-run specific job + +# Cancel +gh run cancel 12345678 + +# Download artifacts +gh run download 12345678 +gh run download 12345678 --name artifact-name +gh run download 12345678 --dir ./downloads +``` + +### Workflows + +```bash +gh workflow list +gh workflow list --all # Include disabled +gh workflow view ci.yml +gh workflow view ci.yml --web + +# Trigger manually (workflow_dispatch) +gh workflow run ci.yml +gh workflow run deploy.yml --field environment=prod --field version=v2.0 +gh workflow run release.yml --ref release/v2.0 + +# Enable / disable +gh workflow enable ci.yml +gh workflow disable old-deploy.yml +``` + +### Secrets + +```bash +# Repository secrets +gh secret list +gh secret set MY_TOKEN # Prompts for value +echo "secret-value" | gh secret set MY_TOKEN +gh secret set MY_TOKEN --body "secret-value" +gh secret set MY_TOKEN < ./token.txt +gh secret delete MY_TOKEN + +# Environment secrets +gh secret list --env production +gh secret set DB_PASSWORD --env production + +# Organization secrets +gh secret list --org my-org +gh secret set SHARED_TOKEN --org my-org --visibility all|private|selected +``` + +### Variables + +```bash +gh variable list +gh variable get APP_ENV +gh variable set APP_ENV --body "production" +gh variable set APP_ENV # Interactive +gh variable delete APP_ENV + +# Environment variables +gh variable list --env staging +gh variable set BASE_URL --env staging --body "https://staging.myapp.io" + +# Organization variables +gh variable list --org my-org +gh variable set ORG_SETTING --org my-org --visibility all +``` + +### Caches + +```bash +gh cache list +gh cache list --key "node-modules-" +gh cache list --sort size|created_at --order desc +gh cache list --json id,key,sizeInBytes,ref + +gh cache delete 12345678 +gh cache delete --all # Delete ALL caches (careful!) +``` + +### Artifacts + +```bash +# Download artifacts from a run +gh run download 12345678 +gh run download 12345678 --name "build-output" --dir ./artifacts +``` + +--- + +## Codespaces + +```bash +gh codespace list +gh codespace create --repo owner/repo +gh codespace create --repo owner/repo --machine premiumLinux --branch feature +gh codespace code --codespace my-codespace # Open in VS Code +gh codespace ssh --codespace my-codespace # SSH into codespace +gh codespace stop --codespace my-codespace +gh codespace delete --codespace my-codespace +gh codespace ports # List forwarded ports +gh codespace ports forward 3000:3000 # Forward a port +``` + +--- + +## Environments (via API) + +```bash +# List environments +gh api repos/{owner}/{repo}/environments --jq '.environments[].name' + +# Create/update environment +gh api repos/{owner}/{repo}/environments/production \ + --method PUT \ + --field wait_timer=5 +``` From ddd1651294c669fa1a7b14ffdafc5252b73f1d3c Mon Sep 17 00:00:00 2001 From: minsoo-web Date: Mon, 2 Mar 2026 16:06:13 +0900 Subject: [PATCH 2/2] version update --- .claude-plugin/marketplace.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 5decaf8..d518378 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -1,7 +1,7 @@ { "name": "kit", "description": "Community plugin & skills marketplace for Claude Code", - "version": "1.2.0", + "version": "1.3.0", "owner": { "name": "hamsurang", "email": "zlemzlem5656@naver.com"