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