Show stack status with CI, approval, and merge readiness indicators.
# Infer stack from current branch (recommended)
gh-stack status
# Infer from a specific branch
gh-stack status --branch feat/my-feature
# List all stacks and select interactively
gh-stack status --all
# Search by identifier in PR titles
gh-stack status 'STACK-ID'
# CI mode (non-interactive)
gh-stack status --branch $GITHUB_HEAD_REF --ci
# Use with log command
gh-stack log --status 'STACK-ID'When run without an identifier, gh-stack status automatically discovers your stack by:
- Finding the PR for your current branch
- Walking up the PR base chain to find ancestors
- Walking down to find PRs that build on yours
This works with any PR structure - no special naming required.
The status command displays your PR stack with status bits showing:
- CI checks - Whether CI/GitHub Actions are passing
- Approved - Whether the PR has been approved
- Mergeable - Whether the PR has merge conflicts
- Stack clear - Whether all PRs below are approved and not draft
◉ feature-3 (current) #125 - Add final feature component...
│ [✓ ✗ ✓ ✗] 2 hours ago
│
│ - abc1234 Add widget component
│ - def5678 Update styles
│ + 2 more
│
◯ feature-2 #124 - Implement API endpoint
│ [✓ ✓ ✓ ✓] 1 day ago
│
◯ feature-1 #123 - Setup base infrastructure
│ [✓ ✓ ✗ ✓] 3 days ago
│
◯ main
Status: [CI | Approved | Mergeable | Stack]
✓ pass ✗ fail ⏳ pending ─ n/a
* feature-3 (current) #125 - Add final feature component...
| [Y N Y N] 2 hours ago
|
o main
Status: [CI | Approved | Mergeable | Stack]
Y=pass N=fail ?=pending -=n/a
| Position | Meaning | Pass | Fail | Pending |
|---|---|---|---|---|
| 1st | CI checks | All checks pass | Any check failed | Checks running |
| 2nd | Approved | Has approval | No approval | - |
| 3rd | Mergeable | No conflicts | Has conflicts | Computing |
| 4th | Stack clear | All below approved | Blocked by PR below | - |
| Flag | Description |
|---|---|
--branch, -b |
Infer stack from this branch instead of current |
--all, -a |
List all stacks and select interactively |
--ci |
Non-interactive mode for CI environments |
--trunk |
Override trunk branch (default: auto-detect or "main") |
--no-checks |
Skip fetching CI/approval/conflict status (faster) |
--no-color |
Disable colors and Unicode characters |
--help-legend |
Show status bits legend |
--json |
Output in JSON format |
-C, --project <PATH> |
Path to local repository |
-r, --repository <REPO> |
Specify repository (owner/repo) |
-o, --origin <REMOTE> |
Git remote to use (default: origin) |
-e, --excl <NUMBER> |
Exclude PR by number (repeatable) |
In CI environments, use --ci to disable interactive prompts:
# Must provide branch explicitly
gh-stack status --branch $GITHUB_HEAD_REF --ci
# Or use identifier
gh-stack status 'STACK-ID' --ci
# JSON output for parsing
gh-stack status --branch $GITHUB_HEAD_REF --ci --jsonThe --ci flag will:
- Fail with an error if no identifier or branch is provided
- Fail if on a trunk branch without an identifier
- Never prompt for user input
gh-stack status --json{
"stack": [
{
"branch": "feature-3",
"pr_number": 125,
"title": "Add final feature component",
"is_current": true,
"is_draft": false,
"status": {
"ci": "passed",
"approved": "failed",
"mergeable": "passed",
"stack_clear": "failed"
},
"updated_at": "2024-01-15T10:30:00Z",
"commits": [
{"sha": "abc1234", "message": "Add widget component"}
]
}
],
"trunk": "main"
}The legend is shown automatically on first run. To see it again:
gh-stack status --help-legendThe legend marker is stored in ~/.gh-stack-legend-seen.
gh-stack statusgh-stack status --branch feat/my-featuregh-stack status --no-checksgh-stack status -r owner/repogh-stack status --json | jq '.stack[].status.ci'