Command referencegh run view
gh run view command (Linux & Windows / GitHub CLI)
What it does
Inspect a GitHub Actions run, including jobs, annotations, and optional logs. When people search for gh run view, they usually want practical GitHub CLI flags, safe examples, and how this subcommand fits everyday PR and repo workflows on Linux, Windows, and macOS. Syntax, options, and copyable examples are below.
Inspect a GitHub Actions run, including jobs, annotations, and optional logs.
Syntax
gh run view [<run-id>] [flags]
Common options
| Flag / option | Meaning |
|---|---|
| --log | Print the run log. |
| --log-failed | Print logs only for failed steps. |
| --job | View a specific job ID. |
| -w, --web | Open the run on GitHub. |
| --exit-status | Exit non-zero if the run failed. |
Practical examples
View latest interactively
gh run view
Prompts or selects a run when no ID is given (version-dependent UX).
Failed logs
gh run view 123456789 --log-failed
Prints logs for failing steps only.
Open web
gh run view 123456789 -w
Opens the Actions run page in a browser.
Common mistakes
- Using a workflow ID where a run ID is required.
- Dumping full `--log` output for huge matrix builds into the terminal.
Related commands
- gh run listList recent GitHub Actions workflow runs for the repository.
- gh run watchWatch a GitHub Actions run until it completes, printing progress updates.
- gh workflow runTrigger a workflow_dispatch event for a GitHub Actions workflow.
- gh pr checksShow GitHub Actions and status-check results for a pull request.
- gh auth loginAuthenticate the GitHub CLI with GitHub.com or GitHub Enterprise so other gh commands can run.
- gh pr createCreate a pull request from the current branch with title, body, reviewers, and base branch options.
- gh pr mergeMerge a pull request using merge commit, squash, or rebase strategies.
- gitTrack source history and collaborate through distributed repositories.
FAQ
What does gh run view do in GitHub CLI?
Inspect a GitHub Actions run, including jobs, annotations, and optional logs.
Does gh run view work on Windows and Linux?
Yes. The GitHub CLI (`gh`) runs on Linux, Windows, and macOS with the same subcommand syntax after you authenticate with `gh auth login`.
What is a practical gh run view example?
Try `gh run view` — Prompts or selects a run when no ID is given (version-dependent UX).
Do I need a token in the command line for gh run view?
Prefer `gh auth login` so credentials stay in the system keyring or secure storage. Avoid pasting personal access tokens into shell history.
Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.