a software factory
People work the day shift.
Agents work the night shift.
moonlighting turns approved work orders into branches, reports and pull requests โ while you sleep. People decide. Agents type.
The contract
One status line between the shifts
Work moves through the factory as small markdown work orders. Marking an order approved is a standing instruction: tonight, an agent executes it autonomously. By morning it sits at review โ with a report, a branch and a diff, waiting for a human decision.
โ๏ธ Day shift โ people
Decide what matters
- โ Write and approve work orders
- โ Review branches, reports and diffs
- โ Merge on GitHub, block, or reject
๐ Night shift โ agents
Implement approved orders
- โ One order, one branch (
wo/<id>) - โ Flip orders to review or blocked
- โ Never merge, never touch main
One binary
A subcommand per workflow
moonlighting new-order "Title"
Create an order; it asks, then offers to approve.
moonlighting status
See every order: approved, blocked, review, draft, done.
moonlighting approve ID
Approve a draft for tonight's run.
moonlighting night
Run the queue โ with --repo, --engine, --model, --max-orders.
moonlighting accept ID
Push the branch and open a PR. You merge it on GitHub.
moonlighting reply ID "text"
One reply: parks a review, answers a blocked order.
moonlighting lint-orders
Check every order before spending tokens.
moonlighting schedule install
Nightly cron at 00:01. Remove and status too.
moonlighting rotate-logs --days 90
Gzip old logs. Never deletes.
Guardrails
The factory has house rules
Approved only
The night shift executes only approved orders, each on its own branch.
Humans merge
Agents never merge locally. accept opens a PR; the merge is yours.
Own your state
Orders, logs and clones live under your data directory. No checkout needed to run the binary.
Turn the lights off
uv runs everything under the hood. One install, one nightly cron.
Inside a factory checkout, run commands with uv run moonlighting ...