You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[GitHub CLI](https://cli.github.com/) (`gh`) authenticated via `gh auth login`
48
+
-[`gh-stack` extension](https://github.com/github/gh-stack) (`gh extension install github/gh-stack`) when using `--stack`
48
49
-`ANTHROPIC_API_KEY` or `OPENAI_API_KEY` environment variable set when using the `llm` partition backend
49
50
50
51
## Usage
@@ -85,6 +86,7 @@ pr-split split feature-branch --base main --dry-run
85
86
|`--priority`|`orthogonal`| Grouping priority (`orthogonal` or `logical`) |
86
87
|`--chunk-strategy`|`dynamic_programming`| Large-diff chunking strategy (`dynamic_programming` or `greedy`) |
87
88
|`--partition-strategy`|`llm`| Hunk-to-PR partition backend (`llm`, `graph`, or `cp_sat`) |
89
+
|`--cp-sat-timeout`|`15.0`| Maximum seconds to spend in the CP-SAT solver |
88
90
|`--stack`|`false`| Stack dependent PRs: each child branches from and targets its parent's branch |
89
91
|`--draft`|`false`| Open every sub-PR as a draft |
90
92
|`--dry-run`|`false`| Preview plan and save to `.pr-split/plan.json` without creating branches or PRs |
@@ -97,7 +99,7 @@ pr-split split feature-branch --base main --stack
97
99
98
100
Without `--stack`, every sub-PR branch is cut from the merge base and targets the base branch, so a sub-PR that depends on code from another group only goes green once its dependency merges. With `--stack`, each dependent group's branch is cut from its parent group's branch and carries the parent's hunks for shared files, and its PR targets the parent's branch. Every PR shows only its own diff, compiles standalone, and GitHub retargets children automatically as parents merge.
99
101
100
-
Linear chains in the plan are also registered as [native GitHub stacks](https://github.blog/changelog/2026-07-30-stacked-pull-requests-are-now-in-public-preview/) via the [`gh-stack` extension](https://github.com/github/gh-stack) (`gh extension install github/gh-stack`). If the extension is missing the linking step is skipped with a warning — the PRs are already correctly chained without it. Groups that depend on more than one group target the base branch directly, since native stacks are strictly linear; their branch carries every ancestor's changes so it still builds standalone, and those extra changes drop out of the diff as the ancestor PRs merge.
102
+
Linear chains in the plan are registered as [native GitHub stacks](https://github.blog/changelog/2026-07-30-stacked-pull-requests-are-now-in-public-preview/) via the [`gh-stack` extension](https://github.com/github/gh-stack), which is **required** for `--stack`: install it with `gh extension install github/gh-stack`. `pr-split` checks for it up front and refuses to run a stacked split (or `execute` a stacked plan) without it; a `--dry-run` does not need it. If linking fails after the PRs are created, the command exits with an error — the plan state is already saved, so `pr-split clean` can undo the split. Groups that depend on more than one group target the base branch directly, since native stacks are strictly linear; their branch carries every ancestor's changes so it still builds standalone, and those extra changes drop out of the diff as the ancestor PRs merge.
101
103
102
104
### Check status of an existing split
103
105
@@ -195,6 +197,7 @@ Settings can be set via environment variables with the `PR_SPLIT_` prefix:
0 commit comments