Docs & CLI

From one paste to merged branches.

How your coding agent sets MicroDev up and runs subagents, and what you can do yourself with the microdev CLI. A subagent is a coding agent in its own isolated Linux microVM. The CLI calls that microVM a task, and so do these pages wherever they describe what the CLI does.

Quickstart

The quickest start is one paste into your coding agent, in a Git checkout of your project. It works from Claude Code, Codex and any other agent that can run a terminal command on macOS or Linux. The subagents it starts are Codex, Claude Code or Pi. The project does not have to be on GitHub: subagents start from the folder on your computer.

Paste this into your coding agent

Set up MicroDev so my parallel work runs in its subagents: run `curl -fsSL https://microdev.dev/install.sh | sh`, then run `~/.local/bin/microdev init` and do what it says until it reports ready.
  1. Your agent installs the CLI and runs the setup

    The installer verifies a checksum, installs microdev into ~/.local/bin and needs no sudo. Then your agent runs microdev init, which checks each step below, says what is left and is safe to run again. From then on the CLI keeps itself current, with nothing for you or your agent to run (how).

  2. You approve the GitHub sign-in

    The setup opens the sign-in in your browser. If it cannot, your agent shows you a link and a code instead. Approve MicroDev for your GitHub account. No card is needed, and the trial begins when your first subagent starts.

  3. You connect your model account

    Subagents run Codex, Claude Code or Pi on your own account. The first time, your agent runs that agent’s sign-in and you approve it in your browser. Coding agents has the details.

  4. Ask for work in parallel

    Fix these three bugs in parallel with MicroDev.

    Your agent starts one subagent per job from the folder as it is and merges each branch when it is done. How your agent runs subagents is next.

A private repository needs no Git credential step, because the code comes from your folder. Starting from your folder has the limits.

The setup also registers MicroDev’s MCP server with your agent. From its next session your agent starts subagents with the server’s tools, such as start_agent and wait_for_agents; until then it uses the microdev tasks commands, which do the same work.

The setup touches one more file per agent, outside your project: it writes a short block into Claude Code’s own ~/.claude/CLAUDE.md (in $CLAUDE_CONFIG_DIR when that is set) and Codex’s own ~/.codex/AGENTS.md (in $CODEX_HOME when that is set), telling your agent to start MicroDev subagents when you ask for parallel, background or long-running work. Your agent reads that file in every project on this computer, so a new folder needs no setup of its own. Cursor keeps its user rules in its settings rather than a file, so the setup writes none for it. The block sits between a <!-- microdev:begin line and a <!-- microdev:end --> line, and text outside them is never touched. To remove it, delete those lines and everything between them; running microdev init again writes it back. Older versions wrote the block into the project’s CLAUDE.md or AGENTS.md; running microdev init there takes it out again.

By hand

To install the CLI and try a task yourself, without an agent:

The CLI runs on macOS and Linux, on Intel/AMD 64-bit and ARM64. It needs OpenSSH to connect, and uses its own SSH key, ~/.config/microdev/id_ed25519, created on first use; --key PATH.pub names another. On Windows, install the Linux CLI inside WSL2. Behind a firewall, see the network requirements.

  1. Install

    Your terminal
    curl -fsSL https://microdev.dev/install.sh -o install-microdev.shsh install-microdev.shexport PATH="$HOME/.local/bin:$PATH"

    The installer verifies a SHA-256 checksum fetched over HTTPS, then installs to ~/.local/bin. It needs no administrator privileges and does not change your shell startup files. Pass --bin-dir /absolute/path to install elsewhere or --version VERSION to pin a release. You can read the installer before running it.

    The CLI keeps itself current. At most once every hour, when microdev init, microdev tasks or the MCP server runs, it asks the site which release is latest and, if that is newer, installs it in the background as the installer does, checksum verified, over ~/.local/bin/microdev. No command waits for it. A release that does not run on your computer is never installed, and a version is never replaced by an older one. A running MCP server keeps its version until its session ends, says once that a newer one is installed, and the next session starts on it. If an update fails, microdev init says why and the next one tries again; installing again also gets the latest. A copy installed elsewhere with --bin-dir is not updated: that is how to keep a release you pinned with --version, which in ~/.local/bin is current again within the hour.

  2. Sign in

    Your terminal
    microdev login

    login opens GitHub's sign-in in your browser and returns to the CLI when you approve; the URL is printed in case the browser does not open. With --no-browser, over SSH or with no terminal, it prints a device code to enter in any browser instead. Your personal organization is selected automatically. A browser sign-in also saves this computer's MicroDev SSH key to your profile, named after the computer, so tasks you start on the website accept it; after a device code it asks first at a terminal and otherwise saves nothing. microdev keys lists saved keys and microdev keys remove FINGERPRINT removes one. The trial needs no card.

  3. Start the demo

    Your terminal
    microdev demo

    demo starts a private, isolated task from the public microdev-dev/microdev-demo sample and connects you to it. The sample is public, so it needs no Git credentials, and the CLI never offers yours to it.

  4. Run the tests inside the task

    Inside the task
    cd ~/workspacecargo test

    Edit the sample freely. You can't push to the sample; push your changes to your own repository. The sample's README walks through a first change.

How your agent runs subagents

Your agent runs subagents with the microdev tasks commands, the same way from your computer, in a Git checkout, and from inside a task. Nothing needs configuring beyond the quickstart. Ask in plain words:

Fix the flaky test in a subagent while you keep going.
  1. Your agent starts it

    Your agent starts it with a prompt that stands on its own, tells you its name and goes back to its own work. On your computer the subagent starts from the folder as it is; inside a task it starts from the latest commit, so the agent there commits first. On your computer it learns this from the MicroDev skill; inside a task, every agent has the built-in microdev-tasks skill.

  2. It appears in your task list

    microdev list shows it. One started from inside a task names that task in the FROM column.

  3. Watch it or take over

    Run microdev attach ID to see its agent working. If the agent hasn't started yet, attach waits up to 20 minutes, checking every 10 seconds, and connects once it does. From then on it is an ordinary task: type to its agent, review it, pause it or delete it.

What a subagent gets

  • Started on your computer: your project as it is in the folder, on branch task/NAME, with uncommitted and untracked work and without what .gitignore excludes. Started inside a task: the same repository from that agent’s latest commit, so it commits first.
  • Your Git connection and agent connections. The agent's account must be connected first.
  • Its own VM. By default, the same agent as the one that started it, on that agent's default model.

Starting from your folder

No GitHub App needed. Your subagents start from the folder on your computer, uncommitted work included (up to 100 MB of it), and hand their work back as a branch. The folder must be a Git repository; if it is not, run git init first. It needs no GitHub remote, and gh is not used.

  • Untracked files come along too. Past 5,000 untracked files or 100 MB of uncommitted and untracked work, the start is refused and says what to add to .gitignore.
  • The first subagent you start from a folder sets the project up, building its dev container if it has one, and once that setup works it is saved for you. Your next subagents from that folder start from the saved setup and run only their own step. A changed setup recipe is saved again, and a setup that fails is not kept. Nobody else starts from your saved setup. In a recorded run, a Node project whose setup installs 264 npm packages and builds TypeScript was ready in 3.1 s and 4.0 s from its saved setup, against 8.6 to 14 s without it, on a host that was already running. The start that saves does not stop for it: its disk is copied in place and uploaded while its agent works.
  • Its work comes back as the branch task/NAME: only the subagent’s own commits, on the commit you were on. Your agent brings it in with one call, microdev tasks merge NAME, which merges the branch into your current branch and keeps your uncommitted and untracked files as they are, uncommitted: they never enter your history.
  • Where the subagent built on an edit you had not committed, that file holds the subagent’s version, your edit included. Where your edit and the subagent’s change the same lines, the file holds both with Git’s conflict markers, and git stash keeps your copy from before the merge. When the merged code uses a file you never committed, the answer names it and your agent asks before committing it.
  • The MicroDev GitHub App is optional. Added to a repository, read-only, it lets MicroDev keep a build cache for it, which a subagent uses when it clones that repository from GitHub instead of copying your folder.
  • A private repository needs no Git credential step, because the code comes from your folder.

How results come back

When a subagent finishes or gets stuck, it writes a short report, and microdev tasks status shows it ready. Claude Code, as the built-in skill tells it, waits in the background and is woken then: it reads the report, reviews the work and merges the task/NAME branch. Inside a task, the waiting task is not paused for being idle. Codex and Pi don't wait in the background: when it shows ready, ask your agent to check on the subagent by name. A subagent pauses itself when idle, like any task, and stays in your task list until you delete it.

Subagents that message each other

Give subagents a tag when you start them, and the ones that share a tag can message each other. Your agent sets the tags when it starts them: tags on start_agent, or --tag on microdev tasks spawn. A subagent takes up to eight tags, each lowercase words joined by hyphens.

message_agents
The MCP tool: your agent sends one message to every subagent of yours that carries a tag. From a terminal it is microdev tasks send --tag TAG -- MESSAGE.
microdev peers
Inside a subagent: lists the subagents that share a tag with it, and whether each is running or paused.
microdev peers send NAME -- MESSAGE
Inside a subagent: messages one of them by name.
microdev peers send --tag TAG -- MESSAGE
Inside a subagent: messages every one that carries TAG.
  • A message reaches a running subagent’s agent in about 15 seconds, typed into its session, once. It arrives with the sender’s name and the command that replies.
  • Subagents without a shared tag cannot see or message each other.
  • Subagents cannot see each other’s commits, so a message carries what the other needs to build against, such as an interface, and each one’s work comes back to you on its own branch.
  • A paused subagent is not woken by such a message: it gets it when your agent next opens it, within 24 hours. To reach a paused subagent right away, your agent uses message_agent or microdev tasks send NAME MESSAGE, which resume it.
  • The sender is told when a subagent is not taking messages now. Nothing reports that a message was read, and nothing keeps past messages.

MCP tools

What your agent calls once the MCP server is registered, and what each answers. Every answer is short sentences meant to be passed on to you, with the same facts as JSON.

start_agent
Starts a subagent on a prompt, from this folder as it is, uncommitted and untracked files included, on its own branch task/NAME. It answers within seconds while the microVM keeps starting, names the branch and says that the subagent’s own commits come back on it without your uncommitted and untracked files.
list_agents
Every subagent started from this folder, one sentence each: starting, working, ready, needs attention, paused or failed, its report’s first line, and merged once its branch has been fetched: whether your current branch already holds its commits, by merge, rebase or cherry-pick.
wait_for_agents
Waits up to 40 seconds for the subagents to be done, need attention or stop; done: false means call it again or carry on. A Claude Code or Codex subagent counts as ready at the end of its agent’s turn.
get_agent
One subagent’s report, the end of its terminal and its commits. It fetches task/NAME into this folder and names merge_agent, the call that brings it in, or says the branch is already merged into your current branch.
message_agent
Types a message to the subagent’s agent, as you would, resuming it first when it is paused.
message_agents
Sends one message to every subagent of yours that carries a tag. It never resumes a paused one.
pause_agent
Pauses it: its work is saved and it stops using agent-hours. message_agent or resume_agent bring it back.
resume_agent
Resumes a paused subagent and reopens its agent’s conversation.
delete_agent
Deletes the subagent and its microVM, fetching its branch first; task/NAME stays in this folder.
merge_agent
Merges task/NAME into your current branch, for one subagent or several in order, and keeps your uncommitted and untracked work uncommitted. It says what was merged, what became of your uncommitted work and what is left; at a conflict it says how to finish, and a second call says already merged.
account
What is set up and what is left: the sign-in, this folder, the connected agent accounts, the trial or plan, the agent-hours used this month (and their cost on a paid plan), and the monthly budget with the command that sets it, microdev budget HOURS.

When a subagent’s setup fails, list_agents, wait_for_agents and get_agent carry setup: the step that failed and the file it comes from, such as postCreateCommand in .devcontainer/devcontainer.json, the command, its last lines of output and what to do. The subagent keeps working either way.

Commands

You rarely type these yourself; your agent runs them, and microdev tasks help prints them with the whole guide. Every command prints short sentences meant to be passed on to you, and takes --json.

microdev tasks spawn NAME -- PROMPT
Starts a subagent on PROMPT: from the folder as it is on your computer, from the latest commit inside a task. It returns in a few seconds, once MicroDev has accepted the subagent, which keeps starting on its own. On a host that is already running, a subagent is set up in seconds (3 to 14 s in our recorded runs), and a Claude Code subagent wrote its first line 12 to 18 s after its start. When a new host has to launch for it, the start takes about 90 s (94 s in the same runs). An emptied host stays up 10 minutes for your next subagents. --agent and --model override the defaults.
microdev tasks status [NAME]
Each started task's state, its agent's state and the first line of its report.
microdev tasks wait [NAME…]
Blocks until a started task is ready, needs your attention, exits, fails or pauses, or for an hour at most. A task it sees finish has its report kept and its branch fetched, so reading them later needs no resume. --any returns when the first one does.
microdev tasks read NAME
The report, the end of the agent's terminal, and the task/NAME branch with a summary of its changes.
microdev tasks send NAME MESSAGE
Types a message to the task's agent, resuming the task first if it is paused. It won't type while you are typing there.
microdev tasks pause NAME
Pauses the task.

Limits and safety

  • One level: a subagent cannot start subagents of its own.
  • Subagents use your agent-hours like any other task.
  • A checkout holds up to 16 subagents at a time, finished ones included until you delete them with microdev delete ID.
  • The MCP tools and microdev tasks act only on the subagents started from that checkout: start, check on, message, pause, resume and delete them. They never pause, change or delete your other tasks.
  • The prompt never reaches MicroDev's service. Until the new task's agent has it, it waits in .microdev-tasks/children.json on the starting task's disk (.git/microdev-tasks/children.json in the checkout's Git directory when you start it from your computer); after that only a hash of it stays there. In the new task it waits in .microdev-terminal/md-TERMINAL/prompt in the workspace (TERMINAL is the agent terminal's ID) until its agent starts, and is then removed, or emptied where it cannot be removed. The agents' transcripts keep it on each task's disk, which is saved with the task.

Troubleshooting

This task can't start or manage tasks right now
The task has no permission to start tasks. Run microdev attach ID on your computer, then ask again. microdev resume only starts the task and does not give it permission.
A refusal
Your agent passes on MicroDev's message as is, such as trial time that has run out or a guardrail your organization set. Agents never pause or change your other tasks.
NAME didn't start: …
The task was created but its agent wasn't launched, so MicroDev paused it; the message says what failed. Fix the cause, such as connecting the agent's account, and ask again: a new spawn starts a new task. Delete the paused one when you no longer need it.

Pause and resume

Every task has an ID. These commands take it where it says ID.

microdev list
Lists your tasks with their IDs and states.
microdev status ID
Shows the state of one task. If setup failed, it names the step (the repository clone, the dotfiles clone, the dotfiles init.sh or the task configuration) and whether it failed or timed out; otherwise it shows the task's own error.
microdev pause ID
Waits until the workspace is saved, then releases the compute.
microdev resume ID
Resumes a paused task or retries failed setup without opening a shell.
microdev ssh ID
Resumes the task first if it is paused, then opens a shell as soon as SSH is reachable, even if setup failed. It does not connect Git or retry failed setup. OpenSSH verifies the host key.
microdev attach ID
Resumes the task if paused, completes setup, then opens the agent's terminal.
microdev trial
Shows your remaining trial allowance.
microdev delete ID
Deletes the subagent. Its saved work is removed a day later; a record of its usage is kept.

Leaving SSH does not pause the task. exit disconnects your terminal and the task keeps running, so run microdev pause ID when you are done, or let auto-stop do it.

What persists

Every resume boots a fresh root filesystem around your saved work. The workspace and the agent state needed to continue come back; everything else is rebuilt from configuration.

Preserved

  • The whole workspace in ~/workspace, byte for byte: every branch, stash and commit, and staged, uncommitted, untracked and ignored files
  • Repository-local Git settings
  • Codex, Claude Code and Pi sign-in, session history and settings files
  • The task's Git credentials
  • What your repository's setup installed: the tool homes and caches of a detected setup in ~/.microdev-env (toolchains, Cargo, npm, Go and similar), and a dev container's images, containers and volumes
  • In a task that started from a base, ~/.microdev-prebuild, which records the base it started from
  • MicroDev's records of the setup applied in the task and of the tasks it started (~/.microdev-setup, ~/.microdev-tasks)

Rebuilt on resume

  • The root filesystem: a fresh copy of the pinned system image, checked against its published SHA-256 digests
  • System packages you installed, other home-directory files, shell history and global Git settings
  • Your dotfiles, cloned fresh, and environment variables; organization variables are delivered again with their current values
  • Agent logs, general caches and other agent files outside the kept list, running processes, tmux sessions, open connections and unsaved editor buffers

Keep task notes and any custom durable state inside ~/workspace, and save editor buffers before pausing. Resume never fetches, resets, cleans or checks out your workspace. MicroDev changes the checkout only before the task holds any work of yours: over the built tree in a task started from a base, and onto task/NAME in a task another task started. Agent logs, general caches and other agent files outside the kept list are cleared on every resume; sign-in, session history and settings files are kept.

Dotfiles

Point MicroDev at a dotfiles repository that contains init.sh. It is cloned fresh and init.sh runs as dev in ~/.dotfiles, with HOME=/home/dev, when a task is created and on every resume. Failures and timeouts appear in microdev status.

Your terminal
microdev dotfiles your-org/dotfiles

After fixing your dotfiles, microdev resume ID retries setup, even on a running task and even when the repository clones without Git credentials. Write init.sh so it is safe to run again: a retry after failed setup can repeat work that partly finished.

init.sh
#!/bin/shset -eu# Link rather than append, so a second run changes nothing.ln -sf "$HOME/.dotfiles/gitconfig" "$HOME/.gitconfig"

Auto-stop

A task pauses itself after 15 idle minutes, even with your agent open and your terminal attached. Idle means that in every minute of the window its processes used less than 2% of one vCPU, it moved data at 32 bytes a second or more for less than half of the minute (packet headers and your SSH sessions into the task excluded), nobody typed in its terminal, and no agent transcript changed. An agent waiting at its prompt, its own background refreshes (Codex checks its rate limits once a minute) and an attached terminal nobody types into are quiet, so a finished agent's task pauses; the pause keeps the workspace and agent sessions.

Work counts even when it writes nothing: a build or test run spends CPU, and a download or a streamed model response keeps moving bytes, so an agent waiting on a long test suite is not mistaken for an idle one. What a rate cannot see is a tool that only sleeps or polls now and then, with no CPU and less than half of each minute on the network: it is paused like a finished agent. Missing activity data resets the idle window rather than pausing the task.

Agents that keep sessions somewhere else can report them. Write absolute paths to this file from your dotfiles hook:

~/.config/microdev/transcript-paths.json
["/home/dev/workspace/.agent-sessions"]

The CLI has no setting for the delay: tasks use the default, 15 minutes.

On the trial, a task also pauses when the trial's running time is used up. Activity does not extend it.

Build cache

A base is a built copy of a branch's workspace that your organization keeps for every member. A new task starts from its branch's base instead of an empty disk: it skips the clone, the dependency downloads and the first build, and checks out its own ref over the built tree, so its first build compiles only what changed. Bases need no setup beyond a repository registered to the organization; what a build runs is the repository's own setup (its .devcontainer/devcontainer.json, or what MicroDev detects).

Your terminal
microdev setup show acme/servicemicrodev start acme/service --ref feature/x# Its Ready line names the base, for example:# Ready in … · feature/x on main@a1b2c3d (built 38 min ago) · small

Which base a task starts from

  • A task starts from its branch's base, else the default branch's, else cold, and microdev start says which in its Ready line. --cold starts from an empty workspace even when a base is ready; create and demo take it too.
  • The default branch has a base, and so does each branch its devcontainer.json lists in customizations.microdev.branches (at most 20).
  • Files the checkout leaves alone keep their modification times, so Cargo, Make, Gradle, Go and other tools that compare them rebuild only what differs between the base's commit and your ref. After that first checkout the task is an ordinary task: no later resume touches the workspace, and a newer base never changes it. microdev status ID --json shows source and base.
  • A base belongs to the GitHub repository it was built from. A repository that takes over a name another one had (a deleted repository's name reused, or a rename onto it) never starts from the earlier repository's bases: it starts cold and builds its own. When a repository leaves the organization's GitHub App installation, or the installation is suspended or removed, its bases are deleted no sooner than 15 minutes after MicroDev first reads it as gone; a task already started from one keeps its files.

How a base is built

The organization builds bases, not a member: nightly at 2:00 UTC, 10 minutes after the first push to a branch it builds that the base does not have yet, when a task finds the repository's setup has changed, for the first task on a repository with no base yet, and when someone runs microdev setup build. Push and nightly builds skip an organization nobody has started or resumed a task in for 14 days. A build starts in a fresh VM from a fresh clone of the branch's head, made with a read-only token for that one repository, runs the setup's build steps with the organization's build-stage variables, and searches every file it changed for the value of every build secret. A fresh VM then restores the result and runs the task steps with the task-stage variables, as your task would; only then is it published. A build may take 3 hours and its verification 60 minutes.

microdev setup show OWNER/REPO
Each branch's base, its last build and why it failed (with the end of its output), and every kept base with its ID. Takes --json. microdev setup show [DIR] shows, offline, the setup a checkout runs.
microdev setup build OWNER/REPO [--branch BRANCH]
Builds now. A running build is never cancelled; this queues one follow-up. A build that cannot start yet is queued and starts on its own. With --json it prints {"build": …} or {"queued": {…, "waiting": …}}, where waiting is room, organization_limit or scheduled.
microdev setup pin OWNER/REPO --branch BRANCH --base ID
Owners and admins: start the branch's new tasks from one of its good bases rather than the newest. setup unpin undoes it.
microdev repos
The repositories registered to your organizations, which can have bases.

When a build fails

A failed build never replaces the base: tasks keep starting from the last good one, and each branch keeps 3 good bases and a pin. After 3 failures in a row, push and nightly builds of the branch pause until someone runs microdev setup build. A base that contains the value of a build secret of 8 bytes or more is refused, naming the variable, never its value.

the build secret NAME was found on disk in PATH
Ending “was found on disk outside any file”, a file name, a link or an attribute holds it. A build step wrote a build-stage secret where the base keeps it. Write credentials in your home directory outside ~/workspace, the ~/.microdev-* directories and the agents' ~/.codex, ~/.claude and ~/.pi, as the recipes below do.
Killed, or exit code 137
The build ran out of memory. Run fewer jobs at once (tips below), or ask for a larger size in hostRequirements.
No space left on device
The base must fit the task's 32 GiB workspace disk.

Cost and limits

Builds run at the size the default branch's devcontainer.json hostRequirements asks for, as its last fresh task or build recorded it, capped at the organization's largest size; until one has, small (2 vCPUs and 4 GiB). They run on the organization's behalf, and the admin console lists them as Organization build. On the trial they use no trial minutes, and at most 2 run at once.

Tips

Keep caches where the base keeps them. Unless your devcontainer.json defines a container (an image, a Dockerfile or a compose file), MicroDev already points Cargo, rustup, npm, pnpm, Yarn, Go, uv, Bundler and mise into ~/.microdev-env, which every base and pause keeps, and those settings win over organization variables of the same names: there is nothing to set, and microdev env set says so when you set one of them. With a container, point tool caches into the workspace, keep them out of Git with .git/info/exclude, and set them as organization variables for both stages. Organization variables are used as written, never expanded, so give absolute paths inside the container: its workspace is /workspaces/workspace for an image or a Dockerfile and / for a compose file, unless workspaceFolder names another.

With a container:

Rust
target/ is already in the workspace. Set CARGO_HOME and RUSTUP_HOME to directories in it too, so the registry, the toolchain and installed tools come back.
Node
node_modules/ is already in the workspace. Set NPM_CONFIG_CACHE for npm, which reads its npm_config_ settings in any case (organization variable names are uppercase), and YARN_CACHE_FOLDER with YARN_ENABLE_GLOBAL_CACHE=false for Yarn 4.
Go
Set GOMODCACHE and GOCACHE to directories in the workspace, for example /workspaces/workspace/.cache/go-mod and /workspaces/workspace/.cache/go-build.

Size parallelism for memory. Build tools start one job per CPU by default, and a large build can exhaust a small task's 4 GiB. Start with CARGO_BUILD_JOBS=1 or 2 for a large Rust workspace, GOFLAGS=-p=2 for Go, NODE_OPTIONS=--max-old-space-size=1536 for Node, and org.gradle.workers.max=2 for Gradle.

Build what your agents run first. A build step such as cargo build --workspace --tests also builds the test binaries, so the first cargo test is warm. Likewise npm ci && npm run build, go build ./... && go test -run '^$' ./... or ./gradlew assemble testClasses.

Cost

MicroDev meters running time in agent-hours: one subagent with 2 vCPUs running for one hour. A paused subagent uses none.

  • The trial is 5 agent-hours over 14 days, with no card.
  • After it, pay as you go is $0.10 per agent-hour, with no monthly fee. Pricing has the plans.
  • A subagent pauses after 15 idle minutes (auto-stop), and your agent pauses one it has finished with.
  • Model usage is billed by your model provider, not by MicroDev.
  • microdev trial shows what is left of the trial. Billing from the CLI covers paid plans.

The free trial

New accounts get 5 agent-hours (300 minutes) of running time, for 14 days from your first launch, with as many tasks running at once as you need. No card is collected and the trial never turns into a paid plan on its own.

The minutes are shared by all your trial tasks, and there is no limit per run. A task uses them only while it runs, including time spent waiting on tools and models; paused time is free. An attempt that fails before it starts uses no time. When the time or the window runs out, running tasks pause with their work preserved. Trial work is kept for 30 days after the trial ends.

Your terminal
microdev trial

Out of time? Choose a plan for your organization, or ask for manual pilot access.

Your repository

Subagents your agent starts from the folder on your computer need none of this section.

A public repository needs nothing more. A private one clones with your computer's Git credentials: sign in to GitHub with gh auth login or your configured Git credential helper, including the macOS Keychain.

Your terminal
microdev start OWNER/REPO

HTTPS and SSH GitHub clone URLs work in place of OWNER/REPO.

Registering a repository

The MicroDev GitHub App is optional. Added to a repository, read-only, it lets MicroDev keep a build cache for it, which a subagent uses when it clones that repository from GitHub instead of copying your folder.

A registered repository gets bases its organization's tasks start from. MicroDev builds them through its GitHub App, so nobody's credentials reach a build; your own tasks still clone and fetch with the Git credentials you give them. Add repositories installs the MicroDev GitHub App on the GitHub account that owns them, and that account decides where they register:

  • On your personal GitHub account, they register to your personal organization. Only you can install it there.
  • On a GitHub organization, they register to the MicroDev team connected to it, and an owner or admin of that team installs it.

A repository on a personal account belongs to that person's personal organization, so a team works on repositories in a GitHub organization. To share a personal repository with a team, transfer it to a GitHub organization connected to the team; GitHub redirects its old address. microdev repos lists the repositories registered to your organizations, and microdev start on one runs in its organization.

microdev start
Uses the current checkout's GitHub origin. With no origin, or outside a Git checkout, it starts the demo; an origin that is not on GitHub is refused, naming its host when it has one, and nothing is created.
--ref BRANCH
Starts on a branch or tag.
--no-connect
Creates the task and prints the next command without opening SSH.
--key PATH.pub
Uses an existing public key for the new task.
--forward-agent
Forwards your SSH agent into the shell or agent terminal start opens; ssh and attach take it too. Off unless you ask for it.

Git credentials

If your computer is signed in to GitHub, the first time you use a project the CLI asks you to confirm the GitHub account and repository. It then hands your computer's credentials to the task over verified SSH, before the first clone. You confirm once per project: every later task and resume on it gets the credential you connected, whatever your shell holds then. microdev git connect OWNER/REPO gives it without a question, before any task, so a coding agent or a script with no terminal can start tasks unattended. Your dotfiles repository is a project of its own: private dotfiles need consent even when the repository is public. With no terminal, a start whose private repository or dotfiles are not connected stops before creating anything and names the command to run, when your computer has GitHub credentials to offer. Without any, the CLI asks GitHub signed out: a repository GitHub does not show (private, missing or misspelled) stops before anything is created. Only when GitHub does not answer is the task created; if its clone is then refused, the start stops naming microdev git connect ID; sign in with gh auth login, run it, and setup finishes on its own. The task waits 10 minutes for that, then pauses; once it has paused, run microdev resume ID as well. A public repository clones anonymously instead; the agent starts as usual, and agents can push once you run microdev git connect OWNER/REPO. With no terminal to ask, a resume never stops for consent: a task keeps the Git credentials it already has, so an agent can keep working after your laptop disconnects. At a terminal, a resume asks once about a project you have not decided on yet. For a task started from the browser, run microdev git connect ID, then microdev resume ID to complete private setup. git connect ID connects the task's repository and dotfiles; on a paused task it saves consent without resuming it, and on a running task it hands the credentials over right away. Once you've connected Git, your task can push branches with your credential. Nothing pushes on its own: your agent does. Connecting saves the credential your computer has at that moment, and tasks get that one: after you sign in to GitHub again, or as another account, git connect again to use the new one; microdev git disconnect ID or OWNER/REPO removes the connection. Git credentials stay on your computer and in the tasks that use them; MicroDev's servers do not keep them. Disconnecting removes them from your computer and from running tasks; a paused task applies the removal the next time you connect to it. To invalidate every copy at once, revoke the token at GitHub.

Coding agents

Every task image includes the Codex, Claude Code and Pi CLIs, pinned, alongside Ubuntu 24.04, Git, SSH, Python, Node, compilers, tmux and ripgrep. Start one on a prompt when you create the task:

Your terminal
microdev start OWNER/REPO --agent codex --prompt "Fix the flaky retry test"microdev start OWNER/REPO --agent claude --prompt-file task.md --jsonmicrodev attach ID
--agent codex|claude|pi|custom
Starts that agent in a tmux session in the task's ~/workspace. custom is your own harness (below). Unless you pass --json or --no-connect, the CLI attaches your terminal; detach with Ctrl-b d and the agent keeps working.
--prompt TEXT
The agent's first instruction. --prompt-file PATH reads it from a file (at most 32 KiB). Without either, the agent waits for input.
microdev attach ID
Reopens the agent this computer started in the task: it resumes a paused task and continues that agent's most recent conversation, with no picker. If Claude has no conversation yet, it opens fresh. For any other task, --agent codex|claude|pi|custom opens that agent fresh.

Connect each agent account once and every agent the CLI starts or reopens in a task (microdev start, microdev attach) starts signed in; a task started on the website or reached with microdev ssh gets your connections when microdev attach opens its agent. Codex uses your ChatGPT plan through microdev codex connect, which runs Codex's own login on your computer, so it needs Codex installed there (the first --agent codex start asks for it); Codex tasks then work without you. Claude Code uses your Claude Pro or Max plan: microdev agent connect claude runs Claude Code’s own sign-in on your computer, so it needs Claude Code installed there, and one approval in your browser connects it; nothing to copy. microdev init runs it as its last step. The token Claude Code issues is kept in ~/.config/microdev/claude-plan.json on your computer, readable only by you; MicroDev’s servers do not store it, and microdev agent disconnect claude deletes it. An Anthropic API key works too: microdev agent connect claude - reads it from standard input. Pi reuses a login you make once with /login in any task: microdev agent reuse pi-codex|pi-copilot|pi-keys ID. MicroDev then writes that login's access token, or the API keys, in plain text into ~/.pi/agent/auth.json in each Pi task that uses that connection, the next time the CLI starts or reopens Pi in that task; that file is saved with the task. Without a connection, run microdev attach ID and follow the agent's login in that task. You can also run codex, claude or pi yourself from microdev ssh ID.

Your own agent

--agent custom runs any harness: the executable your task registers at ~/.config/microdev/custom-agent. MicroDev runs it in ~/workspace as custom-agent start PROMPT for a new task with a prompt, custom-agent open without one and custom-agent resume after a pause, with MICRODEV_MODEL set for start and open when the task chose a model. Register it, and install the harness, from your dotfiles init.sh:

init.sh
mkdir -p ~/.config/microdevcat > ~/.config/microdev/custom-agent <<'EOF'#!/bin/shcase "$1" in  start) exec opencode --prompt "$2" ;;  resume) exec opencode --continue ;;  *) exec opencode ;;esacEOFchmod +x ~/.config/microdev/custom-agent

Keep its sessions inside ~/workspace so they survive a pause, and list them in ~/.config/microdev/transcript-paths.json so its work keeps the task awake.

Claude Code runs with permission prompts off, like Codex. Pi never asks for tool approval. The task's VM is the boundary.

Model inference runs with the model provider. The agent, your builds and your tools run in the task. Model usage comes from your agent account and is not part of MicroDev compute.

In the home directory, a pause keeps only ~/workspace, MicroDev's own ~/.microdev-* directories, and the sign-in, session history and settings files of ~/.codex, ~/.claude and ~/.pi/agent. Nothing else there is kept, files you place in ~/.agents for example: set those up from your dotfiles, which run again on every resume (the full list, and dotfiles). Keyring credentials and environment variables you set in the task do not; organization variables are delivered again on every resume. After a resume, microdev attach ID continues the most recent conversation of the agent this computer started.

Scripts and automation

--json works with list, status, create, start, demo, pause, resume and trial. With --json, start and demo never open a shell. create OWNER/REPO is the same as start OWNER/REPO --no-connect.

start --agent … --json returns as soon as the agent is running and adds an agent field, {"name": "codex", "terminal": "UUID"}. In status --json, a failed setup carries guest.setup_failure: a stage of repository, dotfiles, dotfiles_init or task_configuration, and an outcome of failed or timed_out.

Pass --request-id UUID to make creation idempotent: retrying with the same ID returns the same task instead of starting another, and never sends its prompt twice. Rerunning the same start command (same --request-id) is always safe: it resumes a paused task, finishes setup, and starts the agent once. If the agent already got the prompt, it reopens the agent instead. The CLI prints the request ID and task ID before it waits, then reports each change in setup, and repeats the current step every 30 seconds. If setup is interrupted, inspect the task with microdev status ID.

Your terminal
request=$(uuidgen)microdev create OWNER/REPO --json --request-id "$request"# After a timeout, the same command finds the same task.microdev create OWNER/REPO --json --request-id "$request"
MICRODEV_CONFIG_DIR
Uses a different configuration directory, given as an absolute path. Useful for a separate CI identity.
--org UUID
Runs one command in another organization without changing the saved choice; with login --oidc it also becomes your choice.

README badge

Add an Open in MicroDev badge to a repository's README. It carries the repository through GitHub sign-in into the new-task form. The person still chooses repository access and starts the task themselves, so the link itself starts no compute.

Open in MicroDev
README.md
[![Open in MicroDev](https://microdev.dev/open-in-microdev.svg)](https://microdev.dev/start?repository=OWNER/REPO)

Replace OWNER/REPO with your repository. The hint stays in that browser tab for up to an hour. Try it with the sample repository.

Network requirements

Behind a firewall or a proxy, allow these outbound TCP connections. Everything but SSH is HTTPS. A command that cannot connect while this site loads in your browser usually means a port other than 443 is blocked.

microdev.dev:443
This site, the installer and CLI downloads, and the configuration the CLI reads before billing commands.
microdev.dev:4443
Tasks: every command that starts, lists, pauses or resumes one.
identity.microdev.dev:4444
Sign-in, accounts and organizations. microdev login opens it in your browser too.
billing.microdev.dev:4445
microdev billing commands.
ports 22000–22063
SSH into tasks. A task runs on a host whose address changes from task to task, so allow the range to any address; microdev status ID --json shows one task's ssh.host and ssh.port.
github.com, api.github.com:443
GitHub sign-in, and the CLI checking a repository and your account when it connects Git credentials. Codex and Claude Code sign-ins reach their own providers.

Build caches and organization variables

Organization variables and secrets are environment variables an owner or admin sets once for the organization's tasks, the builds of its bases, or both. Use them to point sccache, Bazel, Gradle, Turborepo or ccache at the remote build cache your team already runs: the builds of bases fill it and every task reads it, without a credential on a laptop, in a repository or in a saved workspace.

Variables and secrets

  • A variable is plain: members of the organization can read its value.
  • A secret is write-only: no command, page or API shows its value again, to anyone, you included. You can replace or delete it. The list shows when it was last set and by whom.
  • Each applies to every repository, or to the repositories it names, up to 20. A task receives the ones that apply to its repository.
  • Each has stages: task (the default) reaches tasks and the fresh VM that verifies a base; build reaches only the builds of bases, never a task, so write-capable credentials belong there.
  • Both are stored encrypted. They travel to a task's host only when the task starts or resumes, and the task keeps them in /run/microdev/variables.sh, in memory. They are never written to its disk, so they are never in a saved workspace, a base, a log or a metric.

Where tasks see them

Every activation of every task in the organization receives the variables that apply: tasks started from the CLI, the browser or another task's agent, and resumes with nothing attached; builds receive the build-stage ones. They are set for init.sh, repository setup steps, login shells, microdev ssh and SSH commands and the agent's terminal. Values are used as written: MicroDev never expands $HOME or any other reference in them.

  • Changes apply at each task's next activation: a new task or a resume. A running task keeps the values it started with, so pause and resume it to pick up a change.
  • Who can see what. Owners and admins set variables; members list names, repositories and plain values. Your organization's access policy can change these permissions. Inside a task, every value that applies is readable, secrets included, by the person who started it and by their agent: a build tool can only use a credential it can read. Give tasks credentials that can only read the cache, as below. An agent cannot list or change variables or bases with the task's own credential, even in a task it started.

Set them from the CLI

Your terminal
microdev env set SCCACHE_BUCKET=acme-build-cache --stage build,taskmicrodev env set RUSTC_WRAPPER=sccache --repo acme/service --repo acme/tools --stage build,taskmicrodev env set --secret AWS_SECRET_ACCESS_KEY < reader-secret-key.txtmicrodev env set --secret CACHE_WRITE_AWS_SECRET_ACCESS_KEY --stage build < writer-secret-key.txtmicrodev env listmicrodev env unset CACHE_WRITE_AWS_SECRET_ACCESS_KEY

env set prints what the variable now applies to, for example AWS_SECRET_ACCESS_KEY (secret) · applies to all repositories · stages task.

microdev env list
Every variable and secret: its name, its kind, its repositories, its stages and plain values. --json adds who changed it and when.
microdev env set NAME=VALUE
Sets a plain variable, replacing a plain variable of that name; to make a secret plain, unset it first. Each --repo OWNER/REPO limits it to that repository; --all-repos applies it to every repository and cannot be combined with --repo. With neither, a new variable applies to every repository and an existing one keeps its repositories.
microdev env set --secret NAME
Sets a secret from standard input, or from --file PATH, never from the command line, so the value stays out of shell history and process lists. It refuses to read a terminal, so pipe the value in, as in pbpaste | microdev env set --secret NAME. Exactly one trailing newline (\n or \r\n) is removed; anything else is kept as written. Takes --repo and --all-repos like a variable.
--stage task|build|build,task
Which environments receive it: tasks (the default for a new variable), builds of bases only, or both. Without --stage an existing variable keeps its stages.
microdev env unset NAME
Deletes the variable or secret. Tasks stop receiving it at their next activation.

Setting a name replaces its value; --secret can turn a variable into a secret, never the reverse. Its repositories change only when you pass --repo or --all-repos, so replacing a secret's value never makes it reach more repositories. --org UUID runs one command in another organization, and microdev org use UUID saves the choice. In the browser, owners and admins manage the same list at Admin → Variables.

Names and limits

  • A name is uppercase letters, digits and underscores, starts with a letter or an underscore, and has at most 128 characters. Names that would change how bash or MicroDev runs a task's commands are refused: HOME, PATH, SHELL, USER, LD_* and MICRODEV_*, plus bash's own special variables such as IFS, UID and PWD. Names that only change how something looks or that programs read as a preference, such as PS1, LANG and TZ, are allowed.
    All 52 reserved names

    HOME PATH SHELL USER LOGNAME PWD OLDPWD BASH_ENV ENV BASHOPTS BASH_VERSINFO EUID PPID SHELLOPTS UID IFS PS4 CDPATH GLOBIGNORE EXECIGNORE POSIXLY_CORRECT BASH_COMPAT BASH_XTRACEFD FUNCNEST OPTIND OPTERR TMOUT PROMPT_COMMAND _ BASHPID BASH_ALIASES BASH_ARGC BASH_ARGV BASH_ARGV0 BASH_CMDS BASH_COMMAND BASH_LINENO BASH_MONOSECONDS BASH_REMATCH BASH_SOURCE BASH_SUBSHELL DIRSTACK EPOCHREALTIME EPOCHSECONDS FUNCNAME GROUPS HISTCMD LINENO PIPESTATUS RANDOM SECONDS SRANDOM

    And every name that starts with LD_ or MICRODEV_.

  • At most 100 variables and secrets per organization, 16 KiB per value, 20 repositories per variable, and 64 KiB for all the variables that apply to one task.

Tasks read the cache, builds of bases write it

Anything a task can write to a shared cache, every later task and base build will run. A cache hit is used as it is, without compiling the source again, so an entry written from an agent's half-finished change, or from code a prompt injection steered it to, ends up in every teammate's build that hits it. An agent can read every value its task receives, so the only cache credential safe to give a task is one that cannot write.

So every recipe below uses two credentials. Tasks hold a read-only one, under the name the tool reads. The one that writes is a build-stage secret under a name of its own, starting CACHE_WRITE_, which only the builds of bases receive, and the recipe turns on writing only when that variable is non-empty. A task never has it, so a task with no base to start from, which runs the build steps itself, only reads. Settings both need, such as the bucket or the server, go to both stages with --stage build,task.

A build-stage secret never reaches a task, and a base that contains its value is refused. Where a backend cannot issue a read-only credential, give tasks none: they still start warm from the base's build output, and only builds of bases use the remote cache.

Make the read-only credential

  • Amazon S3 (sccache): an IAM user for tasks, on a bucket that holds only the cache, with this policy and no other. The builds' user has the same policy with s3:PutObject added beside s3:GetObject. Without s3:ListBucket, S3 answers a missing object with 403 rather than 404, and the sccache server refuses to start until something has written its check file. For Cloudflare R2, make an API token with the Object Read only permission on the bucket.
Task policy
{  "Version": "2012-10-17",  "Statement": [    {      "Effect": "Allow",      "Action": "s3:GetObject",      "Resource": "arn:aws:s3:::acme-build-cache/sccache/*"    },    {      "Effect": "Allow",      "Action": "s3:ListBucket",      "Resource": "arn:aws:s3:::acme-build-cache"    }  ]}
  • bazel-remote (Bazel, sccache over WebDAV, Gradle and ccache) has no read-only user. Run it with --htpasswd_file and --allow_unauthenticated_reads, and tasks read with no credential while builds write with a password, but anyone who can reach the server can then read the cache, which holds your compiled code. Where that is not acceptable, give tasks no credential.
  • Develocity's build cache node (Gradle): a user whose level is read, not readwrite.
  • Vercel Remote Cache (Turborepo): Vercel's access tokens are scoped to an account, a team or a project, never to reading only, so tasks get no token.
  • Any other cache server: if it cannot issue a credential that only reads, tasks get none.

Recipes

Builds of bases run no dotfiles, so each recipe sets the tool up from a script you commit to the repository, .devcontainer/cache.sh. The repository's devcontainer.json sources it in the build step, before building, and runs it in the start step, on every activation of a task. Files it writes in your home directory, outside ~/workspace, the ~/.microdev-* directories and the agents' ~/.codex, ~/.claude and ~/.pi, are rebuilt each activation and never saved, so a build may write its write credential there. Each recipe names the variables to set, the script, and the two steps; add the script to a postStartCommand you already have rather than replacing it. With a devcontainer.json, its steps replace MicroDev's detected setup, so the repository installs its own toolchain: the image's cargo is Ubuntu's 1.75, which cannot read a version 4 Cargo.lock. The Rust recipes start their build step with the line that installs rustup from the image's rustup-init into ~/.microdev-env, which every base and pause keeps; rustup then follows your rust-toolchain.toml if you have one. A script that downloads a tool stops the step with one line saying which tool it could not install, when the download or its checksum fails: the build fails rather than publish a base built without the cache, and a task shows the line in microdev status.

sccache with S3 (Rust)

Works with Amazon S3 and S3-compatible storage. For Cloudflare R2 or MinIO, also set SCCACHE_ENDPOINT at both stages (for R2, https://ACCOUNT_ID.r2.cloudflarestorage.com with SCCACHE_REGION=auto). Write the scheme in an endpoint: without https://, sccache connects over plain HTTP. The task's key pair is the AWS SDK's own, so every AWS tool in the task uses it, and it can only read the cache.

Your terminal
microdev env set RUSTC_WRAPPER=sccache --repo acme/service --stage build,taskmicrodev env set SCCACHE_BUCKET=acme-build-cache --stage build,taskmicrodev env set SCCACHE_REGION=us-west-2 --stage build,taskmicrodev env set SCCACHE_S3_KEY_PREFIX=sccache/ --stage build,taskmicrodev env set SCCACHE_S3_RW_MODE=READ_ONLY --stage build,task# The read-only key, for tasksmicrodev env set --secret AWS_ACCESS_KEY_ID < reader-key-id.txtmicrodev env set --secret AWS_SECRET_ACCESS_KEY < reader-secret-key.txt# The key that writes, for builds of bases onlymicrodev env set --secret CACHE_WRITE_AWS_ACCESS_KEY_ID --stage build < writer-key-id.txtmicrodev env set --secret CACHE_WRITE_AWS_SECRET_ACCESS_KEY --stage build < writer-secret-key.txt
.devcontainer/cache.sh
# Download sccache once into the workspace, verified, and put it on PATH.version=0.18.0tools="$HOME/workspace/.microdev-tools"grep -qxF /.microdev-tools/ "$HOME/workspace/.git/info/exclude" || echo /.microdev-tools/ >> "$HOME/workspace/.git/info/exclude"if [ ! -x "$tools/bin/sccache" ]; then  name="sccache-v$version-x86_64-unknown-linux-musl"  if ! { curl -fsSL "https://github.com/mozilla/sccache/releases/download/v$version/$name.tar.gz" -o /tmp/sccache.tar.gz &&    echo "45f1447fbe231e3037bde351ef70677dd212216c8d62ae7ca409fecc4d6acc89  /tmp/sccache.tar.gz" | sha256sum -c - &&    mkdir -p "$tools/bin" &&    tar -xzf /tmp/sccache.tar.gz -C "$tools/bin" --strip-components=1 "$name/sccache"; }; then    echo "cache.sh: could not install sccache $version (see above), so this step stops" >&2    return 1  fifisudo ln -sf "$tools/bin/sccache" /usr/local/bin/sccache# Only builds of bases receive the write key, so only they write.if [ -n "${CACHE_WRITE_AWS_ACCESS_KEY_ID:-}" ]; then  export AWS_ACCESS_KEY_ID="$CACHE_WRITE_AWS_ACCESS_KEY_ID" AWS_SECRET_ACCESS_KEY="$CACHE_WRITE_AWS_SECRET_ACCESS_KEY" SCCACHE_S3_RW_MODE=READ_WRITEfi
devcontainer.json
"onCreateCommand": "{ command -v rustup >/dev/null || rustup-init -y --no-modify-path --profile minimal --default-toolchain stable; } && . .devcontainer/cache.sh && cargo build --workspace --tests","postStartCommand": ". .devcontainer/cache.sh"

Limit RUSTC_WRAPPER to the repositories whose setup runs this script, because Cargo refuses to build when the wrapper is missing. sccache caches by absolute path, and every task's workspace is /home/dev/workspace, so tasks hit the builds' entries as long as the toolchain and CARGO_HOME are at the same paths in every task. It does not cache crates Cargo compiles incrementally, which are your workspace's own crates in the dev profile: it caches their dependencies, and Cargo's incremental compilation handles the crate you are editing. CARGO_INCREMENTAL=0 caches those too, at the cost of slower rebuilds while you edit. sccache reads its settings when its server starts, and the server stops after 10 idle minutes; after changing a variable in a running task, run sccache --stop-server so the next build reads it. sccache --show-stats shows hits and misses.

sccache with WebDAV (Rust)

The WebDAV backend talks to HTTP cache servers that also serve Bazel, Gradle and ccache, such as bazel-remote, so one cache server can serve them all.

Your terminal
microdev env set RUSTC_WRAPPER=sccache --repo acme/service --stage build,taskmicrodev env set SCCACHE_WEBDAV_ENDPOINT=https://cache.acme.dev/sccache/ --stage build,taskmicrodev env set SCCACHE_WEBDAV_RW_MODE=READ_ONLY --stage build,task# A read-only token, for tasks, if your server issues onemicrodev env set --secret SCCACHE_WEBDAV_TOKEN < reader-token.txt# The token that writes, for builds of bases onlymicrodev env set --secret CACHE_WRITE_WEBDAV_TOKEN --stage build < writer-token.txt
.devcontainer/cache.sh
# Download sccache once into the workspace, verified, and put it on PATH.version=0.18.0tools="$HOME/workspace/.microdev-tools"grep -qxF /.microdev-tools/ "$HOME/workspace/.git/info/exclude" || echo /.microdev-tools/ >> "$HOME/workspace/.git/info/exclude"if [ ! -x "$tools/bin/sccache" ]; then  name="sccache-v$version-x86_64-unknown-linux-musl"  if ! { curl -fsSL "https://github.com/mozilla/sccache/releases/download/v$version/$name.tar.gz" -o /tmp/sccache.tar.gz &&    echo "45f1447fbe231e3037bde351ef70677dd212216c8d62ae7ca409fecc4d6acc89  /tmp/sccache.tar.gz" | sha256sum -c - &&    mkdir -p "$tools/bin" &&    tar -xzf /tmp/sccache.tar.gz -C "$tools/bin" --strip-components=1 "$name/sccache"; }; then    echo "cache.sh: could not install sccache $version (see above), so this step stops" >&2    return 1  fifisudo ln -sf "$tools/bin/sccache" /usr/local/bin/sccache# Only builds of bases receive the write token, so only they write.if [ -n "${CACHE_WRITE_WEBDAV_TOKEN:-}" ]; then  export SCCACHE_WEBDAV_TOKEN="$CACHE_WRITE_WEBDAV_TOKEN" SCCACHE_WEBDAV_RW_MODE=READ_WRITEfi
devcontainer.json
"onCreateCommand": "{ command -v rustup >/dev/null || rustup-init -y --no-modify-path --profile minimal --default-toolchain stable; } && . .devcontainer/cache.sh && cargo build --workspace --tests","postStartCommand": ". .devcontainer/cache.sh"

SCCACHE_WEBDAV_TOKEN is sent as a bearer token. For basic authentication, which bazel-remote's password file uses, set SCCACHE_WEBDAV_USERNAME and export SCCACHE_WEBDAV_PASSWORD from a CACHE_WRITE_ secret the same way.

Bazel remote cache

Bazel does not expand environment variables in .bazelrc, so the script writes the values into ~/.bazelrc. Bazel keeps its build output in ~/.cache/bazel, outside the workspace, so a base does not carry it: for Bazel, the remote cache is what makes a new task start warm, so prefer a server that can give tasks a read-only token. Each header secret is the whole header, such as Authorization=Bearer TOKEN.

Your terminal
microdev env set BAZEL_REMOTE_CACHE=grpcs://cache.acme.dev --stage build,task# A read-only token, for tasks, if your server issues onemicrodev env set --secret BAZEL_REMOTE_CACHE_HEADER < reader-header.txt# The header that writes, for builds of bases onlymicrodev env set --secret CACHE_WRITE_BAZEL_HEADER --stage build < writer-header.txt
.devcontainer/cache.sh
# Bazel does not expand variables in .bazelrc, so write the values in on every activation.header="${BAZEL_REMOTE_CACHE_HEADER:-}"upload=false# Only builds of bases receive the write header, so only they upload.if [ -n "${CACHE_WRITE_BAZEL_HEADER:-}" ]; then  header="$CACHE_WRITE_BAZEL_HEADER"  upload=truefi{  echo "build --remote_cache=$BAZEL_REMOTE_CACHE"  if [ -n "$header" ]; then echo "build \"--remote_header=$header\""; fi  echo "build --remote_upload_local_results=$upload"} > "$HOME/.bazelrc"chmod 600 "$HOME/.bazelrc"
devcontainer.json
"onCreateCommand": ". .devcontainer/cache.sh && bazel build //...","postStartCommand": ". .devcontainer/cache.sh"

--remote_cache takes grpcs://, grpc://, https:// or http://. --remote_header sends the header with every remote request, so a cache that wants another header, such as an API key, takes NAME=VALUE the same way. A flag on the command line overrides the same flag in ~/.bazelrc.

Gradle remote build cache

An init script configures the cache for every build without changing your build files. It pushes only when the write password is set, and with no task user set, tasks read without credentials.

Your terminal
microdev env set GRADLE_CACHE_URL=https://cache.acme.dev/cache/ --stage build,task# A read-only user, for tasks, if your server has onemicrodev env set GRADLE_CACHE_USER=tasksmicrodev env set --secret GRADLE_CACHE_PASSWORD < reader-password.txt# The user that writes, for builds of bases onlymicrodev env set CACHE_WRITE_GRADLE_USER=builds --stage buildmicrodev env set --secret CACHE_WRITE_GRADLE_PASSWORD --stage build < writer-password.txt
.devcontainer/cache.sh
# Gradle reads the variables when each build starts.gradle_home="${GRADLE_USER_HOME:-$HOME/.gradle}"mkdir -p "$gradle_home/init.d"cat > "$gradle_home/init.d/remote-cache.init.gradle.kts" <<'EOF'// Only builds of bases receive the write password, so only they push.val writePassword = System.getenv("CACHE_WRITE_GRADLE_PASSWORD").orEmpty()val push = writePassword.isNotEmpty()gradle.settingsEvaluated {    buildCache {        remote<HttpBuildCache> {            url = uri(System.getenv("GRADLE_CACHE_URL"))            isPush = push            credentials {                username = System.getenv(if (push) "CACHE_WRITE_GRADLE_USER" else "GRADLE_CACHE_USER")                password = if (push) writePassword else System.getenv("GRADLE_CACHE_PASSWORD")            }        }    }}EOFprintf '%s\n' org.gradle.caching=true org.gradle.workers.max=2 > "$gradle_home/gradle.properties"
devcontainer.json
"onCreateCommand": ". .devcontainer/cache.sh && ./gradlew assemble testClasses","postStartCommand": ". .devcontainer/cache.sh"

The init script and gradle.properties go in GRADLE_USER_HOME, which is ~/.gradle unless you set it. A GRADLE_USER_HOME inside the workspace puts Gradle's dependency cache in the base too.

Turborepo remote cache

Turborepo reads its remote cache settings from the environment. With Vercel's Remote Cache, tasks get no token, so only builds of bases use the remote cache, and tasks start from the base's local cache, .turbo/cache in the repository. It needs no start step.

Your terminal
microdev env set TURBO_TEAM=acme --stage buildmicrodev env set --secret CACHE_WRITE_TURBO_TOKEN --stage build < turbo-token.txt
.devcontainer/cache.sh
# Only builds of bases receive the token, so only they reach the remote cache.if [ -n "${CACHE_WRITE_TURBO_TOKEN:-}" ]; then  export TURBO_TOKEN="$CACHE_WRITE_TURBO_TOKEN" TURBO_CACHE=local:rw,remote:rwfi
devcontainer.json
"onCreateCommand": ". .devcontainer/cache.sh && npm ci && npx turbo run build"

A self-hosted cache server that issues read-only tokens can serve tasks too: set TURBO_API and TURBO_TEAM at both stages, and give tasks the read-only token as TURBO_TOKEN with TURBO_CACHE=local:rw,remote:r.

ccache (C and C++)

ccache reaches an HTTPS cache server through a storage helper, which needs ccache 4.13 or later; Ubuntu's ccache is older and its built-in HTTP backend has no TLS, so the script downloads both. Each remote storage setting is a whole secret, because the bearer token is part of it; the tasks' one ends in read-only as well, and without a token it can be a plain variable.

Your terminal
microdev env set CMAKE_C_COMPILER_LAUNCHER=ccache --repo acme/engine --stage build,taskmicrodev env set CMAKE_CXX_COMPILER_LAUNCHER=ccache --repo acme/engine --stage build,taskmicrodev env set --secret CCACHE_REMOTE_STORAGE --file ccache-reader.txtmicrodev env set --secret CACHE_WRITE_CCACHE_REMOTE_STORAGE --stage build --file ccache-writer.txt
ccache-reader.txt
https://cache.acme.dev/ccache @bearer-token=READER_TOKEN read-only
ccache-writer.txt
https://cache.acme.dev/ccache @bearer-token=WRITER_TOKEN
.devcontainer/cache.sh
# Download ccache and its HTTPS storage helper once into the workspace, verified, and put both on PATH.tools="$HOME/workspace/.microdev-tools"grep -qxF /.microdev-tools/ "$HOME/workspace/.git/info/exclude" || echo /.microdev-tools/ >> "$HOME/workspace/.git/info/exclude"if [ ! -x "$tools/bin/ccache-storage-http" ]; then  name=ccache-4.14-linux-x86_64-glibc  helper=ccache-storage-http-go-0.10-linux-amd64  if ! { mkdir -p "$tools/bin" &&    curl -fsSL "https://github.com/ccache/ccache/releases/download/v4.14/$name.tar.gz" -o /tmp/ccache.tar.gz &&    echo "c64760b0b85ba86068f4cd162dc42e2dc39c6f46b0cb8c1990dfccbec7a1fed0  /tmp/ccache.tar.gz" | sha256sum -c - &&    tar -xzf /tmp/ccache.tar.gz -C "$tools/bin" --strip-components=1 "$name/ccache" &&    curl -fsSL "https://github.com/ccache/ccache-storage-http-go/releases/download/v0.10/$helper.tar.gz" -o /tmp/ccache-storage-http.tar.gz &&    echo "88963ef2cc21ca588145d46bcb02b8295275975ed75696eedf2cdb0e9543edd0  /tmp/ccache-storage-http.tar.gz" | sha256sum -c - &&    tar -xzf /tmp/ccache-storage-http.tar.gz -C "$tools/bin" --strip-components=1 "$helper/ccache-storage-http"; }; then    echo "cache.sh: could not install ccache 4.14 and its storage helper (see above), so this step stops" >&2    return 1  fifisudo ln -sf "$tools/bin/ccache" /usr/local/bin/ccachesudo ln -sf "$tools/bin/ccache-storage-http" /usr/local/bin/ccache-storage-https# Only builds of bases receive the write setting, so only they write.if [ -n "${CACHE_WRITE_CCACHE_REMOTE_STORAGE:-}" ]; then  export CCACHE_REMOTE_STORAGE="$CACHE_WRITE_CCACHE_REMOTE_STORAGE"fi
devcontainer.json
"onCreateCommand": ". .devcontainer/cache.sh && cmake -B build && cmake --build build -j 2","postStartCommand": ". .devcontainer/cache.sh"

CMake reads the launcher variables only when it first configures a build directory. For make or autotools, set CC="ccache gcc" and CXX="ccache g++" instead. A token containing %, | or whitespace must be percent-encoded. ccache keeps its local cache in ~/.cache/ccache, outside the workspace, so a base does not carry it; the build directory and the remote cache are what make a task start warm. Every task builds in /home/dev/workspace, so paths match between tasks without CCACHE_BASEDIR. ccache --show-stats shows hits and misses. sccache also caches C and C++ (CC="sccache gcc") and talks to S3 and WebDAV itself, so a team that already runs the sccache recipe can use it for both.

Billing from the CLI

Owners, admins and billing members manage an organization's plan. Payment details stay on Stripe's hosted pages. See pricing for the rates. Usage is counted in agent-hours: one 2-vCPU task running for one hour. A larger task counts in proportion to its size: medium two agent-hours an hour, large four, xlarge eight. microdev start --size medium starts a task at a size, microdev boost TASK --size large raises a running one on a paid plan until microdev release-boost TASK or a pause.

Your terminal
microdev org use ORGANIZATION_UUIDmicrodev billing plansmicrodev billing subscribe PLAN SEATSmicrodev billing setupmicrodev billing status

setup prints the payment setup link. Finishing that page does not turn the plan on by itself: the plan starts once the payment setup is verified and the opening invoice is paid. Pay as you go has no opening charge. status shows where it stands.

microdev-payg-v2
Pay as you go: no monthly fee, card required, $0.10 per agent-hour. For one person: one seat.
billing cancel
Cancels at the end of the paid period. billing renew undoes it.
billing invoices
Lists invoices. billing invoice ID shows one.
billing portal
Prints a link to your payment methods on Stripe.

microdev billing --help lists every billing command.