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.

~/your-repo ยท moonlighting
$ moonlighting new-order "Add rate limiting"
โœ“ wrote orders/wo-014.md ยท status: draft
$ moonlighting approve wo-014
โœ“ status: approved โ€” the night shift picks it up at 00:01
$ moonlighting status
review  wo-014  Add rate limiting  branch: wo/014

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
day shift (people) night shift (selected engine)
decide what problems matter โ”€โ”€โ”€โ”€โ”€โ”€โ–บ implement approved orders
review branches & reports โ—„โ”€โ”€โ”€โ”€โ”€โ”€ flip orders to review/blocked
merge, block, or reject 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.

$ uv tool install moonlighting-factory
$ moonlighting schedule install
โœ“ cron installed โ€” first run tonight at 00:01

Inside a factory checkout, run commands with uv run moonlighting ...