
The tea-party your terminal was missing.
A forge client for Forgejo and Gitea - a table laid for two: you with a gh-style CLI, your agent with an MCP server. The dangerous commands were not locked away; they were simply never invited, and whatever refuses will tell you why and offer a wiser way.
INSTALL other platforms →
curl -fsSL https://codeberg.org/sixfold_space/madtea/releases/download/latest/madtea_linux_amd64.tar.gz | tar -xz
./madtea_linux_amd64/madtea installCHAPTER I
Why this Tea-Party
“It’s always tea-time, and we’ve no time to wash the things between whiles.” — THE HATTER
Git tooling was written when the only guest at the keyboard was you. Seat an agent beside you, and the same familiar commands turn strange: a token wanders into a transcript and stays there; an issue is “tidied” and your repro steps are tidied away with it; a git reset --hard is reached for, and an afternoon's uncommitted work vanishes entirely - like the Cheshire Cat, but without so much as leaving the grin.
madtea lays the table differently: nothing dangerous is set on it in the first place. Ask for the missing knife and you are told, quite pleasantly, which spoon does the same job.

git remote -v.madtea issue body patch swaps one exact span. Whole-body replace does not exist.git reset --hard.madtea orchestrate merges the batch, tests them together, names the offender, reverts it.CHAPTER II
The Four Cups
“I want a clean cup,” interrupted the Hatter: “let’s all move one place on.” — A MAD TEA-PARTY
Drink them in the order the table suggests, moving one place on each time: ship a branch, land a whole batch, share out the worktrees - and when nobody can say what comes next, ask the backlog. Unlike the Dormouse, it answers.
CUP ONE
Ship a branch
Commit, push, PR, merge, and back to a clean main in one resumable command. If it dies halfway, run it again and it picks up its own open PR instead of laying a second place.
madtea finish "feat: rate limiter" --closes 88
pour the full cup →
CUP TWO
Land a whole batch
Merges the batch, then tests everything as one. If the tests go red, it binary-searches the merges, reverts the culprit in a throwaway worktree, and reports the evidence.
madtea orchestrate 88 91 94 --verify "go test ./..."
pour the full cup →
CUP THREE
Many hands, one repo
Each task gets its own tree and branch. Nothing is ever force-removed; a dirty or locked worktree just refuses.
madtea worktree add .worktrees/x feat/x
pour the full cup →
CUP FOUR
Ask the backlog
Sorts the whole backlog by what unblocks the most, what is safe to start in parallel, and what waits on something else - one repo or a whole org, one call.
madtea issue rank acme
pour the full cup →
CHAPTER III
“No room! No room!”
Four seats the agent cannot take, because the commands were never at the table. “There’s plenty of room!” said Alice indignantly — and there is, just not for these.
Nothing to leak
Every credentialed git operation hands the token through a temporary GIT_ASKPASS helper and deletes it afterwards. It never touches a URL, argv, ps output, or an agent’s transcript.
read the design →
Nothing gone for good
Deleting a repo, issue, release, tag, or wiki page is not a madtea operation on any surface. Each delete command stays discoverable, refuses, and points to the forge web UI.
read the design →
Nothing spilled
git reset --hard, git checkout -- <files>, and git stash drop have no madtea equivalents. Anything that would move a tree refuses on a dirty tree and names the fix.
read the design →
No borrowed keys
An agent session gets exactly one forge login: the repo it woke up in. Every other clone’s stored token stays off-limits, even to a confused or prompt-injected session.
read the design →
THE TABLE IS LAID
It works with Forgejo and Gitea, and it is tested against Codeberg - where madtea lives, at a domain the Hatter picked out himself. The install lines are at the top of the page; everything else is in the docs.
“Begin at the beginning, and go on till you come to the end: then stop.” — THE KING
begin at the beginning → docs