Skip to content

Pull mode ​

With pull mode, a host keeps itself up to date. A root service fetches a configuration repository on a timer and runs mise bootstrap from each new commit. Nobody needs a terminal on the host or an SSH session into it. Use it for a fleet such as self-hosted CI runners, where mise bootstrap remote would need someone at a terminal for sudo on every apply.

The service runs the repository's configuration as root, so pull mode applies only commits that are signed by an SSH key you allowed when you set it up.

Set up a host ​

You need:

  • macOS or Linux with systemd, plus Git 2.34 or later and OpenSSH 8.8 or later (ssh-keygen), the versions that verify SSH signatures
  • a repository with a mise.toml, laid out like a bootstrap project
  • one or more SSH keys that sign the commits you want hosts to apply, in an allowed signers file

An allowed signers file has one key per line, in the same format as Git's gpg.ssh.allowedSignersFile:

text
ops@example.com namespaces="git" ssh-ed25519 AAAAC3Nza... ops

On the host, as root:

sh
sudo mise bootstrap pull install \
  --repo https://github.com/example/fleet.git \
  --ref main \
  --allowed-signers ./allowed_signers \
  --env mac-ci \
  --user admin \
  --interval 30m

install does the following:

  1. Copies the allowed signers file into the pull directory, named by its SHA-256 digest.
  2. Writes the URL, ref, environments, bootstrap user, interval, and that digest to pull.toml there. A relative local --repo path is stored as an absolute one.
  3. Installs the service and starts the first run:
    • on macOS, the LaunchDaemon /Library/LaunchDaemons/dev.mise.bootstrap-pull.plist
    • on Linux, mise-bootstrap-pull.service and mise-bootstrap-pull.timer in /etc/systemd/system

The pull directory is /var/db/mise/bootstrap-pull on macOS and /var/lib/mise/bootstrap-pull on Linux. Choose another with --dir or MISE_BOOTSTRAP_PULL_DIR. Add --dry-run to print the files without writing them.

--ref takes a branch, which is main by default, or a full ref such as refs/tags/live. --env sets the config environments the bootstrap loads. Without it, the host's own miserc chooses them. --user names the account the bootstrap acts for; see Act for an account.

The service runs the mise executable that ran install. Pass --mise-bin to choose another. The executable and every directory above it must be owned by root and writable only by root. Otherwise another user could replace the program that root runs. A ~/.local/bin/mise therefore does not qualify, so copy it first:

sh
sudo install -d -o root -m 755 /usr/local/libexec
sudo install -o root -m 755 ~/.local/bin/mise /usr/local/libexec/mise
sudo /usr/local/libexec/mise bootstrap pull install --repo ... --allowed-signers ...

A local --repo path must be root's alone, like the mise executable: Git reads the source repository's own config when it fetches from it, before any signature is checked. A run refuses a local repository, its Git directory, or its config that another user owns or can write.

Fetching a private repository uses root's Git credentials, such as a deploy key in /var/root/.ssh (macOS) or /root/.ssh (Linux) for an SSH URL. Git never prompts, so a missing credential fails the fetch and status shows the error.

Act for an account ​

A configuration written for mise bootstrap remote or for mise bootstrap at a terminal expects a person's account to run it: Homebrew in a prefix that account owns, preferences in its home, and hooks that call sudo and read SUDO_USER. Pull mode runs as root, so tell it which account plays that part:

sh
sudo mise bootstrap pull install --repo ... --allowed-signers ... --user admin

The bootstrap still runs as root, and parts that need root, such as system files, LaunchDaemons, services, and hooks, run as root. With --user:

  • The bootstrap sees the account as SUDO_USER, SUDO_UID, and SUDO_GID, as if the account had run sudo mise bootstrap, and as MISE_BOOTSTRAP_USER. Hooks, tasks, and templates can read them, for example {{ env.MISE_BOOTSTRAP_USER }}, in root's run and in the account's parts alike.

  • sudo in a hook or task finds a wrapper first on PATH, in bin/ of the pull directory. A real sudo run by root would set SUDO_USER to root, so the wrapper runs sudo command, with any of -E, -H, and -n, directly as root and keeps the environment. Other options, such as sudo -u, go to the real sudo, which root runs without a password.

  • These parts run as the account, with its user and group IDs and an environment from its account entry:

    Root starts a mise as the account for each of these parts and sends it a copy of the checkout, without .git, on stdin. That mise unpacks the copy into bootstrap-user/config in its own state directory, normally ~/.local/state/mise/bootstrap-user/config, which only the account can read, and applies the part from there, without hooks. Dotfiles linked from the repository link into that copy. The first such part of each run replaces it, and each later part refreshes the files root's checkout has, so a relative repository cloned into it stays for the rest of the run and is cloned again on the next. A dry run previews from a separate copy, so it leaves the links alone but lists every linked dotfile as changed. The account never reads root's checkout, and root never writes into a directory the account owns, so root never works in a Homebrew prefix or home directory that the account could redirect. The account's own global config is not loaded: only the verified checkout applies. Secret inputs that only root can read are not available to these parts.

Machine-wide preferences, Spotlight, power settings, the login shell, and everything else run as root. Linux systemd user units are skipped, as they are under sudo mise bootstrap. Package and settings plugins also run as root, so a plugin whose requires names a tool from [tools] does not find the copy the account's tools part installed.

The account must exist when you run install, and must not be root. The mise executable must be one the account can run, which a root-owned /usr/local/bin/mise or /usr/local/libexec/mise is. Changing --user applies the current commit again.

Keep mise up to date ​

The service runs the pinned mise executable, and nothing changes it unless you ask. Pass --self-update to install to update it with each apply:

sh
sudo mise bootstrap pull install --repo ... --allowed-signers ... --self-update

Each run that applies a commit runs mise bootstrap --self-update, which installs the newest mise release over the pinned executable, after checking the release's signature, and then applies the commit with the new version. A run that finds no new commit changes nothing, so pushing a signed commit is what updates the fleet. A failed update fails the apply, which is retried like any other failure. It needs a mise installed from a release binary, not one that a package manager such as Homebrew installed.

What each run does ​

mise bootstrap pull run is the command the service runs. You can also run it yourself. Each run:

  1. Fetches the pinned ref from the pinned URL into the checkout in the pull directory.
  2. Checks that the checkout's origin is still the pinned URL.
  3. Stops if the ref still names the commit that last applied.
  4. Verifies the commit's SSH signature against the pinned allowed signers.
  5. Checks that the commit descends from the last commit that applied.
  6. Checks out the commit and runs mise bootstrap --yes from it. The checkout is trusted for this run, and config search stops at the pull directory.
  7. Records the commit as the last good one and writes last-applied.json.

The bootstrap runs with no terminal: stdin is closed, --yes answers confirmations, and its output goes to pull.log. Because it runs as root, steps that need root, such as packages, services, LaunchDaemons, and hooks that call sudo, run directly and never ask for a password. Anything that would still prompt, such as a missing secret input, fails instead, so make the values available on the host.

A run that takes longer than 4 hours, such as one stuck on a fetch or a hung bootstrap step, stops itself and the commands it started, and records the timeout as its error.

A run applies a commit only when it is new. To apply the current commit again, for example after fixing something on the host by hand, run sudo mise bootstrap pull run --force. The commit is verified as usual.

When a run fails ​

Each run that cannot fetch, refuses a commit, or fails to apply it exits with status 1 and records the error. The host stays on its last good state:

  • A refused commit is never checked out.
  • After a failed bootstrap, mise checks out the last good commit again, so the files on disk match what last applied. Whatever the failed bootstrap changed before it stopped stays changed.

A commit whose bootstrap fails is retried on the next run. After that, mise waits twice as long as the previous wait before each retry, up to a day. A new commit is tried right away, so pushing a fix is the quickest way out. run --force retries at once.

Check on a host ​

sh
mise bootstrap pull status
text
repository:  https://github.com/example/fleet.git (refs/heads/main)
environment: mac-ci
interval:    30m
service:     /Library/LaunchDaemons/dev.mise.bootstrap-pull.plist
applied:     4c1f… at 2026-11-28T18:02:11Z, signed by ops@example.com
last run:    rejected at 2026-11-28T18:32:09Z (9a7e…)
last error:  rejected at 2026-11-28T18:32:09Z: 9a7e…: the commit is not signed
log:         /var/db/mise/bootstrap-pull/pull.log

status needs no root: the pin, the state, and the last-applied record are readable by every user. The log and the checkout are root's only, because a bootstrap's output and configuration can contain secrets. So is the run lock, so no other user can hold it and stop the runs. --json prints the pin, state.json, and last-applied.json together.

The pull directory holds:

FileContents
pull.tomlWhat install pinned: repository, ref, env, interval_secs, mise_bin, user, self_update, and allowed_signers_sha256
allowed_signers.<sha256>The signers that install copied, named by the digest in pull.toml
state.jsonThe last good commit, the last run, the last error, and the backoff of a failure
last-applied.jsonThe commit that last applied, with its repository, ref, signer, time, and host name
pull.log, pull.log.1Each run's progress and the bootstrap's output, rotated at 4 MiB
checkout/The Git checkout the bootstrap runs from
bin/sudoThe sudo wrapper for a bootstrap that acts for an account

last-applied.json is meant for tools that report on a fleet:

json
{
  "format": 1,
  "source": "pull",
  "repository": "https://github.com/example/fleet.git",
  "ref": "refs/heads/main",
  "commit": "4c1f…",
  "signer": "ops@example.com",
  "env": ["mac-ci"],
  "user": "admin",
  "applied_at": "2026-11-28T18:02:11Z",
  "mise_version": "2026.11.0",
  "hostname": "ci-mac-01"
}

Change or remove the setup ​

install waits for a run in progress to finish. Run install again to change the ref, the signers, the environments, the bootstrap user, or the interval. The new pin and its signers take effect together, because the pin names its signers file by digest. A different --repo or --ref also discards the checkout, the run state, and last-applied.json, and the new ref starts from its head, which need not descend from the old one. Different --env or --user values make the next run apply the current commit again with them.

sh
sudo mise bootstrap pull uninstall
sudo mise bootstrap pull uninstall --purge

uninstall stops the service first, which ends a run the service started, then waits for a run started by hand to finish, and then removes the service. If the service cannot be stopped, or a run still holds the lock after 5 minutes, it removes nothing, so you can run it again. --purge also deletes the pull directory, and refuses a directory with no pull.toml. What the bootstrap installed stays on the host either way.

Sign commits ​

Sign with an SSH key, the same way you sign for GitHub's verified badge:

sh
git config gpg.format ssh
git config user.signingkey ~/.ssh/id_ed25519.pub
git commit -S -m "runners: add mbx cache"

Set commit.gpgsign = true to sign every commit. A merge made on GitHub's website is signed with GitHub's GPG key, which pull mode never accepts, so merge locally and push a merge commit you signed with an allowed SSH key.

Only the commit a run applies needs to be signed. A signature covers the commit's whole tree, so commits beneath it can be unsigned. Whoever signs a merge vouches for everything it brings in.

Threat model ​

Pull mode protects a host from changes that you did not sign. These people and failures cannot run code on the host:

  • someone who can push to the repository, or who controls its hosting, but does not hold an allowed signing key
  • someone who can intercept or redirect the fetch
  • someone who can change the repository's own files, including its mise.toml
  • a user on the host who is not root

The design follows from that:

  • Pinned trust. The URL, the ref, and the allowed signers come only from pull.toml and the signers file it names in the pull directory, which only root can write. Nothing in the repository can change them: a commit cannot add signers, and pull mode never follows a changed URL. Every fetch names the pinned URL itself, and a checkout whose origin was changed is refused.
  • Signed commits only. Unsigned commits, commits signed by a key that is not an allowed signer, and signatures that do not verify are refused. Git must verify the signature and report the key as fully trusted for the signing principal. GPG and X.509 signatures, and commits with more than one signature header, are refused before Git checks them, even when root's keyring would trust them.
  • No rollback. A commit must descend from the last good commit. A ref moved back to an older signed commit is refused, because the older commit may have a known flaw. So is a rewritten history. To go back, sign a new commit that reverts the change.
  • Root-owned inputs. When run runs as root, it refuses a pull directory, pin, or signers file that belongs to another user or that another user can write, including any directory above them. A symbolic link on the way, such as /var on macOS, is followed only when root owns it, and every directory its target passes through is checked the same way. The pin and signers file cannot be links themselves. The same applies to the mise executable at install, and to a local repository and its Git config at each run.
  • Root-owned tools. As root, git, ssh-keygen, and the ssh that Git starts come only from PATH directories that root alone can change. A user-owned /opt/homebrew/bin is skipped, so nobody can plant a git that runs before the signature is checked. The bootstrap itself still gets the full PATH, because it runs package managers such as Homebrew.
  • The bootstrap user's parts run as that user. With --user, root starts a mise as the account for the account's parts and only waits for it. The account gets a copy of the checkout and no way to ask root for anything, so the account can change only what it could change anyway. Root keeps refusing to write into a Homebrew prefix that another account owns.
  • Fails closed. A failed fetch or verification changes nothing on the host. Git hooks, submodules, and HTTP redirects are off during the fetch. Only HTTPS, SSH, and local repositories are accepted, and Git remote helpers are not.

Pull mode does not protect against:

  • A stolen signing key. Anyone who holds an allowed key can run code as root on every host that trusts it. Keep signing keys off shared machines, prefer hardware-backed keys (sk-ssh-ed25519), and remove a key from the allowed signers on every host as soon as it is lost. A valid-before option in the allowed signers file limits a key's lifetime.
  • What a signed commit does. A signature says who approved a commit, not that the commit is safe. Review what you sign.
  • Withheld updates. Someone who controls the repository's hosting can stop serving new commits, which leaves hosts on their last good commit. Watch applied_at in status or last-applied.json for hosts that fall behind.
  • Root on the host. Root can change everything pull mode relies on.
  • Programs the bootstrap user owns. Hooks and tasks run as root with the full PATH, which on a Homebrew host includes a /opt/homebrew/bin that the bootstrap user, or whoever owns the prefix, can change. Name programs by absolute path in hooks and tasks that must not run what that account put there.

Compared with other ways to bootstrap ​

CommandWho starts itRuns asVerifies commits
mise bootstrap --fromYou, on the hostYou, with sudoNo
mise bootstrap remoteYou, from another machineThe SSH userNo
mise bootstrap pullA root service, on a timerroot, and --user for its partsYes
MIT LicenseCopyright © 2026jdx.dev