Tour: ship a branch with finish
madtea finish covers the whole branch-to-merge cycle in one resumable command. This is the most common workflow: you have a feature branch with committed work and you want it on main.
Full reference: cli-workflows.md - finish.
The one-liner
madtea finish "feat: rate limiter" --summary "Caps abusive clients" --closes 88
One command covers the whole cycle: commit the staged changes, push, open a PR, merge it, and return to a fresh main. The --closes 88 flag wires the issue reference so the PR body includes it and the forge closes the issue on merge.
Resumable after any failure
If finish dies at any step - network drop, a transient merge conflict, a CI gate that wasn’t ready - running it again picks up exactly where it stopped:
- It finds its own open PR instead of failing with “PR already exists.”
- It asks the forge which branch is the current default instead of trusting a stale
origin/HEAD. - It re-applies the
--closesreference if the PR body was written but the link wasn’t recorded.
No manual cleanup, no half-open PR to untangle - just re-run the same command.
Flags
madtea finish "fix: null deref" --closes 42
madtea finish "chore: deps" --summary "Bumps transitive deps to clear vulncheck"
madtea finish "docs: install guide" --no-commit # tree already committed; skip the commit step
madtea finish "feat: webhooks" --branch feat/webhooks # finish a named branch without switching to it
--closes N- link an issue and close it on merge. Use--no-closeto reference branch-detected issues without closing them.--summary TEXT- one-line PR body blurb; omit to leave the body with just the issue reference.--no-commit- skip the commit step when the tree is already clean (nothing staged to commit).--branch NAME- finish a branch by name from any worktree; the current checkout is never switched.
Working with worktrees
When you run parallel tasks in separate worktrees, finish by branch name means you never have to switch checkouts:
madtea worktree add .worktrees/rate-limiter feat/rate-limiter
# ... agent works in the worktree ...
madtea finish "feat: rate limiter" --branch feat/rate-limiter --closes 88
madtea worktree remove .worktrees/rate-limiter
The primary checkout stays on whatever branch you were on. See tour-worktrees.md for the full worktree tour.
Branch protection notice
After merging, finish checks whether the target branch has a protection rule. If not, it says so and names the fix:
madtea repo protect main
Most tools assume that’s already set up. finish tells you when it isn’t.
Part of the guides - madtea documentation.
Canonical source: docs/guides/tour-finish.md in the madtea repo.