GitHub CLI

330 commands

gh auth logingh auth logoutgh auth statusgh repo create myrepo --publicgh repo create myrepo --privategh repo clone user/repogh repo fork user/repogh repo view user/repogh repo view --webgh repo listgh issue create --title 'Bug' --body 'Description'gh issue listgh issue list --state closedgh issue view 42gh issue comment 42 -b 'This is fixed in #45'gh issue close 42gh pr create --title 'Feature' --body 'PR body' --base maingh pr listgh pr view 15gh pr merge 15 --squashgh pr review 15 --approvegh pr checkout 15gh pr statusgh workflow listgh workflow run deploy.ymlgh run listgh run view 12345gh gist create file.txt --publicgh gist listgh release create v1.0.0 --title 'v1.0.0' --notes 'Release notes'gh release listgh secret set API_KEYgh secret listgh search repos 'linux cli' --language=pythongh auth login --with-token < token.txtgh auth login --hostname github.example.comgh auth tokengh auth refreshgh auth refresh --scopes 'repo,read:org'gh auth setup-gitgh api /usergh api /repos/owner/repo/issuesgh api -X POST /repos/owner/repo/issues --field title='Bug' --field body='Details'gh api -X PATCH /repos/owner/repo --field description='New desc'gh api -X DELETE /repos/owner/repo/issues/1/labels/buggh api --method PUT /repos/owner/repo/topics --field names[]='devops'gh api -H 'Accept: application/vnd.github+json' /repos/owner/repogh api --paginate /repos/owner/repo/issuesgh api --jq '.[] | .title' /repos/owner/repo/issuesgh api graphql -f query='{ viewer { login } }'gh api --input payload.json /repos/owner/repo/releasesgh api --include /usergh repo archive owner/repogh repo archive --yes owner/repogh repo delete owner/repo --yesgh repo edit --visibility privategh repo edit --enable-issues=falsegh repo edit --enable-wiki=falsegh repo edit --default-branch maingh repo fork owner/repo --clonegh repo fork owner/repo --remotegh repo rename new-namegh repo syncgh repo sync --branch maingh repo unarchive owner/repogh repo deploy-key listgh repo deploy-key add ~/.ssh/id_rsa.pub --title 'CI Key'gh repo deploy-key delete 123gh issue develop 42gh issue develop 42 --checkoutgh issue edit 42 --title 'New Title'gh issue edit 42 --add-label 'bug,priority:high'gh issue edit 42 --remove-label 'wip'gh issue edit 42 --milestone 'v2.0'gh issue edit 42 --add-assignee @megh issue lock 42 --reason off-topicgh issue pin 42gh issue reopen 42gh issue transfer 42 owner/other-repogh pr checksgh pr checks --watchgh pr close 42gh pr close 42 --delete-branchgh pr comment 42 --body 'LGTM!'gh pr diffgh pr diff --name-onlygh pr edit 42 --title 'Better title'gh pr edit 42 --add-reviewer teammategh pr ready 42gh pr reopen 42gh pr review --approvegh pr review --request-changes --body 'Please fix X'gh pr update-branchgh run list --workflow=ci.ymlgh run list --limit 20gh run view 123456gh run view --loggh run view 123456 --log-failedgh run watch 123456gh run cancel 123456gh run rerun 123456gh run rerun --failed 123456gh run download 123456 -n my-artifactgh run delete 123456gh workflow view ci.ymlgh workflow run ci.ymlgh workflow run ci.yml --ref feature-branchgh workflow run ci.yml --field env=staginggh workflow enable ci.ymlgh workflow disable ci.ymlgh release view v1.0.0gh release create v1.0.0 --title 'v1.0.0' --notes 'Initial release'gh release create v1.0.0 dist/*.zip --draftgh release create v1.0.0 --generate-notesgh release edit v1.0.0 --draft=falsegh release edit v1.0.0 --prereleasegh release download v1.0.0gh release download v1.0.0 -p '*.zip'gh release upload v1.0.0 build/app.zipgh release delete v1.0.0 --yesgh release delete-asset v1.0.0 old-asset.zip --yesgh secret set API_KEY --body 'myvalue'gh secret set API_KEY --env productiongh secret delete API_KEYgh variable set APP_URL --body 'https://example.com'gh variable listgh variable delete APP_URLgh codespace creategh codespace create --machine standardLinux32gbgh codespace listgh codespace sshgh codespace codegh codespace stop --codespace NAMEgh codespace delete --codespace NAMEgh codespace portsgh codespace ports forward 3000:3000gh codespace logsgh codespace rebuildgh codespace cp file.txt remote:/workspace/gh codespace edit --display-name 'My Dev Box'gh search repos 'cli tool' --language go --stars '>1000'gh search issues 'memory leak' --repo owner/repo --state opengh search prs --assignee @me --state opengh search commits 'fix null pointer' --repo owner/repogh search code 'TODO:' --repo owner/repogh gist create script.sh --publicgh gist create --public -d 'My script' script.shgh gist view GIST_IDgh gist view GIST_ID --rawgh gist clone GIST_IDgh gist edit GIST_IDgh gist rename GIST_ID old.txt new.shgh gist delete GIST_IDgh label listgh label create 'priority:high' --color FF0000 --description 'Urgent'gh label edit 'bug' --color 'd73a4a' --description 'Something is broken'gh label delete 'wontfix'gh label clone owner/other-repogh cache listgh cache delete CACHE_KEYgh cache delete --allgh alias set co 'pr checkout'gh alias listgh alias delete cogh alias import aliases.ymlgh config get editorgh config set editor 'code --wait'gh config set prompt disabledgh config listgh extension install owner/gh-extensiongh extension listgh extension upgrade --allgh extension remove gh-extensiongh extension browsegh ssh-key listgh ssh-key add ~/.ssh/id_ed25519.pub --title 'Laptop'gh ssh-key delete KEY_IDgh gpg-key listgh gpg-key add public.ascgh gpg-key delete KEY_IDgh statusgh pr create --fill --label bug --reviewer alicegh pr create -H feature -B main --fillgh pr create --draft --title 'WIP: spike' --body 'Experimental changes'gh pr list --state merged --limit 50gh pr list --search 'is:open label:bug'gh pr list --author @me --draftgh pr list --base main --head feature-xgh pr list --json number,title,headRefName --jq '.[] | "\(.number) \(.title)"'gh pr view 123 --json title,body,filesgh pr view 123 --commentsgh pr view 123 --webgh pr diff 123gh pr checkout 123 --branch review-fixgh pr merge 123 --squash --delete-branchgh pr merge 123 --rebase --autogh pr merge 123 --merge --admingh pr ready 123 --undogh pr edit 123 --add-label 'needs-review'gh pr edit 123 --remove-label 'wip'gh pr close 123 --comment 'Superseded by #9'gh pr comment 123 --body-file review.mdgh pr review 123 --approvegh pr review 123 --request-changes --body 'fix tests'gh pr review 123 --comment --body 'LGTM, one nit'gh pr checks 123gh pr checks 123 --watchgh pr lock 123 --reason resolvedgh pr unlock 123gh pr update-branch 123 --rebasegh issue list --assignee @megh issue list --label bug --milestone 'v2.0'gh issue list --search 'is:open label:bug' --limit 30gh issue list --webgh issue view 5 --commentsgh issue view 5 --json number,title,labels,assigneesgh issue edit 5 --add-label triagegh issue edit 5 --add-assignee @me --remove-label 'needs-triage'gh issue close 5 --comment 'fixed in #10'gh issue close 5 --duplicate-of 12gh issue lock 5 --reason spamgh issue unlock 5gh issue unpin 5gh issue develop 5 --name fix-issue-5gh issue comment 5 --edit-last --body 'Updated repro steps'gh workflow list --allgh workflow enable 654321gh workflow disable 654321gh workflow run build.yml --ref maingh workflow run deploy.yml -f env=prodgh workflow run release.yml --ref v1.2.0 -f version=1.2.0gh workflow view build.yml --yamlgh workflow view build.yml --webgh run list --workflow build.yml --branch maingh run list --status failure --limit 10gh run view 123 --webgh run view 123 --job 424242 --log-failedgh run watch 123 --exit-statusgh run rerun 123 --job 424242gh run download 123 --pattern '*.tar.gz' --dir dist/gh secret list --env productiongh secret set MY_SECRET --env production --body 'supersecret'gh secret set MY_SECRET --org myorg --visibility selected --repos myapp,myapp-apigh secret delete MY_SECRET --env productiongh variable list --env productiongh variable set MY_VAR --env production --body 'https://api.example.com'gh variable set MY_VAR --org myorg --body 'value' --visibility selected --repos myappgh variable delete MY_VAR --env productiongh release create v1.1.0 --generate-notes --target maingh release create v1.1.0 --title 'v1.1.0' --notes-file CHANGELOG.mdgh release create v2.0.0-rc.1 --prerelease dist/*.tar.gzgh release create v1.1.0 --draft --generate-notesgh release upload v1.1.0 dist/app.zip --clobbergh release download v1.1.0 --pattern '*.tar.gz' --dir /tmp/releasesgh release download v1.1.0 --archive tar.gzgh release view v1.1.0 --json tagName,assets,publishedAtgh release view v1.1.0 --webgh release list --limit 20gh release list --exclude-drafts --exclude-pre-releases --limit 10gh release edit v1.1.0 --latest --title 'v1.1.0 stable'gh release delete v1.1.0 --cleanup-tag --yesgh api user/packages?package_type=container --jq '.[].name'gh api user/packages/container/myapp/versions --jq '.[].id'gh repo create myorg/webapp --private --add-readme --clonegh repo create webapp --template owner/express-starter --publicgh repo list myorg --archived --limit 50gh repo list --topic hacktoberfest --limit 30gh repo view owner/repo --json name,description,stargazerCountgh repo edit owner/repo --description 'CLI tool' --homepage https://example.comgh repo edit --delete-branch-on-merge=truegh repo sync owner/repo --source upstream/repogh repo fork owner/repo --fork-name myapp-copygh repo fork owner/repo --default-branch-onlygh repo set-defaultgh repo clone owner/repo -- --depth 1gh repo rename -R owner/repo myapp-v2 --yesgh gist create - -wgh gist create script.py --public --desc 'Deploy helper'gh gist edit 1234 --add notes.mdgh gist edit 1234 --remove old.txtgh gist list --publicgh gist list --secret --limit 50gh gist view 1234 --files script.pygh codespace create --repo owner/repo --branch maingh codespace create --repo owner/repo --branch main --machine standardLinux32gbgh codespace ssh -c cs-namegh codespace ports -c cs-namegh codespace ports visibility 3000:public -c cs-namegh codespace delete -c cs-namegh codespace stop -c cs-namegh codespace logs -c cs-name --followgh codespace rebuild -c cs-name --fullgh codespace view -c cs-name --json state,idleTimeoutMinutesgh codespace list --json name,repository,stategh extension install github/gh-copilot --forcegh extension upgrade gh-copilot --forcegh extension remove gh-copilotgh extension create my-extensiongh api user --jq '.login'gh api repos/owner/repo/issues?per_page=100 --jq '.[].number'gh api -X PATCH repos/owner/repo/issues/5 -f state=closedgh api graphql -f query='query($owner:String!,$repo:String!){ repository(owner:$owner,name:$repo){ stargazerCount } }' -f owner=cli -f repo=cligh api repos/owner/repo/releases/latest --jq .tag_namegh api repos/owner/repo/actions/runs/123gh api repos/owner/repo/actions/workflows --paginategh api -X POST repos/owner/repo/actions/workflows/build.yml/dispatches -f ref=maingh api -X DELETE repos/owner/repo/actions/caches --silentgh api rate_limit --jq '.rate | "\(.remaining)/\(.limit)"'gh api -X POST repos/owner/repo/issues/5/comments -f body='Fixed in #10'gh api -X PUT user/starred/owner/repo --silentgh api repos/owner/repo/contents/README.md -H 'Accept: application/vnd.github.raw'gh auth token --hostname github.comgh auth refresh -s repo,workflowgh auth login --hostname github.com --git-protocol ssh --webgh auth status --show-tokengh auth logout --hostname github.comgh config set git_protocol sshgh config get git_protocolgh config set git_protocol https -h github.comgh config list -h github.comgh config set pager 'less -FRX'gh alias set prd 'pr view'gh alias set --shell prd 'gh pr view "$1"'gh alias set merged 'pr list --state merged --limit 20'gh alias export > aliases.ymlgh completion -s bash > ~/.bash_completiongh completion -s zsh > /usr/local/share/zsh/site-functions/_ghgh completion -s fish > ~/.config/fish/completions/gh.fishgh copilot suggest -t gh 'create a release from the latest tag'gh copilot explain 'git log --oneline --graph --all'
Search all 7,657 commands instead.