GitHub Repository
Clone a repository locally
$gh repo clone <repo>Clone a specific owner's repository locally
$gh repo clone <owner/repo>Clone a repository into a specified directory
$gh repo clone <owner/repo> <directory>Perform a shallow clone of a repository
$gh repo clone <owner/repo> -- --depth 1Create a new repository interactively
$gh repo createCreate a new repository with the specified name
$gh repo create <name>Create a new public repository
$gh repo create --publicCreate a new private repository
$gh repo create --privateCreate a new internal repository
$gh repo create --internalCreate a repository from the current local directory
$gh repo create --source .Create a repository and push local commits to it
$gh repo create --pushCreate a repository and set a custom remote name
$gh repo create --remote <name>Create a repository with a specific description
$gh repo create --description "<description>"Create a repository with a specified homepage URL
$gh repo create --homepage <url>Create a repository and grant access to a specific team
$gh repo create --team <name>Create a repository with issues disabled
$gh repo create --disable-issuesCreate a repository with the wiki disabled
$gh repo create --disable-wikiCreate a repository and push all local branches
$gh repo create --include-all-branchesCreate a new repository using an existing template
$gh repo create --template <repo>Create a repository and immediately clone it locally
$gh repo create --cloneCreate a repository with a specific gitignore template
$gh repo create --gitignore <template>Create a repository with a specific open source license
$gh repo create --license <license>Publish the current directory as a new public repository
$gh repo create <name> --public --source . --pushCreate a private repository with a name and description
$gh repo create <name> --private --description "<description>"Create a public repository and clone it locally
$gh repo create <name> --public --cloneView details of the current repository
$gh repo viewView details of a specific repository
$gh repo view <owner/repo>Open the current repository in the web browser
$gh repo view --webOpen a specific repository in the web browser
$gh repo view <owner/repo> --webOutput specific repository details in JSON format
$gh repo view --json <fields>Output repository name, description, and URL in JSON
$gh repo view --json name,description,urlList repositories owned by the authenticated user
$gh repo listList repositories owned by a specific user or org
$gh repo list <owner>List only public repositories
$gh repo list --publicList only private repositories
$gh repo list --privateList only forked repositories
$gh repo list --forkList only non-forked (source) repositories
$gh repo list --sourceList only archived repositories
$gh repo list --archivedExclude archived repositories from the list
$gh repo list --no-archivedList repositories filtered by primary language
$gh repo list --language <language>List repositories filtered by a specific topic
$gh repo list --topic <topic>Limit the number of repositories listed
$gh repo list --limit <number>Output repository list in JSON format with specific fields
$gh repo list --json <fields>Fork the current repository
$gh repo forkFork a specific repository
$gh repo fork <repo>Fork a repository and clone it locally
$gh repo fork --cloneFork and add a remote for the fork
$gh repo fork --remoteFork and set a custom remote name for the fork
$gh repo fork --remote-name <name>Fork a repository into a specific organization
$gh repo fork --org <org>Fork a repository and give the fork a new name
$gh repo fork --fork-name <name>Fork, clone locally, and set up remotes automatically
$gh repo fork <repo> --clone --remoteDelete the current repository interactively
$gh repo deleteDelete a specific repository interactively
$gh repo delete <owner/repo>Delete a repository bypassing the confirmation prompt
$gh repo delete <owner/repo> --yesRename the current repository interactively
$gh repo renameRename the current repository to a new name
$gh repo rename <new-name>Rename a specific repository to a new name
$gh repo rename <new-name> --repo <owner/repo>Rename the repository bypassing the confirmation prompt
$gh repo rename <new-name> --yesEdit repository settings interactively
$gh repo editUpdate the repository's description
$gh repo edit --description "<description>"Update the repository's homepage URL
$gh repo edit --homepage <url>Change the repository visibility to public
$gh repo edit --visibility publicChange the repository visibility to private
$gh repo edit --visibility privateChange the repository visibility to internal
$gh repo edit --visibility internalEnable issues for the repository
$gh repo edit --enable-issuesDisable issues for the repository
$gh repo edit --disable-issuesEnable the wiki for the repository
$gh repo edit --enable-wikiDisable the wiki for the repository
$gh repo edit --disable-wikiEnable discussions for the repository
$gh repo edit --enable-discussionsDisable discussions for the repository
$gh repo edit --disable-discussionsEnable projects for the repository
$gh repo edit --enable-projectsDisable projects for the repository
$gh repo edit --disable-projectsAdd a topic to the repository
$gh repo edit --add-topic <topic>Remove a topic from the repository
$gh repo edit --remove-topic <topic>Set the default branch for the repository
$gh repo edit --default-branch <branch>Allow squash merging for pull requests
$gh repo edit --allow-squash-mergeAllow merge commits for pull requests
$gh repo edit --allow-merge-commitAllow rebase merging for pull requests
$gh repo edit --allow-rebase-mergeAutomatically delete head branches after PR merge
$gh repo edit --delete-branch-on-mergeMark the repository as a template repository
$gh repo edit --templateEnable auto-merge functionality for PRs
$gh repo edit --enable-auto-mergeArchive the current repository interactively
$gh repo archiveArchive a specific repository interactively
$gh repo archive <owner/repo>Archive a repository bypassing the confirmation prompt
$gh repo archive <owner/repo> --yesUnarchive the current repository interactively
$gh repo unarchiveUnarchive a specific repository interactively
$gh repo unarchive <owner/repo>Unarchive a repository bypassing the confirmation prompt
$gh repo unarchive <owner/repo> --yesSync the local repository with its remote parent
$gh repo syncSync a specific repository with its parent
$gh repo sync <owner/repo>Sync a specific branch of the repository
$gh repo sync --branch <branch>Forcefully sync the repository, overwriting local changes
$gh repo sync --forceSync the repository from a specific source repository
$gh repo sync --source <repo>List deploy keys for the repository
$gh repo deploy-key listAdd a new deploy key from a file
$gh repo deploy-key add <key-file>Add a new deploy key with a specific title
$gh repo deploy-key add <key-file> --title "<title>"Add a deploy key with write access enabled
$gh repo deploy-key add <key-file> --allow-writeDelete a deploy key by its ID
$gh repo deploy-key delete <key-id>GitHub Pull Request
List open pull requests for the current repository
$gh pr listList only open pull requests
$gh pr list --state openList only closed (unmerged) pull requests
$gh pr list --state closedList only merged pull requests
$gh pr list --state mergedList all pull requests regardless of state
$gh pr list --state allList pull requests created by a specific user
$gh pr list --author <username>List pull requests assigned to a specific user
$gh pr list --assignee <username>List pull requests with a specific label
$gh pr list --label <label>List pull requests targeting a specific base branch
$gh pr list --base <branch>List pull requests originating from a specific head branch
$gh pr list --head <branch>Limit the number of pull requests displayed
$gh pr list --limit <number>List pull requests matching a search query
$gh pr list --search <query>Open the list of pull requests in the web browser
$gh pr list --webOutput pull request details in JSON format
$gh pr list --json <fields>Format the PR list output using a Go template
$gh pr list --template <template>List only draft pull requests
$gh pr list --draftList pull requests for a specific repository
$gh pr list --repo <owner/repo>View details of the pull request for the current branch
$gh pr viewView details of a specific pull request by number
$gh pr view <number>View details of a pull request associated with a branch
$gh pr view <branch>Open the current branch's PR in the web browser
$gh pr view --webOpen a specific PR in the web browser
$gh pr view --web <number>Output specific details of a PR in JSON format
$gh pr view --json <fields>Parse PR JSON output using a jq expression
$gh pr view --json <fields> --jq <expression>View the current branch's PR along with its comments
$gh pr view --commentsView a specific PR and its comments
$gh pr view <number> --commentsCreate a new pull request interactively
$gh pr createCreate a pull request with a specific title
$gh pr create --title "<title>"Create a pull request with a specific description body
$gh pr create --body "<body>"Create a pull request targeting a specific base branch
$gh pr create --base <branch>Create a pull request from a specific head branch
$gh pr create --head <branch>Create a pull request as a draft
$gh pr create --draftContinue creating the pull request in the web browser
$gh pr create --webAutomatically fill PR title and body from commit info
$gh pr create --fillFill PR title/body using detailed commit messages
$gh pr create --fill-verboseCreate a PR and request a review from a specific user
$gh pr create --reviewer <username>Create a PR and assign it to a specific user
$gh pr create --assignee <username>Create a PR and attach a specific label
$gh pr create --label <label>Create a PR and assign it to a milestone
$gh pr create --milestone <milestone>Create a PR and add it to a project board
$gh pr create --project <project>Create a PR in a different repository
$gh pr create --repo <owner/repo>Create a PR from a specific branch targeting main
$gh pr create --base main --head <branch>Create a titled PR from a specific branch to main
$gh pr create --base main --head <branch> --title "<title>"Create a fully populated PR from a specific branch to main
$gh pr create --base main --head <branch> --title "<title>" --body "<body>"Create a fully populated draft PR to main
$gh pr create --base main --head <branch> --title "<title>" --body "<body>" --draftCreate a PR with details and request a reviewer
$gh pr create --base main --head <branch> --title "<title>" --body "<body>" --reviewer <username>Create a PR with details and assign a label
$gh pr create --base main --head <branch> --title "<title>" --body "<body>" --label <label>Create a PR with details and assign a user
$gh pr create --base main --head <branch> --title "<title>" --body "<body>" --assignee <username>Create a PR with all details, reviewers, and assignees
$gh pr create --base main --head <branch> --title "<title>" --body "<body>" --reviewer <username> --assignee <username>Create a PR reading the body text from a file
$gh pr create --title "<title>" --body-file <file>Quickly create a draft PR using commit info
$gh pr create --fill --draftMerge the pull request for the current branch interactively
$gh pr mergeMerge a specific pull request interactively
$gh pr merge <number>Merge the PR using a standard merge commit
$gh pr merge --mergeMerge the PR by squashing commits
$gh pr merge --squashMerge the PR by rebasing commits
$gh pr merge --rebaseMerge the PR and delete the local and remote branch
$gh pr merge --delete-branchEnable auto-merge to trigger when requirements are met
$gh pr merge --autoDisable previously set auto-merge for the PR
$gh pr merge --disable-autoSquash merge a specific PR and delete its branch
$gh pr merge <number> --squash --delete-branchCreate a merge commit for a PR and delete its branch
$gh pr merge <number> --merge --delete-branchRebase merge a specific PR and delete its branch
$gh pr merge <number> --rebase --delete-branchSquash merge with a custom commit title and body
$gh pr merge --squash --subject "<title>" --body "<body>"Merge a PR using administrator privileges to bypass rules
$gh pr merge --adminClose the pull request for the current branch
$gh pr closeClose a specific pull request without merging
$gh pr close <number>Close a PR and leave a closing comment
$gh pr close <number> --comment "<comment>"Close a PR and delete its associated branch
$gh pr close <number> --delete-branchClose a PR, leave a comment, and delete the branch
$gh pr close <number> --comment "<comment>" --delete-branchReopen a previously closed pull request for the current branch
$gh pr reopenReopen a specific closed pull request
$gh pr reopen <number>Reopen a pull request and add a comment
$gh pr reopen <number> --comment "<comment>"Checkout the pull request for the current branch
$gh pr checkoutCheckout a specific pull request branch locally
$gh pr checkout <number>Checkout a PR into a specific new local branch name
$gh pr checkout <number> --branch <name>Force checkout a PR, overwriting local changes
$gh pr checkout <number> --forceCheckout a PR in a detached HEAD state
$gh pr checkout <number> --detachCheckout a PR and update its submodules
$gh pr checkout <number> --recurse-submodulesView the diff of the PR for the current branch
$gh pr diffView the code diff for a specific pull request
$gh pr diff <number>Output the PR diff in patch format
$gh pr diff --patchList only the names of files changed in the PR
$gh pr diff --name-onlyForce colored output for the PR diff
$gh pr diff --color alwaysDisable colored output for the PR diff
$gh pr diff --color neverGet the diff of a specific PR in patch format
$gh pr diff <number> --patchEdit details of the current branch's PR interactively
$gh pr editEdit a specific pull request interactively
$gh pr edit <number>Change the title of the pull request
$gh pr edit --title "<title>"Update the description body of the pull request
$gh pr edit --body "<body>"Change the base branch the pull request is targeting
$gh pr edit --base <branch>Request a review from a specific user on the PR
$gh pr edit --add-reviewer <username>Remove a review request for a specific user
$gh pr edit --remove-reviewer <username>Assign the pull request to a specific user
$gh pr edit --add-assignee <username>Unassign a specific user from the pull request
$gh pr edit --remove-assignee <username>Add a label to the pull request
$gh pr edit --add-label <label>Remove a label from the pull request
$gh pr edit --remove-label <label>Add the pull request to a specific project
$gh pr edit --add-project <project>Remove the pull request from a project
$gh pr edit --remove-project <project>Set the milestone for the pull request
$gh pr edit --milestone <milestone>Mark a draft pull request as ready for review
$gh pr edit --readyConvert a standard pull request back to a draft
$gh pr edit --draftEdit the title and body of a specific PR
$gh pr edit <number> --title "<title>" --body "<body>"Add a label and reviewer to a specific PR
$gh pr edit <number> --add-label <label> --add-reviewer <username>Add a review to the pull request for the current branch
$gh pr reviewAdd a review to a specific pull request
$gh pr review <number>Approve the pull request
$gh pr review --approveRequest changes on the pull request
$gh pr review --request-changesSubmit a general comment review on the pull request
$gh pr review --commentSubmit a review with specific body text
$gh pr review --body "<body>"Approve a specific pull request
$gh pr review <number> --approveRequest changes on a specific PR with an explanation
$gh pr review <number> --request-changes --body "<body>"Leave a review comment on a specific PR
$gh pr review <number> --comment --body "<body>"Approve a specific PR and leave a comment
$gh pr review <number> --approve --body "<body>"Show CI status for the current branch's PR
$gh pr checksShow CI status for a specific PR
$gh pr checks <number>Watch PR checks and wait until they complete
$gh pr checks --watchExit the watch process immediately if any check fails
$gh pr checks --fail-fastShow status only for required checks
$gh pr checks --requiredSet the refresh interval when watching checks
$gh pr checks --interval <seconds>Watch the CI checks for a specific PR
$gh pr checks <number> --watchWatch checks for a PR and exit quickly on failure
$gh pr checks <number> --watch --fail-fastAdd a comment to the current branch's PR
$gh pr commentAdd a comment to a specific PR interactively
$gh pr comment <number>Add a specific comment to the current PR
$gh pr comment --body "<comment>"Add a specific comment text to a specific PR
$gh pr comment <number> --body "<comment>"Add a comment to a PR using the contents of a file
$gh pr comment <number> --body-file <file>Edit your last comment on a specific PR
$gh pr comment <number> --edit-lastDelete your last comment on a specific PR
$gh pr comment <number> --delete-lastOpen a specific PR in the browser to leave a comment
$gh pr comment <number> --webMark the current draft PR as ready for review
$gh pr readyMark a specific draft PR as ready for review
$gh pr ready <number>Convert a specific PR back to draft status
$gh pr ready <number> --undoLock conversation on the current branch's PR
$gh pr lockLock conversation on a specific PR
$gh pr lock <number>Lock a PR conversation as off-topic
$gh pr lock <number> --reason off-topicLock a PR conversation because it is resolved
$gh pr lock <number> --reason resolvedLock a PR conversation due to spam
$gh pr lock <number> --reason spamLock a PR conversation because it is too heated
$gh pr lock <number> --reason too heatedUnlock conversation on the current branch's PR
$gh pr unlockUnlock conversation on a specific PR
$gh pr unlock <number>List all projects for the current repository or organization
$gh project listList projects for a specific user or organization
$gh project list --owner <owner>List projects and output the result in JSON format
$gh project list --format jsonView details of a specific project by number
$gh project view <number>View a project owned by a specific user or organization
$gh project view <number> --owner <owner>View details of a specific project in JSON format
$gh project view <number> --format jsonCreate a new project for a specific owner with a title
$gh project create --owner <owner> --title "<title>"Rename or edit the title of an existing project
$gh project edit <number> --owner <owner> --title "<title>"Delete a specific project permanently
$gh project delete <number> --owner <owner>Duplicate a project to a new owner with a new title
$gh project copy <number> --source-owner <owner> --target-owner <owner> --title "<title>"Close a specific project without deleting it
$gh project close <number> --owner <owner>Link a project to a specific repository
$gh project link <number> --owner <owner> --repo <owner/repo>Remove a repository link from a project
$gh project unlink <number> --owner <owner> --repo <owner/repo>List all items (issues/PRs) within a project
$gh project item-list <number>List items in a specific owner's project
$gh project item-list <number> --owner <owner>Add an issue or PR to a project using its URL
$gh project item-add <number> --owner <owner> --url <issue-or-pr-url>Delete a specific item from a project
$gh project item-delete <number> --owner <owner> --id <item-id>Edit a specific field value for an item in a project
$gh project item-edit --id <item-id> --field-id <field-id> --project-id <project-id> --text "<value>"Archive an item within a project
$gh project item-archive <number> --owner <owner> --id <item-id>List all custom fields defined in a project
$gh project field-list <number>List fields for a specific owner's project
$gh project field-list <number> --owner <owner>Create a new text field in a project
$gh project field-create <number> --owner <owner> --name "<name>" --data-type TEXTDelete a custom field from a project
$gh project field-delete <number> --owner <owner> --id <field-id>List all columns (for classic projects)
$gh project column-list <number>GitHub Issue
List open issues for the current repository
$gh issue listList only open issues
$gh issue list --state openList only closed issues
$gh issue list --state closedList all issues regardless of open/closed state
$gh issue list --state allList issues created by a specific user
$gh issue list --author <username>List issues assigned to a specific user
$gh issue list --assignee <username>List issues that have a specific label attached
$gh issue list --label <label>List issues assigned to a specific milestone
$gh issue list --milestone <milestone>Limit the maximum number of issues displayed
$gh issue list --limit <number>Search for issues matching a specific text query
$gh issue list --search <query>Open the issue list in the web browser
$gh issue list --webOutput issue details in JSON format
$gh issue list --json <fields>Format the issue list using a custom Go template
$gh issue list --template <template>List issues where a specific user is mentioned
$gh issue list --mention <username>List issues for a specific repository
$gh issue list --repo <owner/repo>View details of an issue interactively
$gh issue viewView details of a specific issue by number
$gh issue view <number>Open the current issue in the web browser
$gh issue view --webOpen a specific issue in the web browser
$gh issue view <number> --webOutput specific details of an issue in JSON format
$gh issue view --json <fields>View an issue along with its comments
$gh issue view --commentsView a specific issue and all of its comments
$gh issue view <number> --commentsCreate a new issue interactively
$gh issue createCreate a new issue with a specific title
$gh issue create --title "<title>"Create a new issue with a specific description body
$gh issue create --body "<body>"Create a new issue and assign it to a user
$gh issue create --assignee <username>Create a new issue and add a label to it
$gh issue create --label <label>Create a new issue and assign it to a milestone
$gh issue create --milestone <milestone>Create a new issue and add it to a project
$gh issue create --project <project>Continue creating an issue in the web browser
$gh issue create --webCreate an issue in a different repository
$gh issue create --repo <owner/repo>Create an issue instantly with a title and body
$gh issue create --title "<title>" --body "<body>"Create an issue with a title, body, and label
$gh issue create --title "<title>" --body "<body>" --label <label>Create an issue with a title, body, and assignee
$gh issue create --title "<title>" --body "<body>" --assignee <username>Create a fully populated issue with labels and assignee
$gh issue create --title "<title>" --body "<body>" --label <label> --assignee <username>Create an issue reading the body content from a file
$gh issue create --title "<title>" --body-file <file>Close an issue interactively
$gh issue closeClose a specific issue by number
$gh issue close <number>Close an issue and leave a closing comment
$gh issue close <number> --comment "<comment>"Close an issue marking it as successfully completed
$gh issue close <number> --reason completedClose an issue marking it as not planned/won't fix
$gh issue close <number> --reason not-plannedReopen a closed issue interactively
$gh issue reopenReopen a specific closed issue
$gh issue reopen <number>Reopen an issue and add a comment
$gh issue reopen <number> --comment "<comment>"Edit an issue interactively
$gh issue editEdit a specific issue interactively
$gh issue edit <number>Change the title of an issue
$gh issue edit --title "<title>"Change the description body of an issue
$gh issue edit --body "<body>"Assign a user to an existing issue
$gh issue edit --add-assignee <username>Unassign a user from an existing issue
$gh issue edit --remove-assignee <username>Add a new label to an existing issue
$gh issue edit --add-label <label>Remove a label from an existing issue
$gh issue edit --remove-label <label>Add an existing issue to a project
$gh issue edit --add-project <project>Remove an issue from a project
$gh issue edit --remove-project <project>Set or change the milestone for an issue
$gh issue edit --milestone <milestone>Update both the title and body of a specific issue
$gh issue edit <number> --title "<title>" --body "<body>"Add a comment to an issue interactively
$gh issue commentAdd a comment to a specific issue interactively
$gh issue comment <number>Submit a comment using the provided text body
$gh issue comment --body "<comment>"Add a specific text comment to a specific issue
$gh issue comment <number> --body "<comment>"Comment on an issue using the contents of a file
$gh issue comment <number> --body-file <file>Edit your most recent comment on an issue
$gh issue comment <number> --edit-lastDelete your most recent comment on an issue
$gh issue comment <number> --delete-lastOpen an issue in the browser to leave a comment
$gh issue comment <number> --webDelete an issue permanently interactively
$gh issue deleteDelete a specific issue permanently
$gh issue delete <number>Delete an issue bypassing the confirmation prompt
$gh issue delete <number> --yesCreate a branch for an issue interactively
$gh issue developCreate a linked branch for a specific issue
$gh issue develop <number>Create a branch for an issue with a specific name
$gh issue develop <number> --name <branch>Create a branch for an issue originating from a specific base
$gh issue develop <number> --base <branch>Create a branch for an issue and check it out locally
$gh issue develop <number> --checkoutCreate a named branch for an issue and check it out
$gh issue develop <number> --name <branch> --checkoutLock conversation on an issue interactively
$gh issue lockLock conversation on a specific issue
$gh issue lock <number>Lock an issue conversation marking it off-topic
$gh issue lock <number> --reason off-topicLock an issue conversation marking it resolved
$gh issue lock <number> --reason resolvedLock an issue conversation marking it as spam
$gh issue lock <number> --reason spamUnlock conversation on an issue interactively
$gh issue unlockUnlock conversation on a specific issue
$gh issue unlock <number>Pin an issue to the repository's issue list
$gh issue pinPin a specific issue by number
$gh issue pin <number>Unpin an issue from the repository's issue list
$gh issue unpinUnpin a specific issue by number
$gh issue unpin <number>Transfer an issue to another repository interactively
$gh issue transferTransfer a specific issue to a destination repository
$gh issue transfer <number> <destination-repo>GitHub Workflow & Run
List GitHub Actions workflows in the current repository
$gh workflow listList all workflows, including disabled ones
$gh workflow list --allList workflows for a specific repository
$gh workflow list --repo <owner/repo>Output workflow details in JSON format
$gh workflow list --json <fields>View details of a workflow interactively
$gh workflow viewView details of a specific workflow
$gh workflow view <workflow>Open a workflow in the web browser
$gh workflow view --webOpen a specific workflow in the web browser
$gh workflow view <workflow> --webView the YAML configuration of a workflow
$gh workflow view --yamlView the YAML file of a specific workflow
$gh workflow view <workflow> --yamlView a workflow file as it exists on a specific branch
$gh workflow view --ref <branch>Enable a disabled workflow interactively
$gh workflow enableEnable a specific disabled workflow
$gh workflow enable <workflow>Disable an active workflow interactively
$gh workflow disableDisable a specific active workflow
$gh workflow disable <workflow>Run a workflow manually interactively
$gh workflow runTrigger a specific workflow manually
$gh workflow run <workflow>Trigger a workflow to run on a specific branch
$gh workflow run <workflow> --ref <branch>Run a workflow passing a specific input parameter
$gh workflow run <workflow> --field <key>=<value>Run a workflow passing raw string input parameters
$gh workflow run <workflow> --raw-field <key>=<value>Run a workflow and accept inputs from a JSON string
$gh workflow run <workflow> --jsonRun a workflow on a branch with specific inputs
$gh workflow run <workflow> --ref <branch> --field <key>=<value>List recent workflow runs for the repository
$gh run listList runs for a specific workflow
$gh run list --workflow <workflow>List workflow runs executed on a specific branch
$gh run list --branch <branch>List workflow runs triggered by a specific user
$gh run list --user <username>List workflow runs matching a specific status (e.g., failed)
$gh run list --status <status>List workflow runs triggered by a specific event (e.g., push)
$gh run list --event <event>List workflow runs associated with a specific commit
$gh run list --commit <sha>Limit the number of workflow runs returned
$gh run list --limit <number>Output workflow runs data in JSON format
$gh run list --json <fields>List workflow runs created on or after a specific date
$gh run list --created <date>View details of a workflow run interactively
$gh run viewView details of a specific workflow run
$gh run view <run-id>Open a workflow run in the web browser
$gh run view --webOpen a specific workflow run in the web browser
$gh run view <run-id> --webView the complete log output of a workflow run
$gh run view --logView the logs for a specific workflow run
$gh run view <run-id> --logView only the failed log steps of a workflow run
$gh run view --log-failedView failed logs for a specific workflow run
$gh run view <run-id> --log-failedExit with a non-zero status if the run failed
$gh run view --exit-statusCheck the exit status of a specific workflow run programmatically
$gh run view <run-id> --exit-statusView details for a specific job within a run
$gh run view --job <job-id>View detailed information about a run's steps
$gh run view --verboseView verbose details for a specific workflow run
$gh run view <run-id> --verboseWatch a workflow run's progress interactively
$gh run watchWatch the progress of a specific workflow run
$gh run watch <run-id>Watch a run and exit with its final status code
$gh run watch --exit-statusSet the polling interval while watching a run
$gh run watch --interval <seconds>Watch a specific run and return its exit code upon completion
$gh run watch <run-id> --exit-statusRe-run a workflow run interactively
$gh run rerunRe-run a specific workflow run completely
$gh run rerun <run-id>Re-run only the failed jobs in a workflow run
$gh run rerun --failed-onlyRe-run failed jobs for a specific workflow run
$gh run rerun <run-id> --failed-onlyRe-run a specific job within a workflow run
$gh run rerun --job <job-id>Re-run a workflow run with runner debug logging enabled
$gh run rerun --debugRe-run a specific run with debug logging
$gh run rerun <run-id> --debugCancel a workflow run interactively
$gh run cancelCancel a specific in-progress workflow run
$gh run cancel <run-id>Delete a workflow run interactively
$gh run deleteDelete a specific workflow run permanently
$gh run delete <run-id>Delete a workflow run bypassing the confirmation prompt
$gh run delete <run-id> --yesDownload artifacts from a workflow run interactively
$gh run downloadDownload all artifacts generated by a specific run
$gh run download <run-id>Download a specific named artifact from a run
$gh run download <run-id> --name <artifact-name>Download a run's artifacts into a specific directory
$gh run download <run-id> --dir <directory>Download artifacts matching a glob pattern from a run
$gh run download <run-id> --pattern <glob>GitHub Auth & Config
Log in to a GitHub account interactively
$gh auth loginLog in to GitHub via the web browser
$gh auth login --webLog in using a personal access token provided via standard input
$gh auth login --with-tokenLog in to a specific GitHub Enterprise Server instance
$gh auth login --hostname <hostname>Log in and request specific additional OAuth scopes
$gh auth login --scopes <scopes>Log in and set the preferred Git protocol (ssh or https)
$gh auth login --git-protocol <protocol>Log out of your GitHub account
$gh auth logoutLog out from a specific GitHub Enterprise Server
$gh auth logout --hostname <hostname>Check your current authentication status
$gh auth statusCheck auth status for a specific enterprise host
$gh auth status --hostname <hostname>Display the active authentication token in the status output
$gh auth status --show-tokenPrint the current authentication token to standard output
$gh auth tokenPrint the token for a specific enterprise host
$gh auth token --hostname <hostname>Refresh the current authentication session
$gh auth refreshRefresh auth session to request additional scopes
$gh auth refresh --scopes <scopes>Refresh auth session for a specific enterprise host
$gh auth refresh --hostname <hostname>Configure Git to use GitHub CLI as a credential helper
$gh auth setup-gitConfigure Git credential helper for a specific host
$gh auth setup-git --hostname <hostname>List all configured settings for the GitHub CLI
$gh config listRetrieve the value of a specific configuration key
$gh config get <key>Set a specific configuration key to a given value
$gh config set <key> <value>Set a configuration key for a specific host
$gh config set --host <hostname> <key> <value>Set the default text editor for the GitHub CLI
$gh config set editor <editor>Set the default web browser for the GitHub CLI
$gh config set browser <browser>Set HTTPS as the default Git protocol
$gh config set git_protocol httpsSet SSH as the default Git protocol
$gh config set git_protocol sshEnable interactive prompts for the CLI
$gh config set prompt enabledDisable interactive prompts for scripting
$gh config set prompt disabledSet a custom terminal pager for long outputs
$gh config set pager <pager>GitHub Gist & Release
List releases for the current repository
$gh release listLimit the number of releases shown
$gh release list --limit <number>List releases but hide drafts
$gh release list --exclude-draftsList releases but hide pre-releases
$gh release list --exclude-pre-releasesOutput release list in JSON format
$gh release list --json <fields>View details of the latest release
$gh release viewView details of a release by its tag name
$gh release view <tag>Open the latest release in the web browser
$gh release view --webOpen a specific release in the web browser
$gh release view <tag> --webOutput release details in JSON format
$gh release view --json <fields>Create a new release interactively
$gh release createCreate a release for a specific tag
$gh release create <tag>Create a release and upload assets to it
$gh release create <tag> <files>Create a release with a custom title
$gh release create <tag> --title "<title>"Create a release with specific release notes
$gh release create <tag> --notes "<notes>"Create a release using release notes from a file
$gh release create <tag> --notes-file <file>Create a release but save it as a draft
$gh release create <tag> --draftCreate a release and mark it as a pre-release
$gh release create <tag> --prereleaseCreate a release and explicitly mark it as the latest
$gh release create <tag> --latestCreate a release targeting a specific branch or commit
$gh release create <tag> --target <branch-or-commit>Create a release and auto-generate notes based on PRs
$gh release create <tag> --generate-notesGenerate notes starting from a previous specific tag
$gh release create <tag> --notes-start-tag <tag>Create a release and start a discussion in a specific category
$gh release create <tag> --discussion-category <category>Create a complete release with assets, title, and notes
$gh release create <tag> <files> --title "<title>" --notes "<notes>"Create a release with assets and auto-generated notes
$gh release create <tag> <files> --title "<title>" --generate-notesCreate a draft pre-release
$gh release create <tag> --draft --prereleaseEdit the latest release interactively
$gh release editEdit a specific release by tag interactively
$gh release edit <tag>Update the title of an existing release
$gh release edit <tag> --title "<title>"Update the release notes of an existing release
$gh release edit <tag> --notes "<notes>"Convert a published release to a draft
$gh release edit <tag> --draftConvert a published release to a pre-release
$gh release edit <tag> --prereleaseSet an existing release as the latest release
$gh release edit <tag> --latestPublish a release that is currently a draft
$gh release edit <tag> --draft=falseChange the tag associated with an existing release
$gh release edit <tag> --tag <new-tag>Change the target commitish for an existing release
$gh release edit <tag> --target <branch-or-commit>Delete a release interactively
$gh release deleteDelete a specific release by its tag
$gh release delete <tag>Delete a release bypassing the confirmation prompt
$gh release delete <tag> --yesDelete a release and its associated git tag
$gh release delete <tag> --cleanup-tagForce delete a release and its git tag simultaneously
$gh release delete <tag> --yes --cleanup-tagDownload assets from the latest release
$gh release downloadDownload assets from the latest release
$gh release downloadDownload assets from a specific tagged release
$gh release download <tag>Download latest release assets matching a glob pattern
$gh release download --pattern <glob>Download specific release assets matching a pattern
$gh release download <tag> --pattern <glob>Download release assets into a specific directory
$gh release download <tag> --dir <directory>Download the release source code as a ZIP archive
$gh release download <tag> --archive zipDownload the release source code as a tarball
$gh release download <tag> --archive tar.gzDownload matching assets from a release to a specific folder
$gh release download <tag> --pattern <glob> --dir <directory>Download assets and overwrite existing files locally
$gh release download --clobber <tag>Upload assets to a release interactively
$gh release uploadUpload one or more files to a specific release
$gh release upload <tag> <files>Upload files to a release, overwriting existing assets of the same name
$gh release upload <tag> <files> --clobberList your GitHub gists
$gh gist listLimit the number of gists displayed
$gh gist list --limit <number>List only your public gists
$gh gist list --publicList only your secret gists
$gh gist list --secretView the content of a specific gist
$gh gist view <gist-id>Open a specific gist in the web browser
$gh gist view <gist-id> --webOutput the raw content of a gist without formatting
$gh gist view <gist-id> --rawView a specific file from a multi-file gist
$gh gist view <gist-id> --filename <file>Create a new gist interactively
$gh gist createCreate a new gist from a local file
$gh gist create <file>Create a multi-file gist from local files
$gh gist create <file1> <file2>Create a public gist (default is secret)
$gh gist create --publicCreate a gist with a specific description
$gh gist create --desc "<description>"Create a described, public gist from a file
$gh gist create <file> --public --desc "<description>"Create a gist by reading content from standard input
$gh gist create -Edit an existing gist interactively
$gh gist edit <gist-id>Edit a specific file within an existing gist
$gh gist edit <gist-id> --filename <file>Add a new file to an existing gist
$gh gist edit <gist-id> --add <file>Remove a file from an existing gist
$gh gist edit <gist-id> --remove <file>Update the description of an existing gist
$gh gist edit <gist-id> --desc "<description>"Delete a gist permanently interactively
$gh gist delete <gist-id>Delete a gist bypassing the confirmation prompt
$gh gist delete <gist-id> --yesClone a gist locally as a git repository
$gh gist clone <gist-id>Clone a gist into a specified directory
$gh gist clone <gist-id> <directory>Rename a file within an existing gist
$gh gist rename <gist-id> <old-filename> <new-filename>GitHub Secret & Variable
List GitHub Actions secrets for the current repository
$gh secret listList secrets for a specific organization
$gh secret list --org <org>List secrets for a specific deployment environment
$gh secret list --env <environment>List your personal Codespaces secrets
$gh secret list --userOutput secrets list in JSON format
$gh secret list --json <fields>Create or update a secret interactively
$gh secret set <name>Set a secret with a specific string value
$gh secret set <name> --body "<value>"Set a secret reading the value from a file
$gh secret set <name> --env-file <file>Create an organization-level secret
$gh secret set <name> --org <org>Create an org secret visible to all repositories
$gh secret set <name> --org <org> --visibility allCreate an org secret visible only to private repositories
$gh secret set <name> --org <org> --visibility privateCreate an org secret visible to specific repositories
$gh secret set <name> --org <org> --visibility selectedCreate an org secret and assign it to specific repos
$gh secret set <name> --org <org> --repos <repo1,repo2>Create an environment-specific secret
$gh secret set <name> --env <environment>Create a personal Codespaces secret
$gh secret set <name> --userDelete a repository secret
$gh secret delete <name>Delete an organization secret
$gh secret delete <name> --org <org>Delete an environment secret
$gh secret delete <name> --env <environment>Delete a personal Codespaces secret
$gh secret delete <name> --userList GitHub Actions variables for the repository
$gh variable listList variables for an organization
$gh variable list --org <org>List variables for a specific environment
$gh variable list --env <environment>Output variables list in JSON format
$gh variable list --json <fields>Create or update a variable interactively
$gh variable set <name>Set a variable with a specific string value
$gh variable set <name> --body "<value>"Create an organization-level variable
$gh variable set <name> --org <org>Create an org variable visible to all repositories
$gh variable set <name> --org <org> --visibility allCreate an org variable visible to selected repositories
$gh variable set <name> --org <org> --visibility selectedCreate an org variable and specify access for repos
$gh variable set <name> --org <org> --repos <repo1,repo2>Create an environment-specific variable
$gh variable set <name> --env <environment>Delete a repository variable
$gh variable delete <name>Delete an organization variable
$gh variable delete <name> --org <org>Delete an environment variable
$gh variable delete <name> --env <environment>GitHub Label & Milestone
List all labels in the current repository
$gh label listOutput label data in JSON format
$gh label list --json <fields>Search for specific labels by name or description
$gh label list --search <query>Sort the label list in ascending order
$gh label list --order ascSort the label list in descending order
$gh label list --order descSort labels by their creation date
$gh label list --sort createdSort labels alphabetically by name
$gh label list --sort nameCreate a new label with a random color
$gh label create <name>Create a new label with a specific hex color
$gh label create <name> --color <hex>Create a new label with a description
$gh label create <name> --description "<description>"Update an existing label if it already exists
$gh label create <name> --forceCreate a fully specified label with color and description
$gh label create <name> --color <hex> --description "<description>"Edit an existing label interactively
$gh label edit <name>Rename an existing label
$gh label edit <name> --name <new-name>Change the hex color of an existing label
$gh label edit <name> --color <hex>Update the description of an existing label
$gh label edit <name> --description "<description>"Delete a label interactively
$gh label delete <name>Delete a label bypassing the confirmation prompt
$gh label delete <name> --yesCopy labels from a different repository into the current one
$gh label clone <source-repo>Copy labels, overwriting matching existing labels
$gh label clone <source-repo> --forceGitHub Search
Search for repositories across GitHub
$gh search repos <query>Limit the number of repository search results
$gh search repos <query> --limit <number>Search repositories written in a specific language
$gh search repos <query> --language <language>Search for repositories with more than 1000 stars
$gh search repos <query> --stars >1000Search repositories owned by a specific user or org
$gh search repos <query> --owner <owner>Search repositories tagged with a specific topic
$gh search repos <query> --topic <topic>Search only public repositories
$gh search repos <query> --visibility publicOutput repository search results in JSON format
$gh search repos <query> --json <fields>Sort repository search results by star count
$gh search repos <query> --sort starsDisplay repository search results in descending order
$gh search repos <query> --order descOpen the repository search query in the browser
$gh search repos <query> --webSearch for pull requests globally
$gh search prs <query>Limit the number of PR search results
$gh search prs <query> --limit <number>Search only for open pull requests
$gh search prs <query> --state openSearch only for closed pull requests
$gh search prs <query> --state closedSearch PRs created by a specific user
$gh search prs <query> --author <username>Search PRs within a specific repository
$gh search prs <query> --repo <owner/repo>Search PRs containing a specific label
$gh search prs <query> --label <label>Search only for merged pull requests
$gh search prs <query> --mergedSearch only for draft pull requests
$gh search prs <query> --draftSort PR search results by last updated time
$gh search prs <query> --sort updatedOutput PR search results in JSON format
$gh search prs <query> --json <fields>Search for issues globally
$gh search issues <query>Limit the number of issue search results
$gh search issues <query> --limit <number>Search only for open issues
$gh search issues <query> --state openSearch only for closed issues
$gh search issues <query> --state closedSearch issues created by a specific user
$gh search issues <query> --author <username>Search issues within a specific repository
$gh search issues <query> --repo <owner/repo>Search issues that have a specific label
$gh search issues <query> --label <label>Search issues assigned to a specific user
$gh search issues <query> --assignee <username>Sort issue search results by most recently updated
$gh search issues <query> --sort updatedOutput issue search results in JSON format
$gh search issues <query> --json <fields>Search for commits matching a query
$gh search commits <query>Search commits authored by a specific user
$gh search commits <query> --author <username>Search commits within a specific repository
$gh search commits <query> --repo <owner/repo>Search commits authored on a specific date
$gh search commits <query> --author-date <date>Search commits committed on a specific date
$gh search commits <query> --committer-date <date>Limit the number of commit search results
$gh search commits <query> --limit <number>Output commit search results in JSON format
$gh search commits <query> --json <fields>Search for code snippets globally
$gh search code <query>Search code within a specific repository
$gh search code <query> --repo <owner/repo>Search code written in a specific language
$gh search code <query> --language <language>Search code matching a specific filename
$gh search code <query> --filename <filename>Search code matching a specific file extension
$gh search code <query> --extension <ext>Search code within a specific user's or org's repositories
$gh search code <query> --owner <owner>Limit the number of code search results
$gh search code <query> --limit <number>Output code search results in JSON format
$gh search code <query> --json <fields>Open the code search results in the browser
$gh search code <query> --webGitHub API & Alias
Fetch milestones using the GitHub REST API
$gh api /repos/{owner}/{repo}/milestonesCreate a new milestone via a POST API request
$gh api /repos/{owner}/{repo}/milestones --method POST --field title="<title>"Make a custom GET request to a GitHub API endpoint
$gh api <endpoint>Make an explicit GET request to an API endpoint
$gh api <endpoint> --method GETMake a POST request to an API endpoint
$gh api <endpoint> --method POSTMake a PUT request to an API endpoint
$gh api <endpoint> --method PUTMake a PATCH request to an API endpoint
$gh api <endpoint> --method PATCHMake a DELETE request to an API endpoint
$gh api <endpoint> --method DELETESend a parameter payload with the API request
$gh api <endpoint> --field <key>=<value>Send a raw string parameter payload with the API request
$gh api <endpoint> --raw-field <key>=<value>Send a custom HTTP header with the API request
$gh api <endpoint> --header <key>:<value>Automatically fetch all pages for a paginated API endpoint
$gh api <endpoint> --paginateFilter the JSON response using a jq expression
$gh api <endpoint> --jq <expression>Format the API response using a Go template
$gh api <endpoint> --template <template>Send a request body read from a local file
$gh api <endpoint> --input <file>Make an API request to a specific GitHub Enterprise server
$gh api <endpoint> --hostname <hostname>Include HTTP response headers in the output
$gh api <endpoint> --includeSuppress the response body output
$gh api <endpoint> --silentCache the API response for a specified duration
$gh api <endpoint> --cache <duration>Make a GitHub GraphQL API query
$gh api graphql -f query='<query>'Fetch details of the currently authenticated user
$gh api /userFetch raw details of a specific repository via API
$gh api /repos/{owner}/{repo}Fetch raw issues data for a repository via API
$gh api /repos/{owner}/{repo}/issuesFetch raw pull requests data for a repository via API
$gh api /repos/{owner}/{repo}/pullsMake a POST request, send fields, and filter response with jq
$gh api <endpoint> --method POST --field <key>=<value> --jq <expression>List all configured custom aliases for the GitHub CLI
$gh alias listCreate a new alias that expands to a specific gh command
$gh alias set <name> <expansion>Create an alias that executes a shell command
$gh alias set <name> --shell <expansion>Delete a previously configured CLI alias
$gh alias delete <name>Import aliases from a YAML configuration file
$gh alias import <file>Import aliases from a file, overwriting existing ones
$gh alias import --clobber <file>GitHub Codespace
List your active GitHub Codespaces
$gh codespace listView details of an active Codespace interactively
$gh codespace viewView details of a specific Codespace
$gh codespace view --codespace <name>Create a new Codespace interactively
$gh codespace createCreate a Codespace for a specific repository
$gh codespace create --repo <owner/repo>Create a Codespace for a specific branch
$gh codespace create --branch <branch>Create a Codespace using a specific machine type (e.g., standardLinux)
$gh codespace create --machine <type>Create a Codespace using a specific devcontainer.json configuration
$gh codespace create --devcontainer-path <path>Create a Codespace for a specific branch of a specific repository
$gh codespace create --repo <owner/repo> --branch <branch>Delete a Codespace interactively
$gh codespace deleteDelete a specific Codespace by name
$gh codespace delete --codespace <name>Delete all of your active Codespaces
$gh codespace delete --allDelete Codespaces that have been inactive for N days
$gh codespace delete --days <n>Open an interactive SSH session into a Codespace
$gh codespace sshSSH into a specific named Codespace
$gh codespace ssh --codespace <name>Run a specific command over SSH within a Codespace
$gh codespace ssh -- <command>Stop a running Codespace interactively
$gh codespace stopStop a specific running Codespace
$gh codespace stop --codespace <name>Change the friendly display name of a Codespace
$gh codespace edit --codespace <name> --display-name "<name>"Change the machine type (hardware) of an existing Codespace
$gh codespace edit --codespace <name> --machine <type>List forwarded ports for an active Codespace
$gh codespace portsList ports for a specific active Codespace
$gh codespace ports --codespace <name>Forward a local port to a remote port on the Codespace
$gh codespace ports forward <local-port>:<remote-port>Change the visibility of a Codespace port to public
$gh codespace ports visibility <port>:publicTail the logs of a Codespace interactively
$gh codespace logsTail logs for a specific Codespace
$gh codespace logs --codespace <name>Copy a file between your local machine and a Codespace
$gh codespace cp <source> <dest>Recursively copy a directory to/from a Codespace
$gh codespace cp -r <source> <dest>Rebuild the dev container for a Codespace
$gh codespace rebuildPerform a full rebuild of a Codespace ignoring cache
$gh codespace rebuild --fullOpen a Codespace in Visual Studio Code interactively
$gh codespace codeOpen a specific Codespace in Visual Studio Code
$gh codespace code --codespace <name>GitHub Cache & Organization
List GitHub Actions caches for the repository
$gh cache listList caches matching a specific key
$gh cache list --key <key>List caches associated with a specific branch/ref
$gh cache list --ref <ref>Limit the number of cache entries returned
$gh cache list --limit <number>Output cache data in JSON format
$gh cache list --json <fields>Delete a specific Actions cache by its ID
$gh cache delete <id>Delete all GitHub Actions caches for the repository
$gh cache delete --allList organizations you belong to
$gh org listLimit the number of organizations listed
$gh org list --limit <number>Output your organization list in JSON format
$gh org list --json <fields>GitHub Browse & Status
View status of relevant PRs, issues, and workflow runs
$gh statusView dashboard status excluding a specific repository
$gh status --exclude <owner/repo>View dashboard status scoped to a specific organization
$gh status --org <org>Open the current repository in the web browser
$gh browseOpen a specific issue or PR number in the browser
$gh browse <number>Open a specific repository file in the web browser
$gh browse <file>Open a specific branch of the repository in the browser
$gh browse --branch <branch>Open a specific tag of the repository in the browser
$gh browse --tag <tag>Open a specific commit URL in the browser
$gh browse --commit <commit>Open the repository's projects board in the browser
$gh browse --projectsOpen the repository's wiki page in the browser
$gh browse --wikiOpen a different specific repository in the browser
$gh browse --repo <owner/repo>Print the URL to the console instead of opening the browser
$gh browse --no-browserOpen the repository settings page in the browser
$gh browse --settingsOpen a specific file on a specific branch in the browser
$gh browse <file> --branch <branch>GitHub Attestation
Verify the artifact attestation of a local file
$gh attestation verify <file>Verify an artifact file against a specific repository
$gh attestation verify <file> --repo <owner/repo>Verify an artifact file against a specific owner
$gh attestation verify <file> --owner <owner>Verify an artifact using an explicit sigstore bundle
$gh attestation verify <file> --bundle <bundle>Download an attestation bundle by subject digest
$gh attestation download <subject-digest>Download an attestation bundle from a specific repo
$gh attestation download <subject-digest> --repo <owner/repo>Download an attestation bundle matching a specific predicate type
$gh attestation download <subject-digest> --predicate-type <type>GitHub Ruleset & Environment
Fetch all configured deployment environments via API
$gh api /repos/{owner}/{repo}/environmentsFetch details of a specific deployment environment
$gh api /repos/{owner}/{repo}/environments/<env-name>Create or update a deployment environment via API
$gh api /repos/{owner}/{repo}/environments/<env-name> --method PUTDelete a deployment environment via API
$gh api /repos/{owner}/{repo}/environments/<env-name> --method DELETEList rulesets active on the current repository
$gh ruleset listList rulesets configured for a specific organization
$gh ruleset list --org <org>List rulesets including those inherited from parents
$gh ruleset list --parentsView details of a specific repository ruleset
$gh ruleset view <id>View details of a specific organization ruleset
$gh ruleset view <id> --org <org>Open a specific ruleset in the web browser
$gh ruleset view <id> --webEvaluate which rulesets apply to a specific branch
$gh ruleset check <branch>Check rules applied to the default branch
$gh ruleset check <branch> --defaultGitHub Extension
List all installed GitHub CLI extensions
$gh extension listInstall an extension from a repository
$gh extension install <repo>Install a specific extension by owner/repo name
$gh extension install <owner/repo>Uninstall a specific GitHub CLI extension
$gh extension remove <name>Update a specific extension to its latest version
$gh extension upgrade <name>Update all installed extensions to their latest versions
$gh extension upgrade --allExecute a local or uninstalled extension script
$gh extension exec <name>Scaffold a new GitHub CLI extension project
$gh extension create <name>Interactively browse and install available extensions
$gh extension browseSearch for available extensions on GitHub
$gh extension search <query>