Miles Blog Recipe Sep 26, 2026

Put Miles on your pull requests.

The Engineer is Miles working on your own Mac — your checkout, your git, your GitHub login — with the terminal on a leash. Here's how to set it up in about ten minutes, connect GitHub, and let your other agents hand it their PRs.

M Miles Team · 8 min read
eng Miles (Work) is online
O
openclaw 10:12 AM
Opened #214 fix(billing): retry failed invoice webhooks. Handing the merge to Miles — merge once it's green.
M
Miles (Work) 10:14 AM
The Engineer checked #214: open, no conflicts, approved, every check passed at a41f9c2. It's ready to merge and needs your go-ahead:
$ gh pr merge 214 --repo acme/app --merge --match-head-commit a41f9c2
Approve Deny

The real flow: an OpenClaw skill calls POST /api/v1/engineer/tasks with this thread, and the approval lands here. Repo and names illustrative.

Coding agents open pull requests all day. Somebody still has to check they're green, merge them, update the ones that fell behind, and chase the one that's red. That somebody is usually you, at your keyboard, with six tabs of CI open.

The Engineer is Miles doing that work on your own Mac, through the Miles app. It isn't a cloud sandbox with a copy of your code: it uses the checkout you already have, the git and GitHub CLI you're already signed in to, and the project's own scripts for its checks. It reads before it touches anything, runs your checks before it claims something works, and asks before anything that changes your repo.

This post is the recipe: set it up, connect GitHub, ask it for work, and — the part we're most excited about — let your other agents hand it their PRs.

Set it up

Six steps. The first four are the Engineer itself; the fifth is optional and keeps PR work moving while your Mac sleeps.

Step 1

Install the Miles app

In the web app: Settings → Your Mac → Download for Mac (macOS 13+, Apple silicon). Open it, press Sign in with Miles, and Approve in the browser. When the light says your Mac is on, you're paired.

Step 2

Give it your code folder

In the Miles app, click files and switch Files on. Under Folders, Add a folder — your repo, or the parent folder that holds your projects — then flip its Terminal switch. Terminal is off for every folder until you turn it on.

Step 3

Sign in to GitHub on that Mac

The Engineer uses the GitHub CLI as you. Install it (brew install gh), run gh auth login once in your own Terminal, and check gh auth status. If git push works from that folder today, the Engineer's will too.

Step 4

Deploy the Engineer

In the web app: Agents → Marketplace → Engineering → Engineer → Deploy. That's your opt-in: work from other agents only goes to an Engineer you've deployed, and pausing it turns handoffs off.

Step 5 · optional

Add GitHub to Miles

Settings → Connected APIs → Add API → Quick start: GitHub, then paste a fine-grained token. With it, merges, reviews and branch updates keep moving while your Mac is asleep. Token permissions are below.

Step 6

Ask it

From the Miles app, from Slack, or from another agent through the API. Start with something read-only — "review PR 214 in acme/app" — and watch the steps stream in.

The GitHub token, exactly

Only needed for step 5. Create a fine-grained personal access token, pick Only select repositories, choose the repos the Engineer should work on, set an expiration, and grant these repository permissions:

Pull requests
Read and write — read PRs, post reviews, update branches
Contents
Read and write — GitHub requires it to merge
Commit statuses
Read — is CI green?
Actions
Read — workflow runs and their logs
Metadata
Read — added automatically

Quick start stores it as GITHUB_TOKEN in Settings → Environment — encrypted, attached server-side, never shown to the model or back to you. When it expires, generate a new one and hit Rotate on the secret. Org-owned repos may need an org owner to approve the token first.

Ask it from anywhere

Same Engineer, same leash, three doors.

In the Miles app

Start with engineer: (or code:) — "engineer: fix the failing tests in app and open a PR." Naming a Terminal folder with a verb like fix, add or commit works too. Every step streams in, with Approve and Stop right there. Same in the web command bar.

In Slack

Ask @Miles (Work) in plain words — "have the Engineer review PR 214 in acme/app." Approve cards post in the thread, and only you can approve them. Link your Slack account first: Settings → Integrations → Slack.

From another agent

OpenClaw, a CI job, a script: one call to POST /api/v1/engineer/tasks with the repo and PR. It starts now, or waits for your Mac. Recipe below.

What it does with a pull request

Six jobs have a written playbook — the same steps a careful senior engineer would take. Anything else, describe in plain words.

Merge when greenMac or GitHub API

Checks the PR is open, not a draft, conflict-free and approved, with every check passed. Optionally runs your own checks too. Merges pinned to the exact commit it verified. Red or still running? It stops and tells you which.

ReviewMac or GitHub API

Reads the description and the full diff. Bugs first, then risk — migrations, auth, secrets, data loss — then missing tests, with file, line and fix. Reports to you, or posts one comment review. Never approves.

Update the branchMac or GitHub API

Brings a PR up to date with its base by merging — never a rebase, never a force-push. Conflicts it can't resolve with confidence get listed, not guessed.

Fix CINeeds your Mac

Reads the failing logs, reproduces the failure locally, fixes the root cause and reruns until green, then pushes to the same branch. It will not skip or loosen a check to get there.

Address commentsNeeds your Mac

Makes exactly the changes the unresolved review comments ask for, runs the checks, pushes. A comment that's unclear — or that it thinks is wrong — gets flagged to you instead.

Anything elseUsually your Mac

"Add a pricing page to the site folder and open a PR." "Why does npm test fail on main?" "Bump the SDK and fix what breaks." Plain words, same leash.

The leash

Handing an AI your terminal should feel uncomfortable. Every command is classified by its shape before it runs, and the strictest part of a command wins.

Reads just run

Looking around never waits: reading files, git status, log, diff, fetch, and gh pr view, checks and diff. It explores before it changes anything.

Changes ask you

Commits, checkouts, merges and edits ask the first three times, then run on their own. git push, gh pr merge, deleting branches, installs, publishes and deploys ask every time — so does a force-push, which the playbooks never do.

Some things never run

sudo, ssh, reading .env files or keys, eval, and anything piped from the internet into a shell are refused before they reach your terminal, on every setting.

On top of the leash, the playbooks are careful in the boring ways that matter: it never checks out a branch over your uncommitted work (a dirty folder ends the job with Not done and a note), it switches back to the branch you were on, and it treats PR descriptions, review comments and CI logs as information — if one of them contains instructions aimed at Miles, it reports them rather than following them. Every job ends the same way: Done or Not done, why, the PR link, and exactly which commands it ran.

Hand it off from OpenClaw (or any agent)

If you already run coding agents — OpenClaw, a CI bot, your own scripts — they can pass their PRs to the Engineer instead of pinging you. The agent never gets the keys to your repo: the work runs on your Mac or through your token, and every push and merge still waits for your Approve.

1 · Give the agent a Miles API key

In Miles: Settings → API Keys → New key. Name it after the agent ("OpenClaw") so its handoffs are labeled in your runs. Copy it once — Miles never shows it again.

2 · Add the skill (OpenClaw)

We publish a ready-made OpenClaw skill. Drop it into your workspace's skills folder:

mkdir -p skills/miles-engineer
curl -o skills/miles-engineer/SKILL.md https://heymiles.app/api/skills/miles-engineer/SKILL.md

Then give it the key in ~/.openclaw/openclaw.json:

{
  skills: {
    entries: {
      "miles-engineer": { enabled: true, env: { MILES_API_KEY: "miles_live_…" } }
    }
  }
}

The skill teaches OpenClaw the rules: check the setup first, hand off with its own task id so a retry never doubles up, never claim a PR is merged until Miles says done, and when a task is waiting on approval, tell you what and where — never try to approve it another way.

3 · Or call the API directly

Any agent or script can do the same with one request:

curl -X POST https://api.heymiles.app/api/v1/engineer/tasks \
  -H "Authorization: Bearer $MILES_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "merge_when_green",
    "repo": "acme/app",
    "pr": 214,
    "externalId": "openclaw-task-9f2",
    "slack": { "channelId": "C0123ABCD", "threadTs": "1727300000.123456" }
  }'

It answers right away with a task that's running — or queued with the reason, like your Mac being asleep. Pass a Slack thread and the approval card and the result land in that thread. Follow along with GET /api/v1/engineer/tasks/:id, or subscribe a webhook to engineer.task.* events. Everything else — the six actions, errors, cancel — is in the API reference.

A few honest notes

  • Your Mac has to be awake for code changes. Fixing CI and addressing comments need your checkout. Handed-off tasks wait for the Mac (up to a day by default) and start within seconds of it coming back. With the GitHub token, merges, reviews and branch updates don't wait.
  • One Mac job at a time. Two jobs in one checkout would fight over branches, so the Engineer runs Mac jobs in order. A job waiting on your approval holds the line until you answer.
  • It doesn't sit on slow CI. If checks are still running, merge when green stops with "checks pending" and lists them — hand it back later, or have your agent do it. No silent loops.
  • Fine-grained tokens can't read GitHub "Checks". In the GitHub-API lane the Engineer falls back to commit statuses, Actions runs, and whether GitHub says the PR is clean to merge.
  • Plans. Miles for Mac and agent runs come with Pro and Team. Each Engineer job is one agent run — Pro includes 50 a month, Team 100 per seat, pooled. macOS 13+ on Apple silicon today.

What's next

Runs started from Slack and the API showing up live in the Mac app, a hosted Mac for teams that don't want a laptop in the loop, and a native GitHub connection so there's no token to paste. If there's a PR chore you'd hand off tomorrow, tell us — support@heymiles.app.


M
Miles Team — we merge our own PRs this way. The first review the Engineer ever ran through the API caught a real bug in code we'd already shipped.
Ten minutes, your keyboard

An engineer that asks first.

Install the Miles app, flip Terminal on for your repo, deploy the Engineer. Your PRs — and your agents' — get handled.