dub submit
Push branches and create or update pull requests for your stack.
Usage
dub submit
dub ss
# Preview only
dub submit --dry-run
# Generate a PR description body with AI
dub submit --ai
# Create new PRs as drafts
dub submit --draft
# Promote existing draft PRs to ready for review
dub submit --publish
# Submit current branch + ancestors to trunk (default)
dub submit
# Submit current branch + all descendants
dub submit --upstack
# Submit the whole stack graph
dub submit --stack
# Submit only a single named branch
dub submit --branch feat/api
# Open GitHub PR create forms in the browser for new PRs
dub submit --web
# Queue GitHub auto-merge for submitted PRs
dub submit --merge-when-ready
dub submit --merge-when-ready --method rebase
# Request reviewers on every submitted PR
dub submit --reviewers alice,bob,@org/team
# Re-request existing reviewers after updating PRs
dub submit --rerequest-review
dub submit --rerequest-review-only monalisa,hubotFlags
| Flag | Description |
|---|---|
--dry-run | Preview submit actions without executing |
--ai | Generate a PR description body for this invocation |
--no-ai | Disable AI PR description generation for this invocation |
--draft | Create new PRs as drafts |
--publish | Promote existing draft PRs in the submit scope to ready for review |
| (default) | Current branch + ancestors to trunk |
--downstack | Same as default — current branch + ancestors to trunk |
--upstack | Current branch + all descendants |
--stack | Full tree from trunk |
--branch <name> | Only the specified branch |
--web | Open GitHub PR create forms in the browser for branches without open PRs |
--merge-when-ready | Queue GitHub auto-merge for every submitted PR |
--method <method> | Auto-merge strategy: squash (default), merge, or rebase |
--reviewers <list> | Request comma-separated GitHub users or teams on every submitted PR |
--no-reviewers | Skip repo-default reviewers for this submit |
--rerequest-review | Re-request review from existing reviewers on updated PRs |
--rerequest-review-only <users> | Re-request review only from comma-separated reviewers on updated PRs |
--path <mode> | [deprecated] current maps to --downstack; stack maps to --stack. Removed in v2. |
--fix | [deprecated] No-op alias retained for script compatibility |
Scope flags are mutually exclusive. Passing more than one (or combining a scope flag with --path) is a validation error.
--draft and --publish are mutually exclusive. --draft only affects newly created PRs; existing PRs stay in their current lifecycle state. --publish requires every selected branch to already have an open PR.
--rerequest-review runs only for PRs that already existed before submit updated them. Newly created PRs are skipped. Use --rerequest-review-only <users> with a comma-separated list to re-request a smaller reviewer set.
Aliases: dub ss
Submit Lifecycle Defaults
# Inspect current lifecycle default
dub config submit-default
# Create new submit PRs as drafts by default
dub config submit-default draft
# Promote existing draft PRs by default
dub config submit-default publish
# Draft when `.github/workflows/` contains workflow files; otherwise ready
dub config submit-default autoMigration from --path
--path current and --path stack still work in v1.x but emit a deprecation warning:
⚠ '--path current' is deprecated. Use '--downstack' instead. This will stop working in v2.
⚠ '--path stack' is deprecated. Use '--stack' instead. This will stop working in v2.Replace usage as follows:
| v1.x | Replacement |
|---|---|
dub submit --path current | dub submit (or dub submit --downstack) |
dub submit --path stack | dub submit --stack |
When AI submit defaults are enabled for the repository, --no-ai lets you force a manual PR body update for one run. AI submit only writes the PR description body; the PR title still comes from the last commit message.
Configure the provider with dub ai setup or dub ai env, then enable the assistant with dub config ai-assistant on.
If your repository includes a GitHub pull request template, DubStack asks AI to preserve that template structure when generating the PR description body. Supported locations include .github/pull_request_template.md, .github/PULL_REQUEST_TEMPLATE.md, .github/PULL_REQUEST_TEMPLATE/*.md, docs/pull_request_template.md, and pull_request_template.md.
Reviewers
Use --reviewers to request the same reviewers on every PR in the submit scope:
dub submit --reviewers alice,bob,@org/teamSet repo-default reviewers with dub config reviewers:
dub config reviewers alice,bob,@org/team
dub config reviewers
dub config reviewers --cleardub submit applies configured defaults unless you pass --reviewers for a one-run override or --no-reviewers to skip reviewer requests. DubStack validates user reviewers against repository collaborators and team reviewers against organization team slugs with repository access before it pushes branches or mutates PRs, so invalid handles fail early with a DubStack error.
Browser Create Flow
dub submit --web pushes the submit scope, then opens the GitHub compare/create URL for each branch that does not already have an open PR. The browser form is prefilled with the commit-title PR title and the generated DubStack body. Existing PRs skip the browser create flow and are refreshed through gh just like a normal submit.
When the generated body is longer than 4000 characters, DubStack writes it to a temp file, opens a title-only create URL, and prints the temp path so you can paste the body manually. After creating browser-opened PRs, rerun dub submit if you want DubStack to sync PR numbers and refresh hidden stack metadata.
Auto-Merge Queue
dub submit --merge-when-ready enables GitHub auto-merge on every PR in the submit scope after branches are pushed and PRs are created or updated.
dub submit --merge-when-ready
dub submit --stack --merge-when-ready --method mergeThe default strategy is squash, matching DubStack's clean-history preference. Use --method merge, --method squash, or --method rebase to choose the first strategy DubStack tries. If the repository does not allow that method, DubStack falls back across the other GitHub-supported methods.
GitHub still respects the stacked PR bases, so the bottom PR merges first and the next PRs become mergeable as their bases land. Queuing auto-merge on every submitted PR is safer than only queuing the bottom PR because it survives later stack rebases. If GitHub auto-merge or branch protection is not configured for the target base branch, DubStack surfaces GitHub's error with setup hints.
mkdir -p .github
cat <<'EOF' > .github/pull_request_template.md
## Summary
## Testing
## Checklist
- [ ] Ready for review
EOFOpen PR in Browser
Use dub pr to open a PR in your browser via gh:
# Current branch PR
dub pr
# Explicit branch / PR target
dub pr feat/auth-login
dub pr 123