Skip to content

mooncake fleet bootstrap

Install mooncake on a remote box via SSH and register it as a peer

Description

Production bootstrap (spec-44 §88, 8-step sequence): 1. SSH to user@host using ssh-agent or ~/.ssh/id_ed25519. 2. Detect platform (linux+darwin+windows × amd64+arm64). 3. Skip steps 4-6 if the same version is already installed and active. 4. SFTP the mooncake binary; sudo-install to /usr/local/bin (linux/darwin) or Move-Item to %LOCALAPPDATA%\Mooncake\bin\mooncake.exe (windows). 5. Render + install a systemd unit (Linux), launchd plist (macOS), or Task Scheduler XML (Windows). Windows: also opens host firewall. 6. Enable + start the service; wait for /v1/version reachable. 7. Read the bearer token (sudo cat on linux/darwin, Get-Content on windows from %LOCALAPPDATA%\Mooncake\agentd.token). 8. Upsert a [[peers]] entry in peers.toml.

Flags

Flag Type Default Description
--port / -p int 22 SSH port
--agentd-port int 7878 agentd TCP port on remote
--name string - Peer name in peers.toml (default: hostname with dots → dashes)
--tag []string - Tag to attach to the peer (repeatable)
--binary string - Path to mooncake binary to upload (default: this process)
--peers-file string - Override the peers.toml path
--upgrade bool false Replace an already-installed mooncake of a different version. Without this, version mismatch on the target errors out.
--user bool false Linux only: install the agentd as a user-scope systemd unit running as the SSH user (binary in ~/.local/bin, unit in ~/.config/systemd/user/, token in ~/.config/mooncake/). Default is a system-scope unit running as root. Implies loginctl enable-linger so the unit survives logout.