LinuxCommandLibrary

gh-status

Display your personal GitHub status

TLDR

Print information about all repositories you're subscribed to (issues, pull requests, reviews, mentions, activity, etc.)

$ gh status
copy

Exclude certain repositories
$ gh status [[-e|--exclude]] [repositories]
copy

Print status of repositories belonging to an organization
$ gh status [[-o|--org]] [organization]
copy

SYNOPSIS

gh status [--json=<fields>] [-v | --verbose] [-w | --watch]

PARAMETERS

--json=<fields>
    Output JSON data for specified fields (e.g., branch, prs, issues)

-v, --verbose
    Enable verbose mode for detailed status information

-w, --watch
    Continuously watch and refresh status in real-time

DESCRIPTION

The gh status command provides a comprehensive overview of the current Git repository's state, integrating both local Git information and GitHub-specific details.

It displays the current branch, commit status (ahead/behind remote), any open pull requests, draft PRs, assigned issues, and repository health metrics like fork count or stars.

Designed for GitHub CLI users, it enhances traditional git status by adding remote GitHub context, helping developers quickly assess workflow needs without switching tools.

Output is human-readable by default, with options for JSON export or continuous watching. Requires authentication via gh auth login and a GitHub remote.

CAVEATS

Requires GitHub CLI authentication and a git repository with GitHub remote. May fail in non-interactive shells or without network access.
JSON fields are dynamic; check gh status --help for current list.

EXIT CODES

0: Success
1: Error (e.g., no repo, auth failure)

EXAMPLE OUTPUT

On main (ahead 2, behind 1)
Draft PR #123
2 assigned issues

HISTORY

Introduced in GitHub CLI v2.0.0 (2022) as part of workflow enhancements. Evolved from community requests for integrated status views; actively maintained with JSON and watch features added in subsequent releases.

SEE ALSO

git-status(1), gh(1), gh-pr(1), gh-issue(1)

Copied to clipboard