Skip to main content

JSON output

Commands that produce data support --json. JSON goes to stdout; status messages go to stderr. This separation makes piping safe — you never need to filter stderr from your JSON.

Print the machine-readable schema for any command's output:

arc schema status
arc schema submit
arc schema analyze

arc status --json

arc status --json
{
"base": "main",
"prefix": "feat",
"current_branch": "feat/api",
"branches": [
{
"name": "feat/auth",
"index": 1,
"pr_number": 42,
"pr_url": "https://github.com/owner/repo/pull/42",
"pr_state": "OPEN",
"commits": 2,
"revision": 3,
"needs_rebase": false,
"is_current": false,
"is_merged": false
},
{
"name": "feat/api",
"index": 2,
"pr_number": 43,
"pr_url": "https://github.com/owner/repo/pull/43",
"pr_state": "OPEN",
"commits": 1,
"revision": 3,
"needs_rebase": false,
"is_current": true,
"is_merged": false
}
]
}

Field reference

FieldTypeDescription
basestringStack base branch
prefixstring | nullBranch name prefix, or null if none
current_branchstringCurrently checked-out branch
branches[].namestringBranch name
branches[].indexinteger1-based position in the stack
branches[].pr_numberinteger | nullPR number, or null if no PR
branches[].pr_urlstring | nullPR URL, or null if no PR
branches[].pr_statestring | nullOPEN, MERGED, CLOSED, or null
branches[].commitsintegerCommits on this branch beyond its base
branches[].revisionintegerPush counter (increments on each arc push)
branches[].needs_rebasebooleanTrue if the branch is out of date with its parent
branches[].is_currentbooleanTrue if this is the currently checked-out branch
branches[].is_mergedbooleanTrue if the PR is merged on GitHub

arc submit --json

arc submit --json
{
"results": [
{
"branch": "feat/auth",
"action": "update",
"pr_number": 42,
"pr_url": "https://github.com/owner/repo/pull/42"
},
{
"branch": "feat/api",
"action": "create",
"pr_number": 43,
"pr_url": "https://github.com/owner/repo/pull/43"
}
]
}

action is "create" for new PRs, "update" for existing ones, "skip" if the branch was skipped (e.g. dry run with no changes), or "error" if the PR operation failed.


arc stack analyze --json

arc stack analyze --json
{
"critical_path": ["feat/auth", "feat/api", "feat/ui"],
"safe_to_land": ["feat/auth"],
"blocked": [
{
"branch": "feat/api",
"blocked_by": ["feat/auth"]
}
]
}

Field reference

FieldTypeDescription
critical_pathstring[]Longest chain of unmerged branches, bottom to top
safe_to_landstring[]Branches that can be landed now (no unmerged dependencies)
blocked[].branchstringBranch that cannot yet be landed
blocked[].blocked_bystring[]Unmerged branches that must land first

Common patterns

# Check if the stack is clean
arc status --json | jq 'all(.branches[]; .needs_rebase == false)'

# Get all PR numbers
arc status --json | jq '[.branches[].pr_number | select(. != null)]'

# Find the current branch's PR
arc status --json | jq '.branches[] | select(.is_current) | .pr_url'

# Check for merged branches still in the stack
arc status --json | jq '.branches[] | select(.is_merged) | .name'