8000 GitHub - moses-y/machinist: Open source software factory infrastructure for advanced AI coding workflows · GitHub
[go: up one dir, main page]

Skip to content

About

Open source software factory infrastructure for advanced AI coding workflows

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Machinist

A job runner for coding agents. Your team assigns work in one place, and every job runs the same predefined steps on machines you control: a laptop, a VM, Docker (with optional gVisor) or Kubernetes. Everyone can see what is running and what is waiting on a person. It is early-access, open-source software.

Watch how Machinist works: a 50-second explainer with sound. A job is assigned from the web app or a Linear issue, a runner checks out the repository, an agent implements it, a second model family reviews it, and Machinist opens the pull request, merges it once checks pass and moves the issue to Done.

  • One place for the team. One control plane holds every job. Anyone signed in can see what each job is doing, step by step, and open its pull request.
  • Runs anywhere. A runner is a small daemon that asks the control plane for runs. Start one on a Mac, a VM, Docker (with optional gVisor), or Kubernetes. The control plane treats them all the same.
  • Steps you define. A preset is a list of steps: clone, implement, review, revise, open a pull request, check risk with a merge gate, and merge — or pause at an explicit approval gate (gate:) and chain downstream jobs with trigger: and on_merge:. Each step runs an agent (claude, codex, pi, or agy, with its own model and prompt) or a shell command. A test step is a check an agent cannot skip. See Preset recipes.
  • Any trigger. The web app (New job and Automations), GitHub Issues, Linear, a schedule, an MCP bot, or curl against the run API.

A job started from a Linear issue, running on vm-runner. Its pipeline shows checkout passed, implement running, and review, revise, publish and merge waiting, each step with its model.

The Spending dashboard: total spend this month, spend over 14 days, cost per merged pull request, tokens, daily spend, and spend by harness and model.

Supported harnesses: Claude logo Claude Code by Anthropic, OpenAI logo Codex by OpenAI, Google logo Antigravity by Google, and Pi. Logos belong to their owners. Machinist is not made by or tied to these companies.

Send the work to the run API, or let an automation or issue tracker start it. The job works on its own branch, and the default preset opens one pull request. Each step runs headless without mid-step Q&A; add a gate: step to a preset when you want a job to pause for human approval before continuing.

See Vision for what Machinist is for, where it is, and what comes next.

Install

Install the latest stable release for Linux or macOS (amd64 / arm64), verified against the release SHA-256 checksums:

curl -fsSL https://machinist.sh/install.sh | sh

To install the latest automated nightly build from main instead:

curl -fsSL https://machinist.sh/install.sh | MACHINIST_CHANNEL=nightly sh

Upgrade an existing install in place:

machinist update            # latest stable release
machinist update --nightly  # latest nightly build (alias: machinist upgrade)

Quick start

This runs the control plane and one local runner on your machine using the machinist binary from Install (to build from source instead, see Development). You need Git, the GitHub CLI signed in with gh auth login, and a supported coding agent CLI on your PATH (claude, codex, pi, or agy). Give the GitHub CLI the workflow scope too, so jobs can push changes to .github/workflows/:

gh auth refresh -s workflow
mkdir my-machinist && cd my-machinist
git init
machinist init --repo owner/name --handle "$(gh api user --jq .login)" --login

Replace owner/name with a repository you control. Machinist runs from the directory that holds its configuration, so keep that directory in git and run every command below from there (or pass --config). machinist init writes these files, all meant to be committed:

config.yaml          the control plane
runner.yaml          a local runner
factory/presets/     the default preset, a short list of steps
factory/agents/      the agents those steps run: harness, model and prompt
factory/prompts/     rules every agent follows
factory/scripts/     the shell those steps run

It also creates .machinist/, which holds the database and a token for the local runner, and adds it to .gitignore.

  • Local login vs. API keys: Passing --login sets env: [] and login: true in runner.yaml so steps reuse an existing CLI login on your own machine. To use API keys instead (such as ANTHROPIC_API_KEY or OPENAI_API_KEY), omit --login (or list the variable names in env: in runner.yaml, e.g. env: [ANTHROPIC_API_KEY]) and export them in the runner's environment. Running machinist init with no flags writes starter templates where you can set github.handle, github.repositories, and env by hand. See Credentials.
  • Other harnesses: The default starter agents use claude. To run codex, pi, or agy instead (or mix harnesses across steps), set harness in factory/agents/*.md and make sure that CLI is on PATH. See Factory files.
  1. Create an operator token and print it so you can sign in to the web app (and reuse $TOKEN from the shell):

    TOKEN=$(machinist token create "$USER")
    echo "$TOKEN"
  2. Start the control plane in one terminal and the local runner in another:

    GH_TOKEN=$(gh auth token) machinist start
    GH_TOKEN=$(gh auth token) machinist runner start

    machinist start prints the control plane URL (http://127.0.0.1:7331), and machinist runner start logs the harnesses it discovered on PATH.

  3. Open http://127.0.0.1:7331, paste the printed token to sign in, and select New job. Pick the repository, type what you want done, and select Start job. The agent does the work, opens a pull request, and merges it once its checks pass. The same from curl:

    curl -sS -X POST http://127.0.0.1:7331/machinist/run \
      -H "Authorization: Bearer $TOKEN" \
      -d '{"key":"fix-1","vars":{"repo":"owner/name"},"prompt":"Fix the toast position"}'

The pull request comes from whoever owns GH_TOKEN. For a team, use a GitHub App instead: each run gets a token for its own repository that lasts an hour, and no runner holds a GitHub token.

To start jobs by labeling GitHub issues, see the GitHub Issues guide. To start jobs by assigning Linear issues to Machinist, follow the Linear setup guide. It makes a Linear app with client credentials, so Machinist gets and renews its own Linear token.

Using it

Jobs start from the web app (New job or Automations), the run API, MCP, a schedule, GitHub Issues, Linear, or downstream trigger: / on_merge presets. Steps run headless; a job pauses only when its preset defines an explicit approval gate. When an agent has to guess, it lists each guess under Assumptions in the pull request.

Page What it does
Dashboard Three views (Overview, Models, and Spending) over 7, 14, or 30 days: time to merge, human touches, waiting gate count, pull requests opened and merged, success rate, run and wait times, per-harness/model comparisons, daily spend, cost per merged pull request, and tokens
Jobs Every job as a 4-column board (Queued, Running, Review, Done) or paginated list, with source (Web, API, Schedule, Trigger, GitHub, Linear), repository, preset, pull request, state (Waiting with a Gate badge for approval gates, Waiting for CI, or Needs you), and merge-gate risk badge (Low, Medium, High)
Automations Saved and scheduled jobs from the database or factory/automations/. Create, edit, and run them on demand, as-is or with one-off prompt, harness, model, runs_on, or preset input overrides
New job Pick a repository, choose a preset (with fields for any declared preset inputs), write a prompt, and start a job
Job One job: result, Gate panel when Waiting (showing details and Approve / Deny controls), merge-gate verdict and reason, parent and triggered child job links, prompt, steps and their status (including Waiting and Held), and every run with live step output. Run again starts an ended job again
Runners Each runner (local, docker, docker (runsc), or kubernetes), its labels, harnesses, busy slots, and queue wait times
Settings Setup checks (Overview), projects (repositories), GitHub App and auto-merge mode (GitHub), Linear, tokens (including read and run scopes), team and invites, presets and agents, and account

To stop a job, call POST /machinist/jobs/{id}/cancel. To run an ended job again, call POST /machinist/jobs/{id}/rerun. After editing config.yaml or factory/, run machinist reload to apply changes without restarting the control plane. Set notify.webhook and server.public_url in config.yaml to send a Slack-compatible webhook when a job needs a person or fails.

Every job uses the default preset unless it names another: checkout, implement, review, revise, publish, merge-gate, and merge. When github.auto_merge is true (the default), a pull request merges once its checks pass, review accepts it, and merge-gate marks it low risk. Medium- or high-risk pull requests stay open in Review for a person. Auto-merging pull requests waiting on checks show Waiting for CI. If CI fails or a parallel merge causes a conflict, PR Steward starts a fix run on the same branch up to github.steward_retries times (default 2), without overwriting human commits. Commit .machinist/merge-policy.md to a repository's default branch to override factory/prompts/merge-policy.md. Set github.auto_merge: false for observe mode: merge-gate still comments its verdict on every pull request, and leaves every pull request open for a person. See Merge gate and policy, Merge policies, and Preset recipes. Add a preset to factory/presets/ only when a job needs different steps.

Start jobs from GitHub Issues

  1. Configure a GitHub App (with Issues: Read and write) or set GH_TOKEN where the control plane runs.
  2. Add a github_issues section to config.yaml with allowed_users (the GitHub logins allowed to trigger jobs) and an optional label (defaults to machinist), then run machinist reload.
  3. Apply the machinist label to an open GitHub issue in a watched repository. Machinist verifies who applied the label from the issue's timeline and starts a job within a minute.

See the GitHub Issues guide for each step.

Start jobs from Linear

  1. In Linear, create an app called Machinist with client credentials on.
  2. Set LINEAR_CLIENT_ID and LINEAR_CLIENT_SECRET where the control plane runs. In the linear section of config.yaml, set app_user_id (the app's user ID), projects or teams (Linear project or team to repository) and a non-empty allowed_users. Then run machinist reload (or restart the control plane if you changed environment variables).
  3. Delegate an issue to the Machinist app. Machinist starts a job for it within a minute.

See the Linear setup guide for each step.

Testing Machinist itself

go test ./...
cd internal/controlplane/web && npm ci && npm test

The Go tests run whole jobs end to end with fake claude and gh commands and a local Git remote. See Development.

The default preset runs review with a second agent, runs revise to fix what review found and reviews again, opens one pull request in publish, and runs merge-gate without GitHub credentials to judge risk against .machinist/merge-policy.md on the default branch (or factory/prompts/merge-policy.md). Then machinist merge posts the merge-gate comment and hands the pull request to the control plane, so the runner does not wait on CI. The control plane merges it only when github.auto_merge is true, review accepted it, merge-gate approved it as low risk, and all checks pass. That merge rule is Go code, not an agent. How the pull request is written is in factory/agents/publish.md. Branch protection still decides what can merge. See Security.

How it fits together

One control plane holds jobs, runs, and presets, backed by SQLite or PostgreSQL. It never runs a step. Runners on Macs, VMs, Docker (with optional gVisor), or Kubernetes dial out and ask for runs. See Architecture.

Go deeper

Guide What it covers
Documentation The full list
Vision What Machinist is for, where it is, and what comes next
Run API Starting jobs from any system
MCP Letting bots list, run, watch and cancel jobs over MCP
GitHub Issues Starting jobs by labeling GitHub issues
Linear Starting jobs by delegating or assigning Linear issues
Factory files Presets, agents, gates, triggers, merge gate, PR Steward and automations
Preset recipes Copy-paste presets for cross-model review, approval gates, deploys, inputs and observe mode
Merge policies Risk-based merge policies and starter templates
Runners Adding local, Docker (with optional gVisor), and Kubernetes runners
Credentials Which credential to use, and why
Configuration Every setting (including auth, PostgreSQL, live reload, webhooks and PR Steward)
VM deployment Running and upgrading on a Linux VM
Cloud Run deployment Running on Google Cloud Run with PostgreSQL
Development Build, test and contribute

Read CONTRIBUTING.md before contributing. Machinist uses the MIT License.

About

Open source software factory infrastructure for advanced AI coding workflows

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0