# https://mydevmachine.sh/getting-started/ devmachine sets up a machine for you to code on: a VPS you rent, or a Linux box or Mac you already have. Each project or client gets its own account on the machine, called a workspace, with its own tools and logins. You need a machine running Debian, Ubuntu, Arch Linux or macOS that you reach over SSH as root, or as an admin login with passwordless sudo, and a Mac or Linux computer to run the CLI. A Mac as the machine needs Remote Login on; `setup` asks whether to use Homebrew or MacPorts, and asks before it installs anything. See [what a machine needs](/how-it-works/what-a-machine-needs/). Pick how to start. Both end in the same place: the CLI installed, your server connected, and a workspace to code in. - **[With the macOS app](#with-the-macos-app)** — a window walks you through it. macOS 14 or later. - **[With the CLI](#with-the-cli)** — three commands in a terminal. Mac or Linux. ## With the macOS app 1. Download [Devmachine.dmg](https://github.com/mydevmachine/app-releases/releases/latest/download/Devmachine.dmg), open it, and drag Devmachine to Applications. With Homebrew: `brew install --cask mydevmachine/tap/devmachine-app`. 2. Open Devmachine and click **Set up devmachine**. It installs the CLI, then runs `devmachine setup` in a terminal inside the window: give it your server's address, check the fingerprint, and say yes to the SSH host entries (the app connects through them). Then it adds the `devmachine-app` package to the server and runs `sync`. You see every command as it runs. 3. When it says **Devmachine is ready**, click **Restart Devmachine**. 4. Create your first workspace from any terminal: ``` devmachine workspaces new acme && devmachine sync ``` It shows up in the app's sidebar. Click it to open a terminal in it. The session grid shows all the sessions of a workspace side by side. A step failed? Click **Try again**, or, if a coding agent such as Claude Code or Codex is on your Mac, ask it to fix the step for you. More about the app: [mydevmachine.sh/app](https://mydevmachine.sh/app/). ## With the CLI ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine workspaces new acme && devmachine sync ``` On macOS, that line installs through Homebrew if you have it. Prefer Homebrew directly? `brew install mydevmachine/tap/devmachine` works the same way. No server yet? Make a machine on your computer instead, with [Lima](https://lima-vm.io) (`brew install lima`), and use it in place of `setup`: ``` devmachine machines create-local sandbox --add ``` It creates a virtual machine and adds it in one step. See [try it on your own computer first](/guides/a-local-vm-with-lima/). `devmachine skills add` teaches your coding agent how to use devmachine. You can run it before `setup`, too. Then work in your new workspace: ``` devmachine ssh acme ``` `setup` also asks whether to write SSH host entries for you. Say yes, and `ssh acme-devmachine` works from any terminal, editor or app that dials `ssh` directly — VS Code Remote-SSH, Zed, the macOS app. For mosh, use `devmachine mosh acme`. See [reaching your server](/concepts/reaching-your-server/). ## What each command does `setup` asks for your server's address. It shows a code called the fingerprint: check it matches the one in your provider's dashboard, so you know you are talking to your own server. Then it sets up a key and turns off password logins, so only you can get in. `setup` also gives the server the `essentials` package: base tools, git, a firewall, SSH with passwords kept off, Caddy to publish sites with HTTPS, and what the macOS app reads from a server. Docker is not in it; add it with `devmachine packages add docker` when you need it. Want a bare server instead? Run `devmachine setup --no-essentials`. On a Mac, where `essentials` does not run, it starts with `base`, `devmachine-app` and `mac-brew` or `mac-ports` instead. `workspaces new acme` creates a workspace called acme. `sync` builds it all on the server. **Set up before the essentials existed?** Add them to the server you already have, nothing to rebuild. What is already installed stays as it is: ``` devmachine packages pin devmachine packages add essentials devmachine sync ``` `packages pin` moves you to the latest set of packages, the first one with `essentials` in it. On a Mac, add `base` and `devmachine-app` instead: `sync` refuses `essentials` there. A new workspace comes with git, the GitHub CLI, Node LTS (through mise), bun, and zsh with Oh My Zsh. Every SSH login lands in a tmux session, so a dropped connection loses nothing: connect again and you are back where you were. Turn that off with the [`zsh.tmux_auto_attach`](/reference/settings/) setting. The server itself gets only the packages you add to it. Something failed? [Troubleshooting](/troubleshooting/) says what each error really means. ## Set it up to develop - **A coding agent:** `devmachine packages add claude-code --workspace acme`, then `devmachine sync`. - **GitHub, signed in once for every workspace:** `devmachine login gh`, then `devmachine sync`. See [credentials](/concepts/credentials/). - **Docker:** `devmachine packages add docker`, then let the workspace use it with `devmachine workspaces edit acme --set 'workspace.groups=[docker]'`, then `devmachine sync`. - **Anything else:** `devmachine packages list` shows what is available. [Packages](/concepts/packages/) says how to add one or write your own. - **Teach your coding agent this CLI:** `devmachine skills add`. See [agent skills](/concepts/agent-skills/). ## Extras - **Show an app at a URL** — anything listening on a port, a dev server or a Docker container. Add a reverse proxy once with `devmachine packages add caddy` and `devmachine sync`, then `devmachine expose add acme 3000 --host app.example.com` puts it on Caddy in seconds. To reach it only from your own computer, with no public URL, use `devmachine tunnel acme 3000` instead. See [publishing](/concepts/publishing/). - **Keep your configuration in git:** `devmachine setup git`. See [versioning your configuration](/how-it-works/versioning-your-configuration/). Real setups, step by step: [guides](/guides/). --- # https://mydevmachine.sh/agent-setup/ This page is for a coding agent — Claude Code, Codex, Cursor or any other — that a person asked to set devmachine up for them. If you are that agent, follow it in order. Talk to the person in their language, ask one question at a time, and never guess an answer only they know. devmachine sets up a machine for the person to code on: a VPS they rent, a Linux server or a Mac they already have, or a virtual machine on their own computer. The machine runs Debian, Ubuntu, Arch Linux or macOS. Each project gets its own account on that machine, called a workspace, with its own tools, logins and coding agent. devmachine runs on the person's own computer and reaches the machine over SSH. ## Rules - **Your shell has no terminal.** A command that asks a question waits forever for an answer you cannot type. Use the flags this page gives, which ask nothing, and hand a question-asking command such as `devmachine setup` to the person. - **Only the person decides what gets installed.** On a Mac, setting up may install the Xcode Command Line Tools, Homebrew or MacPorts, and Ansible. Ask the person which package manager they want, Homebrew or MacPorts, and whether devmachine may install what the Mac lacks. Never choose for them. Pass their answers as `--package-manager brew|ports` and `--install-prerequisites`, and only then. `--yes` never means yes to an install. - **Only the person confirms a server's identity.** A server shows a code called the fingerprint. The person checks it against their provider's dashboard. Pass `--fingerprint` only after they say it matches; never take it from `machines scan` alone, and never answer a fingerprint prompt yourself. - **Only the person types a password or signs in to a service.** When a step needs one, hand them the command. - **Show before you change a machine.** Run `devmachine sync --check`, show the person what it will do, and run `devmachine sync --yes` only after they agree. - **Use commands, not files.** Change the configuration with `devmachine` commands. Never edit `config.yml` by hand. To know where the configuration is, run `devmachine config path` — do not guess a folder. - When something fails, read the error, then check [troubleshooting](/troubleshooting/), before trying anything else. ## 1. Install the CLI Check with `devmachine version`. If it is missing, run: ``` curl -fsSL https://mydevmachine.sh/install.sh | sh ``` On macOS with Homebrew, that installs through the tap (`brew install mydevmachine/tap/devmachine`); otherwise it downloads and verifies the release binary for you. Then install the skills that teach you the whole CLI, naming your own coding agent — `claude`, `codex`, `pi`, `opencode`, `antigravity`, `kimi` or `cline`: ``` devmachine skills add --agent claude --yes ``` Without `--agent` and `--yes` it asks a question for each agent it finds, and you cannot answer it. If your coding agent is none of those, skip this step. The skills take effect only in a new session, so keep following this page either way. ## 2. Ask what you need First ask: **do they have a server, or do they want a machine on this computer?** A machine on this computer is free and nothing to buy, a good way to try devmachine; but the internet cannot reach it, so it cannot show an app at a public URL. Then ask one question at a time. For a server: 1. The server's address — an IP or a hostname. It must run Debian, Ubuntu, Arch Linux or macOS; ask which. 2. How they reach it over SSH: the login, and whether with a key already on the server or with a password. The login is root, or an admin login with passwordless sudo. A Mac has no root login: it needs an admin login with passwordless sudo, and Remote Login on in System Settings > General > Sharing. Only the person can do those two things on a Mac. 3. A name for the server, for example `vps`. 4. Where the server is, for example `hostinger`, `home` or `office`. If they do not say, use `external`. 5. Only if they want an app visible at a URL: a domain, and whether it is at Hostinger, Cloudflare or GoDaddy. Otherwise skip this. 6. Only for a Mac: Homebrew or MacPorts, and whether devmachine may install what the Mac lacks (the Command Line Tools take 5 to 10 minutes). See [what a machine needs](/how-it-works/what-a-machine-needs/). For a machine on this computer: 1. A name for it, for example `sandbox`: lower-case letters, digits and dashes. 2. Where it is. A VM on this computer is `local`; take another name, such as `laptop`, only if they give one. For both: 1. A name for the first workspace, for example the project they will work on. 2. Do they want a coding agent inside that workspace? Claude Code is a package called `claude-code`. ## 3a. A machine on this computer It needs [Lima](https://lima-vm.io), which runs the virtual machine. Check with `limactl --version`. If it is missing, install it with `brew install lima`; without Homebrew, follow [Lima's install guide](https://lima-vm.io/docs/installation/). Tell the person what the machine takes: Ubuntu 24.04 with 2 CPUs, 4 GiB of memory and a 20 GiB disk. The first run downloads the image and boots it, which takes a few minutes. Then run: ``` devmachine machines create-local --add --location ``` This creates the VM and adds it in one step, with no questions: it logs in with the VM's root password (public on purpose — the VM holds nothing real), installs a key, proves it, turns password login off, and writes the machine to the configuration. There is no fingerprint to check here: the VM answers only on this computer, a moment after this command made it. Go on to [step 4](#4-check-the-machine). ## 3b. A server Read the server's fingerprint, without logging in and without trusting it: ``` devmachine machines scan --address
``` Show the person the `SHA256:…` it prints and ask them to compare it with the one in their provider's dashboard or console. Go on only when they say it matches. **If their own key already logs in**, add the server yourself. Find the key's fingerprint with `ssh-add -l` and pass it as `agent:`, or pass the path of its private key file instead. Pass `--user ` when the login is not root, as on every Mac: ``` devmachine machines add --address
--name \ --fingerprint SHA256:… --key agent:SHA256:… --location \ [--user ] [--domain ] ``` On a Mac, add the person's answers: `--package-manager brew` or `--package-manager ports`, and `--install-prerequisites` only if they said yes to the install. Without it, a Mac that lacks something stops before anything is installed, and the error names what is missing. **If only a password logs in**, the password must not pass through you. Hand the person the command, to run themselves after copying the password — in Claude Code they can type it after `!` in this session: ``` pbpaste | devmachine machines add --address
--name \ --fingerprint SHA256:… --location --password-stdin \ [--domain ] ``` `pbpaste` is macOS; on Linux, `xclip -o -selection clipboard` does the same. Either way, `machines add` asks nothing: it installs the key (a new one of the CLI's own when `--key` is left out), proves it works, turns off password logins, installs Ansible (on a Mac, through Homebrew or MacPorts), gives the machine the `essentials` package, and writes SSH host entries so `ssh -devmachine` and `mosh` work from any terminal and from an editor like VS Code Remote-SSH. Add `--tailscale` only if the person wants to reach the machine over Tailscale too. `--domain` is accepted only for the first machine. `--location` only says where the machine is, so a view such as the macOS app's network map can group machines by place; it changes nothing about how the CLI reaches it. To change it later, run `devmachine machines edit --location `. See [where a machine is](/how-it-works/machine-location/). **A person at a terminal of their own** can run `devmachine setup` instead: it asks the same questions one by one, shows the fingerprint to check, and on a Mac asks which package manager to use and whether to install what is missing. That is the right command for a person, not for you. ## 4. Check the machine Run `devmachine doctor`. Every line should pass or warn; fix a warning about SSH aliases with `devmachine aliases --write`, and a missing credential with the `devmachine login` command it names. On a Mac, read `devmachine --format json doctor --machine ` before you run `setup` again or `sync`. Each `prerequisite: ` entry of `checks[]` is something the Mac still lacks. Tell the person what is missing, ask before you install it (`devmachine setup --install-prerequisites`), and name the steps only they can do: Remote Login, passwordless sudo, and "Allow full disk access for remote users" when a package needs it. The machine starts with the `essentials` package: base tools, git, a firewall, Caddy, and `devmachine-app`, what the macOS app reads from a machine. If they asked for a bare machine, add `--no-essentials` to `create-local --add` or `machines add`; if they then use the macOS app, add it alone with `devmachine packages add devmachine-app --machine `. `essentials`, `firewall` and `caddy` run on Linux only, and `sync` refuses them on a Mac before it changes anything. You do not need to do anything about it: when `machines add` finds a Mac, it starts it with `base`, `devmachine-app` and the package manager package (`mac-brew` or `mac-ports`) instead of `essentials`, and says so. With `--no-essentials` it starts with the package manager package alone. ## 5. Create the workspace ``` devmachine workspaces new devmachine packages add claude-code --workspace devmachine sync --check ``` Skip the `claude-code` line if they wanted no coding agent. With more than one machine configured, add `--machine ` to each of these. Show them the plan, and once they agree run `devmachine sync --yes`. The first sync takes a few minutes. ## 6. Sign in to GitHub If they use GitHub, hand them `devmachine login gh`. It opens a terminal on the machine with GitHub's own sign-in page, which only they can finish. Then run `devmachine sync --yes`, which copies that login into every workspace that uses GitHub. ## 7. Hand it back Tell them to enter the workspace with `devmachine ssh `, or with `ssh -devmachine` from any terminal or editor. If they asked for a coding agent, they run `claude` there once to sign in. Offer what they may want next, each in one short line: [guides](/guides/) — a site with its own domain and HTTPS, a Docker app, Claude Code opened from the phone, an agent in its own workspace. On a machine on this computer, an app is seen through `devmachine tunnel ` instead of a URL. --- # https://mydevmachine.sh/day-to-day/ Once your server is set up, you rarely type devmachine commands yourself. You ask your coding agent, from whatever you are working on. ## Teach your agent once ``` devmachine skills add ``` This installs the devmachine skills for Claude Code, Codex and the other agents on your computer. From then on, any new session knows the CLI, in any folder. See [agent skills](/concepts/agent-skills/). ## Ask from where you work The CLI always finds your configuration, whatever folder a session was opened in. So from a session in your project you can ask: - "Publish port 3000 of the acme workspace at app.example.com." - "Add Docker to acme and sync." - "Why did the last sync fail?" - "Open a tunnel to port 5432 on acme." There is no need to switch folders or open another session. ## Open a session in the configuration folder to change devmachine itself Your configuration is a folder on your computer. Find it with: ``` $ devmachine config path /Users/you/.config/devmachine (from default) ``` Open a coding agent there when the configuration itself is the work: - **Writing or changing a package of your own.** Its files live in `packages/`, and the agent can read, test and commit them. - **A change across many machines or workspaces**, or a review of the whole setup. - **Reading the history.** With [git set up](/how-it-works/versioning-your-configuration/), every change the CLI makes is a commit. - **Your own rules.** `setup` writes an `AGENTS.md` here the first time it writes a configuration. Edit it: what your agent must know about your setup, which machine is production, what to ask before touching it, notes about your network. Codex, Pi, OpenCode, Antigravity CLI, Kimi Code, Cline and Claude Code (with a recent enough version, or its skills) all read it in a session opened here. An older Claude Code that only reads `CLAUDE.md` picks it up too, with a one-line `CLAUDE.md` here containing `@AGENTS.md`. In short: to use devmachine, ask from where you are. To change devmachine, open a session in its folder. ## What a session on the server can do Your configuration and the CLI live on your computer, not on the server. A coding agent running inside a workspace can build, test and run your app, but it cannot publish a port or add a package. Ask for those from a session on your computer. --- # https://mydevmachine.sh/upgrade/ devmachine has three things that can be out of date: the CLI on your computer, the packages release your configuration pins, and the skills that teach your coding agent the CLI. One command brings all three up to date: ``` devmachine update ``` Then it checks your machines and shows what a sync would change. Nothing on a server changes until you say yes. ## What you see ``` $ devmachine update ==> 1/5 CLI 0.7.17 → v0.7.18 upgrading through Homebrew ... starting the new version for the remaining steps ==> 1/5 CLI updated: 0.7.17 → 0.7.18 ==> 2/5 Packages packages v16 → v17 updated: v16 → v17 ==> 3/5 Skills use-devmachine from packages v17 for claude updated: 1 filesystem change(s) ==> 4/5 Doctor machine main: pass configuration machine "main", 1 address(es), admin root, port 22, 1 workspace(s) pass host key SHA256:... at 203.0.113.10 pass connection connected through 203.0.113.10 ... ok: 1 machine(s) ==> 5/5 Sync check main: 3 change(s) would be made ~ zsh : Install zsh ~ workspace : Create the account ~ workspace : Write the SSH keys Apply these changes with sync? [y/N]: n Nothing was applied. To apply it later: devmachine sync skipped: not applied; run `devmachine sync` Summary cli updated (0.7.17 → 0.7.18) packages updated (v16 → v17) skills updated (1 filesystem change(s)) doctor ok (1 machine(s)) sync skipped (not applied; run `devmachine sync`) ``` The five steps: 1. **The CLI.** With Homebrew, through `brew upgrade`; otherwise from the release archive, checked against its published checksum. The new version then runs the other steps. 2. **The packages.** Pins the newest release when yours is older — see the [releases page](https://github.com/mydevmachine/packages/releases) for what changed. Only `config.yml` changes. 3. **The skills.** Refreshes every skill your coding agents use, from the release just pinned. Skills only affect new sessions; one already running keeps what it loaded at the start. 4. **Doctor.** Checks every machine. A problem is shown and does not stop the update; a machine it cannot reach skips the last step. 5. **Sync check.** A dry run on every machine it reached, listing what would change, then one question. Answer `y` to apply it now. With more than one machine, `--machine ` limits steps 4 and 5 to that one. `--skip-cli` and `--skip-packages` leave those alone. `--yes` answers the question for you — only for automation you trust to change servers. `--cli-only` updates the CLI and stops there: nothing else is read or changed. The Devmachine app's "Update CLI" button runs it. `--no-machines` updates the CLI, the packages pin and the skills, and stops before doctor and the sync check: your computer only, no question. Without a terminal (a cron job, a pipe) `update` never asks and never applies: it prints the `sync` command to run later. How and why each step works: [Updating](/how-it-works/updating/). Every flag: [`update`](/reference/commands/#update). ## Knowing when to update When you upgrade the CLI with `brew upgrade` or the app, the packages pin stays where it was. After `sync`, `doctor`, `machines list` and `workspaces list`, a line says when a newer packages release is out, at most once a day: ``` packages v33 is out (you pin v32): run devmachine update ``` `devmachine packages outdated` answers the same question on demand. `DEVMACHINE_NO_UPDATE_HINT=1` turns the line off. `devmachine doctor` warns when the CLI or the packages pin is behind: ``` warn cli this is 0.7.17, and v0.7.18 is out: run `devmachine update` warn packages pin pinned v16, and v17 is out: run `devmachine update` ``` ## By hand `update` only runs commands you can run yourself, one at a time: ``` brew update && brew upgrade mydevmachine/tap/devmachine # or: curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine packages pin devmachine skills update devmachine doctor devmachine sync --check devmachine sync ``` With more than one machine, add `--machine ` to `sync`; `doctor` checks every machine unless you name one. The lock file records exactly which package release each machine is running, so `sync --check` always compares against what is really there, not against what you last typed. ## Adding the essentials to an older machine A machine set up before the `essentials` package existed has none of it: `base`, `git`, `firewall`, `ssh_hardening`, `caddy`, `devmachine-app`. Add it without rebuilding anything — what is already installed stays as it is: ``` devmachine update devmachine packages add essentials devmachine sync ``` ## If you like, check the server's identity first ``` devmachine machines trust --check ``` compares the SSH host key devmachine expects against the one the server presents, without writing anything. Read the `status` it prints (`matching`, `changed` or `missing`); it exits 0 either way. Worth running before a `sync` you are not fully expecting, on a server you have not touched in a while. ## Nothing changes on a server until you run sync `update` (when you answer no), `packages pin`, `packages add`, and `workspaces edit` all edit `config.yml` only. The server keeps running exactly what it was running until `devmachine sync` applies the change — so pinning a new package release today and running `sync` next week is fine; nothing happens in between. Source: [devmachine releases](https://github.com/mydevmachine/devmachine/releases), [packages releases](https://github.com/mydevmachine/packages/releases) --- # https://mydevmachine.sh/supported-systems/ devmachine deals with two kinds of computer, and they have different lists: - **Your computer** runs the CLI (and, on a Mac, the app). It sends commands over SSH and keeps your configuration. - **A machine** is what the CLI sets up: a VPS, a server at home, a Mac, or a virtual machine. Ansible runs there, and your workspaces live there. The two can be the same computer: see [your computer as a machine](/how-it-works/your-computer-as-a-machine/). ## Your computer | System | What runs there | | --- | --- | | macOS | The CLI and the [macOS app](https://mydevmachine.sh/app/) (macOS 14 or later). | | Linux | The CLI. | | Windows | The CLI, inside WSL 2 (tested with Ubuntu 24.04). Not in PowerShell or cmd. | The CLI needs only `ssh` beside it. Ansible never runs on your computer. ## The machines | System | Tested on | How Ansible gets there | | --- | --- | --- | | Debian | 12 | `setup` runs `apt-get install ansible`. | | Ubuntu | 24.04 | `setup` runs `apt-get install ansible`. 22.04 is accepted but not tested: its apt Ansible is older than ansible-core 2.14, the oldest the packages are checked against. | | Arch Linux | rolling | `setup` runs `pacman -S --needed ansible`, never a partial upgrade. | | Arch Linux ARM | — | The same path as Arch Linux. Accepted, but not tested as much. | | macOS | 15 on Intel, 27 on Apple Silicon | The `mac-brew` or `mac-ports` package installs the Command Line Tools, Homebrew or MacPorts, then Ansible, after you agree. Older macOS versions are not tested; on a Mac that cannot update past them, MacPorts supports older releases than Homebrew does. | `setup`, `machines add` and `doctor` ask the machine what it runs before they change anything, and stop on a system that is not in this list or [based on one in it](#based-on-debian-ubuntu-or-arch-accepted-not-tested). See [it checks what the machine runs first](/how-it-works/trust-bootstrap/#it-checks-what-the-machine-runs-first). ## What works on each | | Debian, Ubuntu | Arch Linux | macOS | | --- | --- | --- | --- | | `setup`: install and prove a key | yes | yes | yes | | Password login turned off | yes | yes | yes, with an sshd drop-in | | Login it starts with | root, or an admin with passwordless `sudo` | the same | an admin with passwordless `sudo`; a Mac has no root login | | Workspaces | yes | yes | yes, with Remote Login on | | `essentials` | yes | yes | no: a Mac starts with `base` and `devmachine-app` | | `firewall`, `fail2ban`, `ssh_hardening`, `caddy`, `docker`, `tailscale` | yes | yes | no, Linux only | | `claude-remote-control`, `hostinger` | yes | yes | no, Linux only | | `mac-brew`, `mac-ports`, `mac-mise` | no | no | yes, macOS only | | Every other package | yes | yes | yes | Each package says where it runs in [`platforms`](/reference/package-format/#platforms). `sync` refuses a package that leaves out the machine's system, before it changes the machine. On a Mac, Remote Login can allow only some users. Then macOS keeps the list in the group `com.apple.access_ssh`, and `sync` adds each workspace account to it, so you can log in to the workspace. See [Remote Login set to "Only these users"](/how-it-works/what-a-machine-needs/#remote-login-set-to-only-these-users). A workspace works with any login shell: zsh, bash or plain sh. From packages v37 on, the `workspace` package keeps the tools on `PATH`, `mise` and the workspace's secrets in `~/.devmachine/shellenv`, and makes every shell read it. The `zsh` package adds the tmux session on login. One limit on a Mac: its bash 3.2 reads no startup file for a command piped into `ssh -T` or run with `su - -c`, so those see a bare environment. ## What a machine needs first - SSH you can reach. On a Mac: System Settings > General > Sharing > Remote Login. - A login with passwordless `sudo`, or root on Linux. - On a Mac: the Xcode Command Line Tools and Homebrew or MacPorts. The CLI installs them only after you say yes, or with `--install-prerequisites`. `--yes` never installs them. The full list, and why installing needs its own yes, is in [what a machine needs](/how-it-works/what-a-machine-needs/). ## Python Ansible is written in Python, and recent ansible-core needs Python 3.11 or later where it runs. You never install it yourself: - On Linux, the system's `ansible` package brings the Python it needs. - On a Mac, the Ansible from Homebrew or MacPorts brings its own Python. The Python that comes with macOS (3.9) is too old, and devmachine never uses it to run Ansible. ## Based on Debian, Ubuntu or Arch: accepted, not tested A distribution based on one of the systems above — Manjaro, EndeavourOS, CachyOS, Linux Mint, Pop!_OS and the like — is accepted, and nobody has tested it. When `ID` in `/etc/os-release` is not in the table, the CLI reads `ID_LIKE`, the list of systems the distribution says it is based on, closest first. The first one in the table decides: `arch` sets it up with pacman, `ubuntu` or `debian` with apt. `setup` says so: ``` 203.0.113.10 runs manjaro, which is based on arch: it is set up the arch way, but devmachine is not tested on it. ``` `doctor` shows the same sentence as a warning on its `operating system` check. The packages then follow what Ansible itself reads on the machine. A derivative that renames or leaves out a package its base has can still make a package fail where it works on the base. Raspberry Pi OS calls itself `debian`, so it is set up as Debian, with no warning. ## Not supported yet Fedora, Rocky Linux, AlmaLinux, CentOS Stream, Amazon Linux, openSUSE, Alpine, FreeBSD and any other system that is not, and is not based on, one in the table are not supported yet. `setup` stops before the first change with: ``` this CLI does not set up "fedora" yet: it supports debian, ubuntu and arch, and systems based on them ``` ## Guides Most [guides](/guides/) were tested on Debian and Ubuntu. Each one says what it needs at the top. A guide that uses a Linux-only package, such as `caddy` or `docker`, needs a Linux machine. ## Writing a package for several systems How one package runs on Debian, Ubuntu, Arch Linux and macOS, and the traps the built-in packages hit, is in [one package on many systems](/how-it-works/packages-on-many-systems/). --- # https://mydevmachine.sh/changelog/ What changed in each release of the CLI and the macOS app, newest first. App releases are headed `App vX.Y.Z`. Only changes you can see are here; tests, CI and internal work are left out. The full list of commits for each CLI version is on the [GitHub releases page](https://github.com/mydevmachine/devmachine/releases). To get the latest version, see [Upgrade](/upgrade/). ## App v0.12.0 — 2026-11-05 ### Changed - A file opened from ⌘P or the Files tree is a tab in the strip above the terminal, and shows in the terminal's place, the way a session tab shows its terminal. Before, it opened in a pane beside the terminal with a tab strip of its own. The session tab brings the terminal back as it was; another session, or Home, puts the file away and its tab waits. Closing the file tab on screen moves to its neighbour, as closing a session tab does. The pane beside the terminal keeps the preview tabs only. - The viewer keeps what the last 8 tabs read, so coming back to a file is instant; Reload reads it again. ### Fixed - Opening a large markdown file froze the app for seconds; the same for large text and code. The viewer now lays a file out in pieces as they come on screen: 130 KB of markdown opens in about 100 ms, and 1 MB the same. - Copying from a terminal brought text nobody could see, from when the pane had been wider. Lines are cut to the pane's width when it changes and before a copy. ## v0.18.0 — 2026-11-03 ### Added - `dns add` takes every record type a site needs: `MX`, `SRV`, `NS` and `CAA` join `A`, `AAAA`, `CNAME` and `TXT`. A value is written the way a zone file writes it, `10 mail.example.com` for MX or `10 5 5060 sip.example.com` for SRV, and is checked before any provider is asked. - `dns add --append` adds a value next to the ones a name already holds, for two mail servers or a round-robin, and says what it sits next to. Without it `dns add` still makes the name hold exactly the one value, and says what it replaces. - `dns add --ttl` sets how long a resolver may cache the record. - `dns list` shows every record type in the zone, not only the four the CLI could write. - The Hostinger, Cloudflare and GoDaddy provider packages carry all of this; a provider from before `--append` is refused for it with a note to run `devmachine update`. ## App v0.11.0 — 2026-10-27 ### Changed - The tab strip above the terminal shows only the tabs of the workspace you are in. A session of another workspace brings that workspace's tabs; Home shows none. The other tabs stay open and come back with their workspace. - ⌘W closes the tab on screen and nothing else: the session keeps running, the same as the tab's ×. With a file open beside the terminal, ⌘W closes that file's tab first. Ending the session is now ⇧⌘W, or End Session… in the Session menu, the sidebar and ⌘K. Before, ⌘W asked to end the session while × only hid the tab, which read as two different closes. ## App v0.10.2 — 2026-10-24 ### Fixed - ⌘ and a click on a web address in a terminal often did nothing. The app only opened addresses a program had marked as links, and a multiplexer loses that mark as soon as it repaints the screen, so the same address worked one moment and not the next. A firm press on a trackpad swallowed the click too. Now ⌘ or ⌥ and a click opens any address on screen, in a local session and on a server, and a plain click still reaches the program under it. ## App v0.10.1 — 2026-10-22 ### Fixed - After the Mac wakes, 1Password's SSH agent is locked and every login fails with "agent refused operation" or "communication with agent failed". The app read that as the machine refusing the login, stopped asking until Retry, and filled the sidebar with "The server refused the login" cards while the sessions were running fine. It is now one quiet card for the whole sidebar: nothing turns red, the sessions you had stay listed, and the machines are asked again on their own when you come back to the app, when the network returns, or after three minutes. ## App v0.10.0 — 2026-10-22 ### Added - Settings → Appearance → Tabs: "Show open sessions and files as tabs". A strip above the terminal lists every session you opened this run, with its coding agent's icon, and every file you looked at from one, plus a + for a new session. Closing a tab only takes it off the strip; the session keeps running. - A click on a workspace's name in the sidebar folds its sessions away and shows how many there are; right-click has Collapse and Expand. The choice survives a relaunch. ### Changed - The sidebar starts with Workspaces, Chats and Schedule as three rows, always on screen, the current one lit. The dropdown is gone; ⌘1, ⌘2 and ⌘3 still switch. The section label under them carries Refresh and +: New session (with New workspace… in its menu), New chat, or New task. - A session's coding agent icon is smaller and sits on the name line, so the branch or folder under the name has the room to itself. ### Fixed - The tabs at the top of the context panel (Context, Preview, Files, Git) and its close button take clicks again. They never did: the panel's list sat over them. ## App v0.9.1 — 2026-10-21 ### Changed - Update and Relaunch now updates the CLI, the packages pin and the skills first, then installs the app and relaunches, all in one dialog. A new app never starts against a CLI that is too old for it. If the CLI update fails, the app is left as it is, and the dialog shows the error and an "Update only the app" button. - While an app update waits, the CLI and packages cards hide, and the app card says what else it will update. ## App v0.9.0 — 2026-10-21 Needs packages v57 to offer GoDaddy. Every other change works with CLI v0.17.0. ### Added - Publish shows a full page to pick a DNS provider when a machine has none and nothing is published yet: Cloudflare, GoDaddy, Hostinger, and any provider a later packages release adds. Pick one, paste its token, and the app installs it, syncs it and delivers the token. - Settings → DNS providers: every provider on each machine with its state. Replace a token, set Hostinger's zones, push again, or remove a provider. Publish has a DNS providers button once one is ready. ### Changed - The Published apps page is now called Publish. - With apps already published and no DNS provider, Publish keeps the list and shows a Set up DNS bar above it. - Saving a provider's token asks before it syncs the machine. - Removing a provider keeps its token when another machine still uses it. ### Fixed - Setup finishes before Home opens, and Home asks to finish setup when the CLI is missing. ## v0.17.1 — 2026-10-21 ### Added - GoDaddy as a DNS provider: `packages add godaddy` (packages v57). A Personal Access Token that may read your domains and change their DNS records is enough. ## App v0.8.0 — 2026-10-20 Needs CLI v0.17.0 for the CLI's log in Help → Logs and for the 1Password approval prompt after a wake. With CLI v0.16.0 everything else works. ### Added - Help → Logs opens the app's log, the CLI's log, or saves every log in one zip to attach to a report. The app always keeps a log, with secrets taken out, at `~/Library/Logs/Devmachine/app.log`. ### Changed - Add machine reads the server's key by itself. It logs in with a password or an SSH key, and asks for the password right there when the key is refused. - First setup downloads the packages release and checks the machine before it says all set. A failed download is tried three times. Home is never blank after setup. - The window first opens at 1280×800 or larger, so the sidebar and Home fit side by side. ### Fixed - A server that refuses the login no longer gets this Mac banned. The app stops every automatic login to that machine and says so, until you press Retry or change the machine's settings. - After a wake the sidebar waits for the network and shows reconnecting in grey, instead of going red. When 1Password waits for your approval, the app asks you to approve the key. - Home widgets stay on the canvas, keep a usable minimum size, and move when dragged by their top strip. - The top lines of a terminal select text again, instead of moving the window. - Full screen no longer shows a grey band at the top. The sidebar header, workspaces and Context tabs stay at the top of the screen. ## v0.17.0 — 2026-10-20 ### Added - The CLI keeps a log at `/logs/devmachine.log`. A command that changes a machine writes its whole output there, with secrets taken out. When it fails, its last line says where the log is. `devmachine logs path` prints the file's path. See [the CLI's log](/how-it-works/the-cli-log/). - `sessions` answers `login-waiting` when the machine accepted the key and 1Password, or another SSH agent, waits for your approval, as after a wake. It logs in once per machine and user, and keeps that login open while it waits. ### Fixed - `setup` writes `config.yml` only once the key logs in. A run that stops before that leaves nothing behind that keeps retrying a refused key. - "connection refused" from a machine that answered before now says the server may be blocking your address after failed logins (fail2ban). See [troubleshooting](/troubleshooting/#connection-refused-on-a-machine-that-answered-before). ## App v0.7.4 — 2026-10-19 ### Fixed - The app no longer crashes after you send a message from the quick chat panel (⌃⌥Space). The panel no longer shows tooltips; the main window keeps them. ## App v0.7.3 — 2026-10-16 Needs CLI v0.16.0 and packages v55 for Finish setup. v0.7.1 and v0.7.2 were never published. ### Fixed - The quick chat panel (⌃⌥Space) grows with the app's font size, instead of cutting its card at both sides. - Scheduled: Run now shows the task as running in the list and the sidebar right away, and its result when it ends, without a refresh. - Scheduled: setting up a workspace for the first time shows its real steps above the New task sheet, and says it only happens once. - Scheduled: a setup that fails shows what failed, with Try again, and a workspace whose setup did not finish offers Finish setup. - A workspace whose first sync is running shows one quiet line in the sidebar instead of the card asking for a sync. - An update could lose part of the command's output while reading it. ## v0.16.0 — 2026-10-16 ### Added - `devmachine sync --workspace ` applies one workspace — its packages, skills, shared logins, extensions and routes — on the machine it lives on, and leaves the machine's own packages and the other workspaces alone. On a machine with many workspaces it takes minutes instead of half an hour. See [syncing one workspace](/how-it-works/syncing-one-workspace/). ### Fixed - `scheduled` reports a setup that did not finish (the package is on the workspace but its program is not on the machine) as `setup-incomplete`, with the command that finishes it, instead of a raw shell error. `scheduled add` finishes such a setup on its own. - A failed sync names the first task that failed and its message, without repeating the whole shell command. ## App v0.7.0 — 2026-10-16 Needs CLI v0.15.0 for chats and Ask, and packages v54 for the Ask widget. With an older CLI the app asks you to update it. ### Added - Chats: a fast chat with the Claude or Codex you are already logged in to, on any workspace or this Mac. No API key: it uses your own subscription. Chats are read only. Pick the coding agent and the workspace for each chat; the list keeps them by day, with search, rename and delete. - Quick chat from any app: press ⌃⌥Space for a floating panel, type, and the answer streams right there. ⌘↩ opens it in the app. The shortcut can be changed in Settings → Chats. - Ask, in a session's Context tab after Links: ask a side question about the running session without typing into it. Each question reads what the session just did. Clear deletes the thread. - The sidebar title is now a menu: Code (⌘1), Chats (⌘2) and Schedule (⌘3). Schedule lists your scheduled tasks in the sidebar. - New session and New chat rows at the top of the sidebar (⌘N). - Chats start Claude in the background while you type, and show what is happening ("Connecting to…", "Starting Claude…", "Claude is thinking…"). MCP servers are off by default for speed; the MCP chip turns them on. - A tool Claude refused for lack of approval shows as a blocked line. - [Keyboard shortcuts](/reference/app-keyboard-shortcuts/) for the whole app, also listed under ⌘? in the app. ### Changed - A taller title bar: the sidebar toggle sits on the window buttons' line, and Home's wallpaper runs to the top edge. - The Context, Preview, Files and Git tabs sit on the window buttons' line. - Scroll bars are thin and show only while scrolling, everywhere in the app. - Menus for the mode, coding agent and workspace work with the keyboard and VoiceOver. ## v0.15.0 — 2026-10-16 ### Added - `devmachine chat`: chat with the Claude or Codex you are already logged in to, on a workspace or on this computer. No API key: it runs your own subscription. Chats are read only. `send`, `list`, `show`, `rename` and `delete`, with answers streamed as JSON lines. A chat without a project runs in `~/chats` on your default workspace. See [chats](/how-it-works/chats/). - `devmachine chat session` keeps Claude running between messages, so a follow-up starts answering in about 2 seconds instead of waiting for Claude to start again. The macOS app uses it. - `devmachine chat ask --session S`: ask about a running coding session without typing into it. Every question reads the session's current transcript, so it sees what the session just did. `--serve` keeps it warm. - Chats start without MCP servers, hooks and plugins, which makes them several seconds faster. `--mcp`, or `config set chat.mcp true`, turns them on. - New settings: `chat.default_workspace`, `chat.folder`, `chat.harness` and `chat.mcp`, set with `devmachine config set` and `unset`. - Widget engine 1.8: the `ask` widget, after Links in the session's Context tab. ## App v0.6.0 — 2026-10-16 Needs CLI v0.14.0 and packages v53 for scheduled tasks. With an older CLI the Scheduled page asks you to update it. ### Added - Scheduled: a page for tasks that run on their own in a workspace, on a schedule, with this Mac off. A task runs a shell command, or a prompt for Claude or Codex with the model and permission mode you pick, in the folder you choose. Create, edit, pause, delete and Run now, with each run's status and output. Open it from the clock in the sidebar, the menu bar or the palette. The first task in a workspace sets it up for you. See [scheduled tasks](/how-it-works/scheduled-tasks/). - Settings → Machines and the Packages picker show each machine's system, and a package shows the systems it runs on; one that does not run on a machine's system cannot be added to it. - The font size in Settings previews live while you move the slider. ### Fixed - A workspace that was never synced is not asked for its sessions, and a refused login pauses only that workspace, trying again a little later each time. - Dropping files on the Files tree shows the upload card while it runs, not only the notice at the end. - The sidebar's refresh button asks a machine that did not answer again, instead of doing nothing. ## v0.14.0 — 2026-10-16 ### Added - `devmachine scheduled`: tasks that run on their own in a workspace — a shell command, or a prompt for Claude or Codex — once, hourly, daily, on weekdays, weekly or monthly, in your timezone. `list`, `add`, `edit`, `pause`, `resume`, `rm`, `run` (run now), `runs`, `log` and `harnesses`, all with `--format json`. Each workspace runs its own tasks from one timer, so they run with your computer off. The first `add` in a workspace sets up the new `scheduled` package. See [scheduled tasks](/how-it-works/scheduled-tasks/). ### Fixed - `sessions` lists a Mac's tmux sessions when its ssh login sets no UTF-8 locale. Before, the list came back empty and the app closed the pane. - A shared ssh connection that died while the computer slept is dropped after about 10 seconds, instead of making every command wait for minutes. - `sessions` reports a refused login as `login-refused`, not `unreachable`. ## App v0.5.0 — 2026-10-14 Needs CLI v0.13.0 for the remote session indicators and packages v52 for the remote Claude to-do. With older ones, sessions are listed as before, without indicators. ### Added - Each session in the sidebar shows its git branch (or folder) under its name and how long it has run. A remote session shows a spinner while its coding agent works, and an orange dot when the agent rings the terminal bell to ask for you. Settings → Coding agents → Sidebar turns each one on or off. See [session indicators](/how-it-works/session-indicators/). - Auto-connect on startup, off by default: Settings → Workspaces → Edit → App settings. When on, the app connects that workspace's sessions in the background as it starts, three at a time, so they open at once. ### Changed - Every workspace's session list refreshes every 5 seconds through one `devmachine sessions` call, not only the selected workspace. - Names now match across the app and these docs: the session grid (was "Workspace home"), the context panel, coding agents (was "harnesses"), End session (was "Delete") and Published apps (was "Subdomains"). ### Fixed - A Claude session's To-do shows the session's own tasks. It no longer shows the checklist of a plan file the session happened to edit. - The sidebar's + menu lists only the workspaces shown in the sidebar. ## v0.13.0 — 2026-10-09 ### Added - `devmachine sessions` lists every workspace's tmux sessions with their folder, git branch, age, coding agents, and whether each is busy or asks for attention. All workspaces are asked at once; one that cannot answer carries its own error and the others still answer. See [sessions](/reference/commands/#sessions). ## App v0.4.0 — 2026-10-09 Shows download progress with CLI v0.12.0. With an older CLI, downloads work as before, without the progress bar. ### Added - Downloading from the Files tab, or dragging a file to Finder, shows a card with the download's progress until the "Saved to" or error notice takes its place. A folder has no size until its archive ends, so its card says how much has arrived instead. ## v0.12.0 — 2026-10-09 ### Added - `download --progress` writes the bytes received so far to stderr, one JSON line at a time: `{"remote": "...", "done": N, "total": N}`. Every path is sized before the first byte moves, so the first lines carry each total. A folder's `total` is 0. See [download](/reference/commands/#download). ## App v0.3.0 — 2026-10-09 Needs CLI v0.11.0 and packages v49. With an older CLI or packages, a banner in the corner says what to update. ### Added - Share a session. Right-click a workspace session and choose Share…: pick a name, how long (15 minutes to 8 hours) and whether guests only watch or can type. The app publishes the workspace's share server at `share-.` the first time, so the link works for anyone; the password shows once, beside it. Needs the `session-share` package on the workspace. See [Share a session](/guides/share-a-session/). - A shared session has a mark beside its name in the sidebar, orange when guests can type. Its menu has Open chat, Copy share link, Add 30 minutes and Stop sharing. - Chat with the people watching. A Chat tab in the context panel shows what guests write on the shared page, and you answer there; new messages show as a count on the session's mark. - Settings → Shares lists every session this Mac shared, with Stop and Copy link for the ones still open. - ⌘K: "Share …". - Widgets can be as tall as what they show (engine 1.7): on Home, a widget set to auto height follows its content. ### Fixed - Home widgets keep their place, in proportion, when the sidebar hides. - A sidebar row that fits its height no longer widens the panel on every pass and hangs the app. - A widget card in a sidebar keeps the inset of its title instead of touching the edges. - Durations and list errors in a board read exactly as the CLI reads them. ## v0.11.0 — 2026-10-08 ### Added - Widget engine 1.7: a widget can be as tall as what it shows. On Home, `size: auto` keeps the frame to `{x, y, w}` and the height follows the content; a set height is a cap. `widgets add` gives a growing widget `size: auto` on Home. See [the widget format](/reference/widget-format/). - A guide to [sharing a session](/guides/share-a-session/) with the `session-share` package: someone watches, or types into, one of your tmux sessions for a limited time, in a browser or over SSH. ## v0.10.1 — 2026-10-08 ### Fixed - A dry run (`sync --check`) that installs skills no longer fails with `getgrnam(): name not found` on machines with an older Ansible, such as the one Ubuntu 24.04 ships. A real sync was not affected. - Only one sync runs on a machine at a time. A second one, from another terminal or the app's Prepare button, used to delete the first one's files halfway through. It now stops at once with "another sync is running on …". See [One sync per machine](/how-it-works/one-sync-per-machine/). - `packages validate` warns when one of your packages reads `devmachine_account` without setting it first. Such a package can pick up another workspace's account on a machine with several workspaces. The warning says which task to add. ## App v0.2.0 — 2026-10-07 Needs CLI v0.10.0 and packages v41. With an older CLI or packages, a banner in the corner says what to update. ### Added - Widgets on Home, the sidebar, a session's context sidebar and the menu bar. Home is a canvas you drag and resize widgets on; the sidebars are stacks you reorder; the menu bar title shows one widget and the popover shows the rest as tabs. See [Widgets](/concepts/widgets/). - A gallery lists the widgets you can add. "New widget" makes one from five templates: a command, a URL, a web page, a coding harness's answer to a prompt, or a session's screen. - Each widget's menu has Edit…, to change its title, inputs and refresh time, and Choose…, to pick the machines, workspaces or harnesses it shows. - A widget that runs code it did not ship with asks before it runs, and asks again when what it runs changes. - The pull requests panel is a widget on Home and in both sidebars. - A prompt widget can pick its harness's permission mode. A mode that runs without checks shows a red warning and runs only when you press refresh. - Settings can reset Home, each sidebar and the menu bar to their default widgets. ### Changed - The default Home shows what Home showed before, as widgets: the clock, the summary, every machine in a row and one usage card per harness, laid out for the window's size. - Delete and Remove in the sidebar now ask with the same End session dialog as ⌘W. - One workspace whose login is refused no longer pauses every workspace. Only that workspace stops, or its machine when the machine doesn't answer or several of its logins are refused. The sidebar says so under the workspace, with Try again. ### Fixed - A deleted, renamed or new session shows in the sidebar at once, and a late list can no longer bring a deleted session back. - Deleting a session that tmux had already closed no longer shows an error. ## v0.10.0 — 2026-10-07 ### Added - Widgets for the macOS app (engine 1.6). A board lists the widgets for one place: Home, the sidebar, a session's context sidebar, the menu bar title and the menu bar popover. See [Widgets](/concepts/widgets/) and [the widget format](/reference/widget-format/). - `widgets list`, `schema`, `validate`, `add`, `move`, `remove` and `set` read and change boards. Each one answers in JSON with `--format json`. `widgets list --board` shows only the widgets that fit that place. - A package can ship widgets in its `widgets` folder, and declare `providers`: commands its widgets may read on a machine or workspace. - A widget can be written straight into a board, without a package. Its source is a command, a web address, a coding harness's answer to a prompt, or a session's screen. - A widget input can be a choice of machines, workspaces or harnesses, one or many. A board fills it with a name or a list. - A board entry can override its widget's `title` and `every`. `widgets set` changes them, and an empty value puts the widget's own back. - A prompt widget takes `permission_mode`, with the names Claude and Codex use. A mode that runs without checks only runs when you press refresh (`every: manual`). See [A prompt widget's permission mode](/how-it-works/a-prompt-widgets-permission-mode/). - `packages install ` fetches a package from git, shows what it brings and asks before it writes it. `packages update` fetches it again and says what changed; `packages remove` deletes it. - `run --argv` runs a program with its words exactly as given, `run --package --script` runs one file of an installed package, and `--no-log` keeps a run out of the log. ### Changed - `run` exits with the command's own exit code, 255 when it never ran, and stops when it gets SIGTERM. - Over SSH, `run --argv` and `run --package` send the command on standard input to `/bin/sh`, so a fish login shell never reads it. ### Fixed - `run` no longer adds its own error line under a command's own failure. - When SSH tries a machine's addresses, it moves to the next one only when the first never connected. ## v0.9.0 — 2026-10-07 ### Added - A package variable can declare its `type`: `string`, `boolean`, `number`, `list` or `map`, and a list of mappings names its entries' fields with `items.fields`. See [Types](/reference/package-format/#types). - `workspaces edit` and `machines edit` refuse a `--set` that does not fit its variable's type, and `sync` refuses such a setting before it reaches the machine. The error names the setting and the entry, such as `workspace.repos[0]: "url" is required`. - `packages validate` refuses a default that does not fit its own type. - A guide for an old Mac as a machine. ### Changed - `packages list` reports a variable's declared type, and the settings reference names the fields a list's entries take. - Getting started no longer assumes a VPS: a Linux box or a Mac you already have works too. ## App v0.1.22 — 2026-10-07 ### Added - Adding a machine asks what happens to SSH password login once the key works: off for every account, off except the accounts you pick, or left as it is. - Settings → Machines → ⋯ → SSH password login shows which accounts can still log in with a password, and changes it. ### Changed - A new workspace on a machine that has never synced shows one card that asks for the first sync, instead of two cards. - The app calls a workspace an account on its machine, not a Linux account, and picks the packages that fit a machine by its real system. ## v0.8.2 — 2026-10-07 ### Added - `setup` and `machines add` ask before they turn SSH password login off, and can keep it for the accounts you name. `--keep-password-login a,b` answers without a terminal. - `machines password-login ` shows which accounts can log in with a password, and changes it later with `--off`, `--keep a,b` or `--on`. See [Password login](/how-it-works/password-login/). - `machines list`, `machines show` and `config show` report each machine's known system as `platform` in JSON. - With packages v39, `docker` (colima, one VM per workspace), `tailscale`, `claude-remote-control`, `caddy`, `firewall`, `ssh_hardening` and `hostinger` run on a Mac too. ### Fixed - `workspaces new` leaves out a package the machine's system cannot run, and says so. `packages add` and `workspaces edit --add` refuse one before anything is written, instead of failing later in `sync`. - `expose`, `login` and the Caddy reload in `sync` find tools that Homebrew or MacPorts installed on a Mac, and `login tailscale` finds the CLI inside the Tailscale app. ## v0.8.1 — 2026-10-06 ### Added - A distribution based on Debian, Ubuntu or Arch Linux is set up the way its base is: Linux Mint and Pop!_OS like Ubuntu, Manjaro, EndeavourOS and CachyOS like Arch. `setup` says it is not tested, and `doctor` shows it as a warning. Fedora, Rocky Linux, openSUSE and Alpine are still refused. - The [Supported systems](/supported-systems/) page lists every system a machine can run and what works on each. ### Fixed - Sharing a login into a workspace works on a Mac, which has no `runuser`. - `stats` reads a Mac machine instead of failing. - `setup` and `machines add --tailscale` no longer give a Mac the Linux-only `tailscale` package. - The hint to remove an old site by hand reloads Caddy on a Mac too. ## v0.8.0 — 2026-10-06 ### Added - Machines can run Arch Linux or macOS, not only Debian and Ubuntu. `setup` and `machines add` read the system first and refuse one they do not know, before changing anything. - On Arch, Ansible comes from `pacman` without a partial upgrade. - On a Mac, the `mac-brew` or `mac-ports` package prepares the machine: the Command Line Tools, the package manager and Ansible. `--package-manager brew|ports` picks one when the Mac has neither or both, and `--install-prerequisites` agrees to install what is missing. `--yes` never installs them. - A new Mac starts with `base` and `devmachine-app`; `essentials` is Linux-only. - `machines show` prints a machine and what the CLI last observed about it: system, package manager, init system, where Ansible lives. - `run` puts a Mac's package manager on `PATH`, and shows the remote command's errors on stderr. - `doctor` checks a Mac's prerequisites, and warns when a Mac's Remote Login leaves a workspace account out; `devmachine sync` adds the account. - `machines create-local --distro arch` makes an Arch Linux VM for testing. - `--fingerprint` and `machines trust --expect` accept the fingerprint of any of the host's key types, not only the one the CLI negotiates. ### Changed - After turning password login off, `setup` checks with `sshd -T` that it really is off, and takes its change back if sshd ignores it. - `sync` refuses, before changing the machine, a package whose `platforms` leaves the machine's system out. - A workspace package for macOS alone is now accepted. - `machines rm` also forgets what the CLI observed about the machine. - A package directory that is a symlink is followed when it is sent to the machine. ## App v0.1.21 — 2026-10-06 ### Added - With harness icons on, a session that runs no coding agent shows a terminal icon before its name, the same size as the agent icons. - A session running [Herdr](https://herdr.dev/) shows the Herdr icon. ## App v0.1.20 — 2026-10-06 ### Changed - The Operator session asks which coding agent to start every time it starts, not only the first time. Your last pick is selected, so starting it again is one click. Only the first pick asks the agent what you can do here. ## v0.7.32 — 2026-10-06 ### Fixed - Two commands that download the same packages release at once no longer delete each other's copy. `update` could fail on its skills step with `package release v34 has no package named "devmachine-skills"` while the Mac app listed packages at the same moment. ## App v0.1.19 — 2026-10-05 ### Added - The Operator session, the first time you open it, asks which coding agent on your Mac to start in it, or a plain terminal. - Settings → General → Enable Operator session hides the Operator without ending its shell. - A newer packages release gets its own update card. Updating moves the packages pin and your skills, and never touches a machine. ### Fixed - A packages update whose CLI reports nothing now shows as failed, not done. ## App v0.1.18 — 2026-10-05 ### Added - Drag the sidebar into your own order. A workspace's header moves the whole workspace, Local included; a session moves only inside its own workspace. The order survives a relaunch, and hiding a workspace forgets its place. ## v0.7.31 — 2026-10-05 ### Added - `update --no-machines` brings the CLI, the packages pin and the skills up to date and stops there: no doctor, no sync, no question. `--format json` reports each step. - `packages outdated` says which packages release you pin and whether a newer one is out. - A short hint, at most once a day and on the first run of a new CLI version, when a newer packages release is out: `run devmachine update`. `DEVMACHINE_NO_UPDATE_HINT=1` turns it off. ## v0.7.30 — 2026-10-05 ### Added - Each machine has a location — where it is, such as `hostinger`, `home` or `local`. Set it with `--location` on `machines add`, `machines create-local` and `machines edit`; `machines add` asks for it, with `external` as the default. `machines list` shows a LOCATION column, and the JSON output reports it for every machine. ## v0.7.29 — 2026-10-03 ### Added - `--format json` prints workspace defaults, each package's variables and each workspace's login sharing. - `packages list --format json` says whether each declared login can be shared from the machine. ## v0.7.28 — 2026-10-03 ### Added - Skills for the Antigravity, Kimi and Cline agents, linked where each agent looks for them, on your computer and in workspaces. - `machines create-local` takes `--cpus`, `--memory` and `--disk`, checks them against this computer and reports them in its output. ### Fixed - `run` names its SSH control sockets with a short hash, and falls back to `/tmp/dm-`, so a long home path fits the socket length limit. ## v0.7.27 — 2026-10-02 ### Added - `machines add` works without a terminal: - `--password-stdin` installs the key on a server that only takes a password. - `--key agent:` uses a key the SSH agent holds. - `--address` with no `config.yml` writes the configuration `setup` would write. - `machines scan` reports the SSH host key of an address you have not added, and writes nothing. - `machines create-local --add` creates the VM and adds it in one step. - `machines edit` sets and unsets a machine's package settings; `workspaces edit` takes `--unset`. - `machines list --format json` reports each machine's packages. - `packages list --format json` reports each package's kind, category, platforms, needs and declared credentials. - A package manifest can declare the platforms it runs on. - `expose rm` asks before it removes a DNS record. `--keep-dns`, on `expose rm` and `workspaces destroy`, leaves the record. ### Fixed - `expose rm` removes the A record `expose add` made, and leaves a name that now points somewhere else alone. A record it could not remove shows in `dns_error`. - `expose rm --no-apply` prints a `dns rm` that names the serving machine. - `workspaces destroy` removes its sites' DNS records, like `expose rm`. - `machines list`, `config show` and `packages list` answer when there is no `config.yml`, instead of failing. - `machines add` writes the machine, and the host key, only after the key works. A failed run can simply run again. - `machines add` with questions and no `config.yml` sends you to `setup`, which also asks for the domain. - Every command that writes `config.yml` holds a file lock for the whole change, so two edits at once no longer lose one. - Removing several sites asks each DNS provider and lists each zone once. ## v0.7.26 — 2026-10-02 ### Fixed - `credentials push` replaces a rotated value. - `expose add` still publishes the site when the DNS provider refuses the record, and says the record was not written. - Rotation touches only the env files the CLI owns, and never follows a link. ## v0.7.25 — 2026-10-02 ### Added - `expose add --via` publishes a workspace through another machine's Caddy. ### Fixed - `expose` points the name at the machine's first public address, not at a private one listed first. - `expose` refuses a removal that would leave a site served elsewhere without its route. ## v0.7.24 — 2026-10-01 ### Added - `machines add` adds a machine in one command, with no questions, given `--name`, `--address` and `--fingerprint`. - `machines trust --check` reports a changed host key, and `--expect` pins the new one. ### Fixed - System steps run through `sudo -n` when the admin login is not root. - The key is installed when Tailscale SSH let the connection in. - `sshd -t` works on a server whose socket-activated sshd never made `/run/sshd`. - A failed remote command carries its stderr into the error, so a refusal says why. - SSH aliases live in one file, recorded as `ssh_aliases_path`. - `sync --tags` locks only the packages that ran. ## v0.7.23 — 2026-10-01 ### Added - `download` brings files and folders from a workspace to this computer. It never overwrites a file, and sends a folder as one `tar.gz`. - `update --cli-only` replaces only the CLI binary. ### Fixed - `upload` and `download` match a file name a Mac sends in decomposed form (NFD) to the name on the machine. ## v0.7.22 — 2026-10-01 ### Added - `doctor` without `--machine` checks every configured machine, one block each, and fails only when one fails. ### Fixed - `doctor` skips the SSH aliases check when `ssh_aliases` is off. ## v0.7.21 — 2026-10-01 ### Added - `expose add` and `expose rm` apply the workspace's routes to Caddy at once, checked first, instead of waiting for the next `sync`. ## v0.7.20 — 2026-09-30 ### Added - Private networks are resolved, joined and aliased through the package that declares their prefix. ### Changed - `doctor` warns about missing credentials, and fails only when a machine cannot be used. ## v0.7.19 — 2026-09-30 ### Added - `update` updates the CLI, the packages pin and the skills in one command, then checks your machines before any sync. ## v0.7.18 — 2026-09-30 ### Added - `upload` sends local files into a workspace's or a machine's home. - A workspace's own app secrets, delivered as dotenv files. - `doctor` checks SSH aliases by resolving them with `ssh -G`. ### Fixed - Secrets and credentials refuse a path that leaves the workspace home through a symlink. - A secret that moved to another env file leaves the old one on the next push. - `login tailscale` prints the hosts block to paste when it cannot read the tailnet name. - A command's input is never sent again, in part, to another address. ## v0.7.17 — 2026-09-29 ### Added - `setup` and `machines add` ask about SSH aliases and Tailscale. - The CLI keeps SSH aliases up to date after workspace changes and `sync`. - `login tailscale` adds the machine's tailnet name to `config.yml`. - `doctor` warns when the SSH aliases block is missing or out of date. ## v0.7.16 — 2026-09-29 ### Added - `setup` writes an `AGENTS.md` into a new configuration. ## v0.7.15 — 2026-09-29 ### Fixed - `setup` remembers the agent key you chose, not every key the agent holds. ## v0.7.14 — 2026-09-29 ### Added - New machines start with the `essentials` package. `setup --no-essentials` starts bare. - Every workspace gets the `workspace` package first, and it cannot be removed. - Packages have a `category` field. ## v0.7.13 — 2026-09-29 ### Fixed - `sync` reloads Caddy when a site file changes. - `run` says why the server refused the key, instead of trying the next address. ## v0.7.12 — 2026-09-28 ### Fixed - A local command that fails says why. ## v0.7.8 to v0.7.11 — 2026-09-28 No change to the CLI. These releases carry a plainer manual, the new GitHub organisation `mydevmachine`, and the site at mydevmachine.sh. ## v0.7.7 — 2026-09-28 ### Added - Skills install right after `brew install`, before `setup`. ### Fixed - `setup` pins the latest packages release. ## v0.7.6 — 2026-09-28 ### Fixed - `sync` removes what a package left behind when the package leaves the plan. ## v0.7.5 — 2026-09-28 ### Changed - `run` reuses one SSH connection across runs, so it is faster. ## v0.7.4 — 2026-09-28 ### Fixed - SSH aliases get the `-pub` fallback when the first address is literal. ## v0.7.3 — 2026-09-28 ### Fixed - Every `sync` starts from an empty bundle. ## v0.7.2 — 2026-09-28 ### Fixed - Answers go to stdout, where a program reads them. ## v0.7.1 — 2026-09-28 ### Fixed - This computer is never the machine a command picks on its own. - A package needs no credential to be run. ## v0.7.0 — 2026-09-26 ### Added - `skills`: install and manage agent skills on this computer, and keep them in sync in workspaces. - `workspaces edit` changes the default packages for future workspaces. - `expose` keeps a workspace's published routes in the configuration, and `sync` writes them into Caddy. - `expose list` reads the configuration and the machine. - `workspaces destroy` deletes the account, its home and its configuration. - A `self` machine is this computer, set up without SSH. `machines list` says which machine is this computer. - `run` reaches a package's entrypoint as a workspace's account. ### Fixed - `expose list` and `expose rm` work when Caddy is gone from the machine. - `workspaces destroy` refuses when a route's file cannot be found. ## v0.6.3 — 2026-09-24 ### Fixed - `setup` resumes a machine it started to prepare. ## v0.6.2 — 2026-09-23 ### Fixed - A local recipe overrides a released package. ## v0.6.1 — 2026-09-23 ### Added - Host-key trust: the CLI checks the server's identity on every connection, interactive or not, from a trust store kept with your configuration. - `setup` trusts the host before it logs in. - `machines` can trust and rotate a host key on request. - `doctor` reports SSH host trust before it connects. ### Fixed - `setup --yes` never publishes anything; publishing without a terminal needs explicit consent. ## v0.6.0 — 2026-09-22 ### Added - Your configuration can be a git repository. `setup` writes the ignore file first, and every change is committed, but never a path that holds a secret. - `secrets` lists what a machine needs, with no values. - `expose add`, `expose list` and `expose rm` publish a site through Caddy, and point the hostname at the machine first. - `tunnel` reaches a remote port privately over `ssh -L`. - `machine` checks and sets up your own computer. ### Fixed - A tunnel ends with the command. - Whether a commit is signed follows your git configuration. ## v0.5.0 — 2026-09-22 ### Added - DNS: `dns providers`, `dns list`, `dns check`, `dns add` and `dns rm`. The CLI asks the installed providers which one holds the zone. - `run --package` reaches a package, and asks it what it accepts. - `packages` can generate a DNS provider that already meets the contract. - `doctor` reports each DNS provider and the zones it holds. ### Fixed - A package that reads a shared login picks it up in the same `sync`. - `login` reaches a machine the CLI just made. ## v0.4.0 — 2026-09-21 ### Added - Workspaces, each with SSH aliases to reach it. - Package variables, set per machine or workspace, or on the command line. - `credentials`: list what a machine is missing and the command that fixes each one, then push values without them ever reaching a command argument. - `login` runs a package's own login where it has to happen. - Shared logins: one sign-in copied into several workspaces, with a way for a workspace to keep its own. - `doctor` checks every declared credential. ## v0.3.0 — 2026-09-19 ### Added - `setup` finds out whether a key already works, falls back to a password, installs a key, proves it, then turns password login off. - Keys: a dedicated key the CLI makes, or one the SSH agent holds. - `setup` installs Ansible. - `machines create-local` makes a machine on this computer. - `machines add` adds a second machine; `machines rm` forgets one without touching it. ## v0.2.0 — 2026-09-19 ### Added - Packages: read and check `package.yml`, fetch a pinned release and verify its checksum, let a local recipe override a published one. - `packages` lists what exists, and puts a package on a machine or a workspace. - `sync` shows a plan, then applies the packages with Ansible on the machine. - A history of every command that touched a machine. - Writing the configuration back keeps your comments. ## v0.1.0 — 2026-09-18 First release. - `setup` writes the configuration through a wizard. - Machines and workspaces in the configuration; `machines list`. - `doctor`, `stats`, `ssh`, `mosh` and `run`. - Addresses with fallback, over SSH. - Provider tokens in the OS keychain, with a file fallback. - DNS provider interface, and a check of a name from outside. - `help` prints the command surface as JSON. --- # https://mydevmachine.sh/concepts/machines-and-workspaces/ A **machine** is a server, with its own address and login. A **workspace** is one person's account on a machine — usually the thing you actually work in day to day. ``` devmachine workspaces new acme --machine main devmachine sync ``` ## Your computer **Your computer** is the one you run `devmachine` on — usually your laptop. The VPS is never "your computer" in this manual. You can also list your computer itself as a machine, with `self: true`, so the CLI can manage things on it directly, with no address or SSH involved: ```yaml machines: - name: mac self: true ``` This is different from `machines create-local`, which makes a small virtual machine that lives on your computer but is reached like a normal remote server, with its own address and key. See [Your computer as a machine](/how-it-works/your-computer-as-a-machine/) for when to use which. A workspace can't run on a self machine — a workspace is an account reached over SSH, and a self machine has neither an account nor SSH. ## Several machines, several workspaces Each workspace names the machine it runs on: ```yaml machines: - name: main hosts: [203.0.113.10] - name: sandbox hosts: [198.51.100.7] port: 2222 key: /keys/sandbox workspaces: - name: acme machine: main - name: bob machine: sandbox ``` ``` devmachine ssh acme # lands on main devmachine ssh bob # lands on the sandbox ``` Moving `bob` to another machine is one line of configuration; the command you type never changes. `machine:` can be left out only when you have one machine — with several, it's required. ## The account on the machine A workspace's account uses its own name by default: `acme` owns the user `acme`. Give it a different name with `user:`, for when that name is already taken: ```yaml workspaces: - name: bob machine: sandbox user: bob-dev ``` The `workspace` package creates the account: its home, which nobody else can read, the keys you log in with, its groups and its git identity. Every workspace gets it, first, whether its list names it or not, so a package that forgets to wait for the account can never run before the account exists. It cannot be removed; `devmachine workspaces rm` removes the whole workspace instead. Its settings, such as `workspace.groups` and `workspace.git_email`, work like any other package's. ## Making and removing a workspace ``` devmachine workspaces new acme devmachine workspaces new bob --like acme devmachine sync ``` `new` only writes a line in `config.yml` — `sync` is what actually creates the account. A new workspace gets the packages listed in `defaults.workspace`, unless you pass `--packages` or `--like ` to copy another workspace's list. ``` devmachine workspaces rm acme ``` removes the entry from `config.yml`. **The account, its files, and its home folder stay on the machine** — remove those yourself if you want them gone. ## Reaching a workspace by name ``` devmachine aliases --write ssh acme-devmachine ``` writes an SSH shortcut for every workspace into `~/.ssh/config`, inside a marked block it can safely rewrite without touching anything else there: ``` # >>> devmachine — generated, do not edit Host acme-devmachine HostName main User acme ProxyCommand /opt/homebrew/bin/devmachine ssh-proxy main %p HostKeyAlias main-devmachine # <<< devmachine ``` `ProxyCommand` asks devmachine for the machine's address each time ssh connects, so the shortcut keeps working when a private network goes up or down. `HostKeyAlias` keeps SSH from complaining when the same machine is reached at two different addresses — it tells SSH the two addresses are the same known machine. A `-pub` shortcut appears only when there's a second, fallback address to use. --- # https://mydevmachine.sh/concepts/configuration/ Your configuration is a folder of files that lists your machines, your workspaces, and what's installed where. Look at it with: ``` devmachine config show ``` ## Where it is First match wins: | Order | Rule | | --- | --- | | 1 | `--config ` | | 2 | `DEVMACHINE_CONFIG` | | 3 | `$XDG_CONFIG_HOME/devmachine` | | 4 | `~/.config/devmachine` | ``` $ devmachine config path /Users/you/.config/devmachine (from default) ``` Run a second, test setup next to a real one with one variable: ``` DEVMACHINE_CONFIG=~/.config/devmachine-test devmachine doctor ``` ## What it holds ``` /config.yml machines, workspaces, domain, DNS provider /secrets.json names of stored secrets, and values the keychain refused /keys/ keys the CLI generated, and the public half of a chosen agent key /history.log one line per command that reached a machine /logs/ the CLI's own log: what a command printed, and how it ended /cache/config.lock held by whichever command is writing config.yml /state/machines/.json what setup, sync and doctor last read from a machine ``` Two commands that change `config.yml` at the same moment — two `machines add` from a script or an app, an `expose rm` while you run `workspaces edit` — take turns: each holds `cache/config.lock` while it reads the file, changes it and writes it back, and the other waits. Without it, the slower one would write back what it read and silently drop the other's change. The lock is released when the command finishes writing, or dies. The file is rewritten in one step, so a command that only reads never sees half of it, and a `config.yml` that is a link stays a link. ## config.yml ```yaml machines: - name: main hosts: - tailscale:vps # tried first - 203.0.113.10 # the fallback user: root # the account it logs in as port: 22 key: /keys/main # optional; without it the SSH agent serves # agent_key: ssh-ed25519 AAAA... # optional; the one agent key to use instead of `key` location: hostinger # optional; where it is. Left out: external packages: [base, docker, caddy, firewall, fail2ban, ssh_hardening, git] settings: base.timezone: Europe/Lisbon caddy.email: someone@example.com workspaces: - name: acme machine: main packages: [dev, zsh, mise] - name: bob machine: sandbox user: bob-dev # optional; the name is used by default packages: [dev] credentials: gh: own # this one signs in to its own account # What a new workspace gets when no flag says otherwise. `setup` sets this. defaults: workspace: [dev, zsh, mise] # Whether a login is shared across the machine. A workspace may override it. credentials: gh: machine packages: v0.0.1 # the pinned release the packages come from domain: example.com ssh_aliases: true # keep the SSH aliases up to date ssh_aliases_path: ~/.ssh/devmachine-aliases # where they live; ~/.ssh/config when left out ``` `user` defaults to `root`, `port` to `22`. `location` defaults to `external`, or `local` for your own computer (`self: true`); see [where a machine is](/how-it-works/machine-location/). Nothing here is a secret — a token goes in `devmachine secrets`, never in this file. `ssh_aliases` records the answer to the question `setup` and `machines add` ask about writing SSH host entries. Left out, nothing is written automatically — the behaviour every configuration had before this field existed. `devmachine aliases --write` sets it to `true` the first time it runs interactively and you say yes. See [reaching your server](/concepts/reaching-your-server/#ssh-aliases). `ssh_aliases_path` is the one file the aliases are kept in, for a `~/.ssh/config` that something else generates and that `Include`s the aliases from a file of their own. `devmachine aliases --write --path ` sets it. ## Settings A package reads its own settings, each with a default. `settings:` overrides one, on a machine (as shown above) or on a workspace, written `.`: ```yaml workspaces: - name: acme packages: [dev, zsh, claude-plugins] settings: claude-plugins.marketplace: example.com/their-plugins claude-plugins.plugins: [their-plugin] ``` Only the first dot is the split, so `claude-plugins.marketplace.url` is the package `claude-plugins` and the setting `marketplace.url`. A setting is refused, not just ignored, when it has no `.` prefix, or names a package the target doesn't have — so a typo never silently does nothing. ## Credentials A package says how its login works, and whether a copy of it can be shared across a machine. Whether you *want* it shared is your call, set per workspace: ```yaml credentials: gh: machine # the default for this setup workspaces: - name: acme - name: bob credentials: gh: own # bob logs in for himself ``` `machine` means one login, copied into every workspace that wants it. `own` means that workspace signs in for itself. See [Credentials](/concepts/credentials/) for how each kind works, and [Sharing a login](/how-it-works/sharing-a-login/) for what the copy does. ## What is validated `config show`, and every command that touches a machine, refuse a configuration that can't work, and say what to fix: - no machine at all - a machine with no name, no address, or a port outside 1–65535 - two machines, or two workspaces, with the same name - a workspace on a machine that isn't configured - a workspace with no machine when there are several - a setting with no `.` prefix, or for a package the target doesn't have - a credential answer that is neither `machine` nor `own` - a `location` with characters other than letters, numbers, spaces, dots, underscores and hyphens, or longer than 40 ## The command log Every command that reaches a machine appends a line to `/history.log`: when, which workspace or machine, whether it worked, and the command. It's the answer to "what did that session do to my machine" — a plain `ssh` session leaves no such trail here. The format is in [commands](/reference/commands/#the-command-log). `/logs/devmachine.log` keeps more: what a command that changes a machine printed, redacted, and how it ended. It is the file to send when something went wrong. See [the CLI's log](/how-it-works/the-cli-log/). ## Secrets Tokens don't go in `config.yml`. They live in your operating system's keychain: ``` devmachine secrets set cloudflare_token # asks, without echoing devmachine secrets list # names only, never a value devmachine secrets rm cloudflare_token ``` With no keychain — a headless server, a locked-down container — the value falls back to `secrets.json`, readable by nobody else. --- # https://mydevmachine.sh/concepts/packages/ A package adds something to your server or to a workspace: Claude Code, Docker, your GitHub login. Add one with `devmachine packages add `, then run `devmachine sync` to install it. `devmachine packages list` shows what exists. The published packages live at `github.com/mydevmachine/packages`, and you can write your own. ## Which packages exist ``` devmachine packages list ``` lists every package your configuration can use, with a short description of what each one does. `devmachine packages help ` prints what a package accepts, straight from the package itself. ## Server packages and workspace packages A **server package** installs once and serves everyone on the machine — Docker, the firewall, Caddy. A **workspace package** belongs to one person — Claude Code, `zsh`, a dotfiles setup — and can go on as many workspaces as you want. ``` devmachine packages add docker --machine main devmachine packages add claude-code --workspace acme ``` Adding the wrong kind to the wrong target is refused, and says why. ## The essentials `setup` gives a new server one package, `essentials`, which installs nothing itself and pulls in others: `base`, `git`, `firewall`, `ssh_hardening`, `caddy` and `devmachine-app`. `--no-essentials` starts the server bare. A Mac starts with `base`, `devmachine-app` and its package manager package instead, since `essentials` runs only on Linux. See [what a new machine starts with](/how-it-works/what-a-new-machine-starts-with/). ## Changing a package's settings A package reads its own settings, each with a default. Change one on a workspace with: ``` devmachine workspaces edit acme --set caddy.email=you@example.com ``` An empty value, `--set caddy.email=`, removes the override. On a machine, edit `settings:` directly in `config.yml` — see [Configuration](/concepts/configuration/#settings). ## What a package is made of A package is a folder: an Ansible role, the part that installs things, plus one file, `package.yml`, that tells devmachine what the package is. The folder's name is the package's name. ``` sharing/ package.yml what the package is tasks/main.yml what it installs defaults/main.yml the default value of each setting files/ anything it copies to the machine ``` This is a complete `package.yml`, using the fields most packages need: ```yaml format: 1 # the shape of this file name: sharing # same as the folder scope: machine # machine or workspace summary: File sharing, uploads by API key and downloads by public link. category: Web # groups it on the packages page requires: cli: ">= 0.7.0" # the oldest CLI that can run it needs: [docker, caddy] # installed before this one extends: caddy.sites.d: files/sharing.caddy # a site file handed to Caddy variables: port: summary: The port the container listens on. default: 53842 credentials: - name: sharing_api_key # something only you can give it kind: secret scope: machine env: SHARING_API_KEY ``` Only the first four fields are required. The official schema, straight from the CLI: | Field | Required | What it is | | --- | --- | --- | | `format` | yes | The shape of this file. This CLI reads format 1. | | `name` | yes | The package's name, which has to be the directory it lives in. | | `scope` | yes | Where it is installed: "machine" or "workspace". | | `summary` | yes | One line saying what it installs. It is what `packages list` prints. | | `category` | | A word or two grouping it with packages like it, such as "Security" or "DNS". The packages page filters by it. | | `platforms` | | The operating systems it runs on: "linux", "macos", or both. Left out, any. | | `requires` | | Which CLI can run it, written as requires.cli: ">= 0.2.0". | | `needs` | | Packages that have to run before this one. It is the only thing that decides order. | | `provides` | | Places other packages may write into, as : . | | `extends` | | Contributions to another package's place, as .: . | | `variables` | | Values this package reads, each with a summary and a default. | | `credentials` | | What its tool cannot work without, and how each one is obtained. | | `requires_files` | | Files that have to be on the machine before it runs. | | `skills` | | A package-relative directory whose direct children are Agent Skills. | | `kind` | | The contract an entrypoint answers. The only one so far is "dns". | | `entrypoint` | | An executable in the package the CLI can call on the machine. | | `commands` | | What the entrypoint accepts: a list, or ["*"] for anything. | The CLI is the source of truth for this list: `devmachine packages schema --json` prints it, and `devmachine packages validate ` checks a package against it, reporting every problem at once. Each field is explained in full, with its rules, in [the package format](/reference/package-format/). ## Writing your own `/packages/` holds packages you write yourself, in the same format as the published ones, and a package there with the same name replaces an official one. Start one with `devmachine packages new `: it writes a package that already passes `packages validate`. Browse the official ones on the [packages page](https://mydevmachine.sh/packages/) for examples, and read [why packages work this way](/how-it-works/why-nothing-is-embedded/) for the reasoning behind it. ### Packages from other people `devmachine packages install https://example.com/alice/tools.git` brings in a package somebody published in a git repository. It shows what the package brings and asks first. It lands in `/packages/` beside your own, with a `.devmachine-source.yml` saying where it came from; `packages update ` fetches it again and `packages remove ` deletes it. Its widgets that run code ask before they run. See [where a public widget comes from](/how-it-works/where-a-public-widget-comes-from/). --- # https://mydevmachine.sh/concepts/credentials/ A credential is a tool being signed in: `gh`, `claude`, a DNS provider's token. See what's signed in, and what's missing, with: ``` devmachine credentials list ``` ## Three kinds | Kind | Examples | You do it yourself? | | --- | --- | --- | | **manual** | `gh`, `claude`, `tailscale up` | **yes** — a browser or a device code | | **secret** | an API token, an SMTP password | no, the CLI stores it | | **file** | a VPN profile, a kubeconfig | no, the CLI stores it | A manual login can't be done for you. See [why a login can't be automated](/how-it-works/why-a-login-cannot-be-automated/). ## The commands ``` devmachine credentials list what is declared, what is there, and the command that fixes each devmachine login [--workspace w] sit through the tool's own login, in the right place devmachine secrets set hand over a value devmachine credentials push deliver the values and files ``` `credentials list` names, for each row, the exact command that fixes it. ## Your configuration holds no values A value you type goes to `devmachine secrets`, never into a file you'd commit. `devmachine secrets set cloudflare_token` asks for it without echoing it back; `devmachine secrets list` shows only names, never values; `devmachine secrets rm` removes one. ## Sharing a login across workspaces Some tools, like GitHub, work fine signed in once and shared by every workspace. Others, like Claude, need each workspace to sign in for itself. A package suggests which fits its tool, and you can override it per workspace: ```yaml credentials: gh: machine # shared, the default here workspaces: - name: bob credentials: gh: own # bob signs in for himself ``` See [sharing a login](/how-it-works/sharing-a-login/) for what sharing actually copies. ## Where a credential lands - A **machine** credential is copied into every workspace that shares it. - A **workspace** credential lives only in that workspace's own home folder, readable by nobody else. ## A `.env` with several keys One credential is one value. Three keys in one `.env` file are three separate credentials, combined by the package when it writes the file. ## Your app's own secrets A credential above is declared by a package: something a *tool* needs. Your own app's secrets — an API key your code reads, a database password — are not that. Nothing has to declare them: ``` devmachine secrets set STRIPE_KEY --workspace alice ``` This asks for the value the same way `secrets set` always does, stores it under `alice/STRIPE_KEY` in the keychain, and remembers to deliver it on the next `devmachine credentials push` — or right away, with `--push`. By default it lands in `~/.devmachine/env`, a file the workspace's shell sources on login (see [the `~/.devmachine/env` contract](/reference/commands/#the-devmachineenv-file) in the command reference). Give `--env-file` a path instead, relative to the workspace's home, to edit that file directly: ``` devmachine secrets set STRIPE_KEY --workspace alice --env-file app/.env ``` **This edits a real file on the machine.** `credentials push` opens `app/.env` inside `alice`'s home, replaces the `STRIPE_KEY=` line if one is there or appends it if not, and leaves every other line — comments included — exactly as it was. The first time it touches a file that already existed, it keeps a copy at `app/.env.devmachine.bak` next to it, so one bad push is not the only copy of what was there before. To move a secret to another file, set it again with the new `--env-file` (or with none, for the default). The next push takes its line out of the old file before it writes the new one, so the old file does not keep handing out a value nobody manages any more. `devmachine secrets list --workspace alice` shows the name and the target, never the value. `devmachine secrets rm STRIPE_KEY --workspace alice --from-file` removes the stored value and, on the next push, the line from the file too. --- # https://mydevmachine.sh/concepts/dns/ `devmachine dns` points a domain name at your server, so people can reach it by name instead of a bare IP address. ``` devmachine dns add example.com A 198.51.100.10 ``` ## Zone and record A **zone** is a domain: `example.com`. A **record** is one name, one type, and one value: `www.example.com A 198.51.100.10`. `dns add` makes a name hold **exactly** the one value you give it — it replaces whatever was there, and says what it is about to replace before it does. A name that needs several values on purpose — two mail servers, a round-robin of addresses — gets them with `--append`, which keeps what is there and adds one more: ``` devmachine dns add example.com MX "10 mail.example.com" devmachine dns add example.com MX "20 mail2.example.com" --append ``` `--ttl ` says how long a resolver may cache the record. Without it the registrar chooses. ## `@` is the apex `@` means the domain itself, with no `www` or other prefix — the way most registrars write it: ``` devmachine dns add @ A 198.51.100.10 --zone example.com ``` Most of the time you type the full name, like `example.com` or `www.example.com`, and the CLI works out the label on its own. ## Supported record types `A`, `AAAA`, `CNAME`, `TXT`, `MX`, `SRV`, `NS` and `CAA`. A value is written the way a zone file or `dig` writes it, with the numbers inside it: | Type | Value | Example | | --- | --- | --- | | `MX` | ` ` | `10 mail.example.com` | | `SRV` | ` ` | `10 5 5060 sip.example.com` | | `CAA` | ` ` | `0 issue ca.example.net` | The CLI checks the value fits its type before it asks anyone — a priority above 65535, a CAA tag that is not `issue`, `issuewild` or `iodef`, an `A` that is not an IPv4 address — and spells host names one way (lower case, no trailing dot) so the same record typed twice compares equal. `SOA` stays with the registrar. ## A provider is a package Talking to your domain provider — Hostinger, Cloudflare, GoDaddy, or another — is a package, installed with `devmachine packages add` like any other. Until one is installed, `dns add` can't write anywhere, and prints the record for you to create by hand instead. See [DNS providers](/how-it-works/dns-providers/) for what each one does. ## Choosing a zone and a provider A command picks which zone a name falls in, then which installed provider handles that zone. Name one directly with `--dns-provider` to skip the guessing; with two providers claiming the same zone, the CLI asks you to pick. Every command prints which provider it picked, and why. The command asks before it writes. In a script, pass `--publish` to confirm you mean to create public DNS; `--yes` alone never does. ## `dns status` is not `dns list` `dns list` asks your **provider** what's configured, whether or not it has reached the rest of the internet yet. `dns status` instead asks **the internet** directly — it resolves the name and checks its certificate, the way anybody else would see it, with no provider or machine needed. A record can be right in `dns list` and still fail `dns status` simply because it hasn't spread yet. The two answer different questions on purpose. --- # https://mydevmachine.sh/concepts/publishing/ Two ways to reach a port running on a machine: `expose` puts it on the internet, `tunnel` reaches it only from your computer. Neither is the default — you pick based on who should reach it. ``` devmachine expose add acme 3000 --host app.example.com devmachine tunnel acme 5432 ``` ## Which one to use | | Anyone | Only you | | --- | --- | --- | | **HTTP** | [`expose`](/reference/commands/#expose) | [`tunnel`](/reference/commands/#tunnel) | | **Anything else** | nothing | [`tunnel`](/reference/commands/#tunnel) | `expose` only works for HTTP, and only puts up an HTTPS address — nothing else goes on the internet. `tunnel` works for anything, HTTP or not, and never touches DNS. Speaking HTTP doesn't mean "safe to publish". A database viewer, a captured-mail inbox, a queue dashboard that can drain a queue: all three speak HTTP, none has its own login, and none should go through `expose`. Use `tunnel` for those — it looks at the thing from your computer, without ever making it public. ## Where a published app is recorded In `config.yml`, on the workspace, under `routes:`. `expose add` records it there and puts it on Caddy at once, in seconds; `expose rm` takes it off the same way. `sync` writes the same file, so it is also what brings the site back after a rebuild, or publishes it when the machine was out of reach. See [why a published app lives in the configuration](/how-it-works/published-sites/). ## A machine the internet cannot reach A port on a machine with no public address — a VM on your desk, a box behind NAT — is published by another machine that has Caddy: `expose add acme 8080 --host app.example.com --via edge`. Visitors need nothing; only the two machines have to reach each other, over the address the workspace's machine has in `hosts`. See [publishing through another machine](/how-it-works/published-sites/#publishing-through-another-machine). ## Why `expose` asks first `expose add` tells you, before it does anything, that the port becomes reachable by anybody who learns the hostname. In a script, pass `--publish` to confirm that on purpose — `--yes` alone never does. The same rule protects `dns add`. --- # https://mydevmachine.sh/concepts/reaching-your-server/ After `setup`, devmachine reaches your server at its public address, with a key only you have. That is enough to start. This page covers three ways to do more: SSH aliases, so a workspace is reachable by name from any terminal or editor; a private network, so your server is reachable even when the public address is not; and private access to apps you do not want on the internet. ## SSH aliases `devmachine ssh acme` reaches a workspace, but only through this CLI. Tools that dial `ssh` themselves — a plain `ssh acme-devmachine`, `mosh acme-devmachine`, VS Code Remote-SSH, Zed, the macOS app — need a Host entry in `~/.ssh/config`. `setup` and `machines add` ask once whether to write and maintain those entries. Say yes, and the CLI keeps a marked block in `~/.ssh/config` up to date automatically, every time a workspace or a machine changes: after `workspaces new`, `rm`, `destroy`, `edit --machine`, `machines add`, `rm`, and at the end of `sync`. Everything outside the block, written by hand or by something else, is left alone. An alias holds no address. It asks devmachine for one each time ssh connects, so it keeps working when Tailscale goes on or off, and the file only changes when a workspace or a machine does. That needs `devmachine` on your `PATH`; without it, the alias holds the address that works now. See [SSH aliases that resolve when you connect](/how-it-works/addresses-and-fallback/#ssh-aliases-that-resolve-when-you-connect). Said no at the time, or set up before this existed? Turn it on: ``` devmachine aliases --write ``` With `ssh_aliases: true`, `devmachine doctor` checks every workspace alias by asking `ssh -G ` — a local lookup, never a connection — and warns when what it resolves to does not match what `devmachine aliases` would write, with the same fix. It does not care which file the answer came from. `devmachine machine doctor` checks the managed block in `~/.ssh/config`. Manage `~/.ssh/config` yourself instead? Say no to the question, or set `ssh_aliases: false`, and write the block to a file of your own with `devmachine aliases --write --path ` if you want it. Both doctors then report the aliases as `skip managed outside devmachine (ssh_aliases: false)`: the file is yours, so devmachine does not judge it. ## The public address This is what `setup` gives you. Password logins are off, so only your key gets in. Add the `firewall` and `fail2ban` packages to close every port you do not use and to block addresses that keep guessing: ``` devmachine packages add firewall devmachine packages add fail2ban devmachine sync ``` ## A private network with Tailscale [Tailscale](https://tailscale.com) puts your computer and your server on a private network of your own, called a tailnet. Your server gets a private address that only your devices can reach. It keeps working when the public address has trouble, and on a network that blocks SSH. `setup` offers this too, right after it asks about the essentials: say yes, and it adds the `tailscale` package for you — the same as step 1 below. The package runs only on Linux, so `setup` does not ask on a Mac. 1. Add Tailscale to the server, if `setup` did not already: ``` devmachine packages add tailscale devmachine sync ``` 2. Sign the server in to your Tailscale account. This runs the package's own sign-in on the server; finish it in your browser: ``` devmachine login tailscale ``` Once you are signed in, devmachine asks the server for its name on the tailnet and adds it to `config.yml` for you — one line above the public address: ```yaml machines: - name: main hosts: - tailscale:main - 203.0.113.10 ``` The public address stays as a fallback. If the name cannot be read (the package is not installed yet, or something else went wrong), devmachine prints this same block for your machine instead, with `- tailscale:` where the new line goes. `` is what `tailscale status` on the server lists for it. Running your own control server with Headscale? Set `tailscale.login_server` on the machine first — see [Your own Tailscale with Headscale](/guides/headscale/). 3. Install Tailscale on your computer and sign in to the same account. devmachine tries the addresses in order and uses the first that answers. If Tailscale is off on your computer, it skips that line and uses the public address, so you are never locked out. `devmachine resolve` shows the order, and why a line was skipped. See [addresses and fallback](/how-it-works/addresses-and-fallback/). To send your computer's traffic through the server, set `tailscale.exit_node: true` on the machine and sync. ## Any other private network devmachine does not need Tailscale. With any VPN that gives your server an address your computer can reach — WireGuard, ZeroTier, a provider's private network — add that address to `hosts:` the same way, first in the list. Tailscale support is itself a package, not part of the CLI. A package that declares a `network:` block gets the same treatment for its own prefix: `:` entries, `devmachine login `, and fallback when the network is off. See [the network package contract](/reference/network-package-contract/). ## Apps you do not want on the internet A dev server, a database viewer, a mail catcher: these should be reachable by you, not by anyone who guesses a URL. Open a tunnel instead of publishing them: ``` devmachine tunnel acme 3000 ``` The app answers at `localhost:3000` on your computer until you press Ctrl-C. Nothing is published: no DNS record, no open port. See [publishing](/concepts/publishing/) for when to use `expose` instead. --- # https://mydevmachine.sh/concepts/private-networks/ A private network gives your server a second address that only your own devices can reach. It is not a replacement for the public address `setup` gives you — it is a backup that keeps working when the public one has trouble, and a way to reach things you never want on the internet at all. ## Why bother - **You can still get in when public SSH is blocked.** A hotel, a work network, an airport — some of them block port 22 outright. A private address does not go through that path. - **mosh works properly.** mosh needs a UDP range open to the internet to work on the public address, which most people do not want. Over a private network, that range never has to face the public internet at all. - **Private apps stay private.** A database viewer, an internal dashboard, a dev server — reachable by you, without `devmachine expose` and without a DNS record anyone could stumble on. See [reaching your server](/concepts/reaching-your-server/) for the public address this builds on, and [addresses and fallback](/how-it-works/addresses-and-fallback/) for how devmachine picks between several addresses. ## Tailscale, step by step [Tailscale](https://tailscale.com) is supported through the `tailscale` package. The CLI itself knows no network: the package tells it how to turn `tailscale:` into an address, how to join, and what the machine is called — see [the network package contract](/reference/network-package-contract/). `setup` asks about Tailscale right after the essentials, and adding the package is all "yes" does — the sign-in and the private address still need the two steps below. 1. Add the package and sync, if `setup` did not already: ``` devmachine packages add tailscale devmachine sync ``` 2. Sign the server in to your Tailscale account: ``` devmachine login tailscale ``` This runs the package's `join` on the server, in a real terminal — it calls `tailscale up`, and you finish the sign-in in your browser. Once it succeeds, devmachine asks the server for its own name on the tailnet and adds it to `config.yml` for you, above the public address: ```yaml machines: - name: main hosts: - tailscale:main - 203.0.113.10 ``` The public address stays as a fallback. When the name cannot be read — the package failed to install, or something else went wrong — devmachine prints this same block for your machine instead, with `- tailscale:` where the new line goes. `` is what `tailscale status` on the server lists for it. 3. Install Tailscale on your own computer, from [tailscale.com/download](https://tailscale.com/download), and sign in to the same account. devmachine tries `tailscale:main` first and falls back to the public address if Tailscale is not running on your computer — so turning Tailscale off never locks you out. `devmachine resolve` shows which address it will use and why it skipped one. ### Your own control server Set `tailscale.login_server` to your Headscale server's URL before `devmachine login tailscale`, and the join uses it: ```yaml machines: - name: main settings: tailscale.login_server: https://net.example.com ``` See [Your own Tailscale with Headscale](/guides/headscale/). ### Sending your traffic through the server Set the machine as an exit node, so your own internet traffic can route through it: ```yaml machines: - name: main settings: tailscale.exit_node: true ``` ``` devmachine sync ``` The package's `join` also advertises the exit node when this is on, the next time you run `devmachine login tailscale`. An exit node also needs approving once in the [Tailscale admin console](https://login.tailscale.com/admin/machines) — Tailscale will not route traffic through a machine nobody approved for it, even if it is running the setting. ## Closing public SSH — what devmachine can and can't do Once the private address works, it is tempting to close public SSH altogether. devmachine's `firewall` package always allows OpenSSH — there is no setting in it to turn that off. If you want public SSH closed, that is a `ufw` change you make yourself on the server, outside what devmachine manages, and only after you have confirmed the private address gets you in every time. ## Comparing your options | | What it is | Good for | Watch out for | | --- | --- | --- | --- | | **Tailscale** | Hosted, WireGuard-based mesh network | Fastest to set up, works almost anywhere, devmachine resolves `tailscale:` for you | Your traffic's control plane is Tailscale's servers (the data itself is peer-to-peer) | | **Headscale** | Self-hosted, open source Tailscale control server | Full control, no third party in the loop | You run and maintain the control server yourself — see [Your own Tailscale with Headscale](/guides/headscale/) | | **Plain WireGuard** | The protocol Tailscale is built on, configured by hand | No account, no control server, total control | You manage keys and routing yourself — no automatic discovery | | **ZeroTier** | Another hosted mesh network, similar shape to Tailscale | An alternative if you already use it | No package for it yet — add the address to `hosts:` directly, or write a network package | | **Provider private network** | A VPC or private network your VPS provider offers | Often free, no extra software | Usually only reaches other servers from the same provider, not your laptop | Any of these works with devmachine the same way: once your server has an address your computer can reach, add it to `hosts:` — first in the list, so it is tried before the public one. Or write a package with a `network:` block, and `:` entries work for it the way `tailscale:` does. Source: [Tailscale — Download](https://tailscale.com/download), [Tailscale — Exit nodes](https://tailscale.com/kb/1103/exit-nodes) --- # https://mydevmachine.sh/concepts/agent-skills/ Write your agent skills once, in a package in your configuration folder. Every workspace that uses the package gets the same skills on the next `devmachine sync` — Claude Code, Codex, Pi, OpenCode, Antigravity, Kimi Code, and Cline all read them. Your own computer gets them with `devmachine skills add --package `. Edit one skill, sync again, and the change reaches every workspace and your computer alike, from one place. A skill is a folder of know-how your coding agent can read. Add the official set — devmachine's own skills for operating the CLI — with: ``` devmachine skills add ``` See [shared skills for every workspace](/guides/shared-skills-for-every-workspace/) for a full walkthrough with a package of your own. ## One shared copy Devmachine installs skills once, under `~/.agents/skills//`. Codex, Pi, OpenCode, and Kimi Code read that folder directly. Claude, Antigravity, and Cline don't, so each gets a link that points to it, and nothing is duplicated: ```text ~/.claude/skills/ -> ../../.agents/skills/ ~/.gemini/antigravity-cli/skills/ -> ../../../.agents/skills/ ~/.cline/skills/ -> ../../.agents/skills/ ``` Devmachine never replaces a file or folder it didn't create there: if one is already in the way, `skills add` stops and names it. ## Skills on your computer ```bash devmachine skills add # the official set devmachine skills add --package team-skills # skills from your own package devmachine skills list devmachine skills update devmachine skills remove ``` `--package` installs skills from one of your own packages instead of the official set. None of these commands touch a machine. ## Skills in a workspace A workspace gets skills only when you add the package to it, and run `sync`: ```bash devmachine packages add team-skills --workspace acme devmachine sync --tags team-skills ``` A link is added only for a workspace that also has the agent's package: the Claude link with `claude-code`, the Antigravity link with `antigravity`, and the Cline link with `cline`. Removing the package from your configuration doesn't delete files already on the machine. ## Writing your own package of skills A package can add: ```yaml skills: path: skills ``` Every folder directly inside `skills/` must be a complete skill, with its own `SKILL.md`. See [the package format](/reference/package-format/) for the rest of what a package can declare. --- # https://mydevmachine.sh/concepts/widgets/ The app's Home is a canvas of widgets: a clock, a summary of your sessions, your machines, the usage of each coding agent. You move them, resize them, minimize them, and add or remove them. Where each one sits is kept in a plain file, so the app, the CLI and your coding agent can all change it. ## What a widget is A widget is a small file, `widget.yml`, that says two things: where the data comes from, and how the app draws it. It holds no code. The app does the work; the file only picks from what the app offers. ``` devmachine widgets list ``` lists every widget you can use. `devmachine widgets help claude-code/usage` says what one widget takes. ## Widgets come in packages Every widget ships inside a [package](/concepts/packages/), next to the role that installs the tool behind it. `claude-code/usage` is the `usage` widget of the `claude-code` package. The app's own widgets, such as the clock, are in the `devmachine-app` package. A widget that only shows what the app already knows — the clock, your machines, coding agent usage — works without adding its package anywhere. A widget that reads something a package installs needs that package added to a machine and synced first; `widgets list` says so, and names the command. See [why widgets come from packages](/how-it-works/widgets-come-from-packages/). From engine 1.1 a widget can also show the output of a command, a web address, an answer from a coding agent, or a live copy of a session — on your computer, a machine or a workspace. A command, prompt or session widget runs what its package installs, so it needs the package added and synced; a web address needs nothing. See [the widget format](/reference/widget-format/#sources). Your own packages can ship widgets too. Write a `widgets:` folder in the package (see [the widget format](/reference/widget-format/)), then check it: ``` devmachine widgets validate ~/.config/devmachine/packages/my-package ``` A widget in your own package replaces the release's package of the same name, the same way your packages always do. A package can also feed its widgets with one of its own commands — a package provider, such as `devmachine-app/stats` — run on a machine through the CLI. And anybody can publish a package with widgets: `devmachine packages install ` brings it in, and its widgets that run code ask before they run. See [where a public widget comes from](/how-it-works/where-a-public-widget-comes-from/). ## Areas and boards An area is a place in the app that holds widgets. There are five: - **Home**, a free canvas: each widget has a place and a size. A widget that has a natural height (a summary, a list, some text) can follow its content with `size: auto`. - **The sidebar**, on the left: a list, top to bottom. The workspace list is one widget there, so you can put others above or below it. - **The Context tab**, the first tab of the Context panel (the right-hand panel next to a session, with the tabs Context, Preview, Files, Git and Chat): a list too. Each of its sections (shortcuts, publish a port, monitors, shells, sub-agents, to-do, pull requests, links, ask) is one widget. Ask answers a question about the session without typing into it; see [chats](/how-it-works/chats/#asking-about-a-session). - **The menu bar title**, at the top of the screen: up to three short widgets in a row, "❯_" and the number of open pull requests unless you change it. - **The menu bar popover**, what opens when you click it: each widget is a tab, Pull Requests and Usage unless you change it. The sidebar's top bar and footer, and the Context panel's other tabs (Preview, Files, Git, Chat), stay as they are: they are not widgets. Neither is the popover's footer (Open, Stats, Published apps, the color picker, Quit). Each area has a board in `/boards/`: `home.yml`, `sidebar.yml`, `context-sidebar.yml`, `menubar.yml` and `menubar-panel.yml`. Home's board says where each widget is and how big: ```yaml format: 1 surface: home widgets: - id: clock type: devmachine-app/clock frame: {x: 24, y: 24, w: 320, h: 160} size: medium minimized: false z: 1 - id: machines type: devmachine-app/machines frame: {x: 352, y: 24, w: 320} size: auto minimized: false z: 2 ``` `size: auto` has no `h`: the app draws the widget as tall as what it shows, so it is never taller than its content. If you resize it shorter, the height you chose stays, up to the content. See [why a widget is as tall as what it shows](/how-it-works/why-a-widget-is-as-tall-as-what-it-shows/). A sidebar's board is just the list, in order: ```yaml format: 1 surface: sidebar widgets: - id: workspaces type: devmachine-app/workspaces size: auto ``` When a sidebar or menu bar board is missing, the app writes the board that draws that area as it always looked, and the CLI reads a missing one the same way. Settings → Appearance can reset each one. The Context tab hands its widgets the selected session's context: `machine`, `session`, `workspace`, `path` (the session's folder), `repo` and `branch` (from Git), and `harness` (the coding agent). Switching sessions runs each widget again with the new values. A widget written in place that uses them, such as a command reading `{{context.path}}`, asks you to allow it again for each new set of values. The menu bar title runs its widgets whenever the app runs, at most every 30 seconds; the popover runs its own only while it is open. See [what runs in the menu bar](/how-it-works/what-runs-in-the-menu-bar/). Edit a board by hand, from the app, or with the CLI: ``` devmachine widgets add claude-code/usage --set harness=codex devmachine widgets add claude-code/usage --board context-sidebar --after todo devmachine widgets move usage --before shortcuts --board context-sidebar devmachine widgets move usage-panel --before pull-requests-panel --board menubar-panel devmachine widgets remove usage ``` The app sees a change to the file within a second. A board with a mistake is never written over: the app keeps the last good layout and says which line is wrong, and the CLI refuses to change it until it is fixed. A board can also hold a widget written in place, with a title, a source and a view and no package — a quick `df` on a workspace, say. One that runs something waits until you press Allow. See [the widget format](/reference/widget-format/#a-widget-written-in-the-board). ### Changing one copy The same widget can sit on a board twice and look different: each entry may give it its own `title`, its own `every` (how often it runs) and its own input values in `with`. In the app, ⋯ → **Edit…** changes them, and ⋯ → **Choose …** picks from a widget's lists, such as which machines it shows. A widget written in the board is edited the same way, and changing what it runs asks for your approval again. --- # https://mydevmachine.sh/how-it-works/ssh/ SSH checks both sides with different keys. Your key proves who you are to the server. The server's host key proves which machine answered you. ## Your key: how devmachine logs in If a machine has a `key:` in your configuration, devmachine uses that key, and only that key. The key `setup` makes for you is always used this way. The reason: a server lets you try only a few times — six, usually — and then hangs up. Offering every key you have could use up those tries on the wrong keys before reaching the right one, and you would get a refusal that makes no sense. When you pick a key from the SSH agent instead — in `setup` or `machines add`, the choice that ends in "(from the SSH agent)" — devmachine records its public half as `agent_key:` in `config.yml`. From then on it asks the agent for that one key, the same way `key:` asks a file for its one key. The private half never leaves the agent; only the public key, which is not a secret, is written down. A machine with neither `key:` nor `agent_key:` — set up before this existed, or edited by hand — falls back to asking the agent for everything it holds, which is the risk a many-key agent (a password manager's, say) can run into. Add `agent_key:` to it by hand, set to the line `ssh-add -L` prints for the key you want. See [logging in with your 1Password SSH key](/guides/log-in-with-1password/). If the agent no longer holds the recorded key — locked, or a different `SSH_AUTH_SOCK` — devmachine says so by fingerprint rather than trying every key it can find instead. ### Two different programs | Job | What runs | Why | | --- | --- | --- | | commands, checks, stats | the Go SSH library | the CLI controls authentication and reads the output | | `ssh`, `mosh` | the system binary | you want your terminal, your agent, your tmux — not an imitation | `devmachine ssh` hands the terminal over: it does nothing differently from running `ssh` yourself. ### Which account A machine's `user:` is its **admin account** — usually `root` — used for checking and setting the server up. A workspace has a separate account, and `devmachine ssh ` logs into that; with no workspace named, it logs in as the admin. ## The server's key: how devmachine knows it is your server The host **public** key is safe to store; its private half never leaves the server. ### First contact is a decision Before `setup` offers a client key or password, it reads only the server's public host key, prints its type and SHA256 fingerprint, and asks whether to trust it. Compare that fingerprint with the provider console when you need to be sure the address belongs to the right machine. Accepting without comparing is trusting on faith that the first server you reached is the right one. Once accepted, devmachine remembers that key, so a different server can never swap in later without a warning — but faith alone does not prove the first server was the right one. Refusing stops before any login or remote write. ### One store for every connection Approved keys live in `/known_hosts`, in OpenSSH format, indexed by machine name rather than address, so a Tailscale address and a public fallback must present the same identity. Every command reads that file — `ssh`, `mosh`, `login`, `tunnel`, `doctor`, `setup`, generated aliases — checking strictly and only accepting the pinned key. Once a key is stored, every command requires that exact identity before it offers authentication — a missing or different key fails closed instead of being learned silently. devmachine checks it first with a clear error on mismatch, then the system SSH process checks again before connecting, so nothing can swap the key in between. `known_hosts` holds public keys and is committed by `devmachine setup git`. Private keys under `keys/` stay ignored and guarded from commits. ### Existing configurations Configurations from v0.6 and earlier have no pin. Commands do not learn one silently — they stop and name the fix: ```text devmachine machines trust ``` This reads the presented key without authenticating, prints its type and fingerprint, and asks before writing. `--check` compares without writing. ### A changed key is not automatically a rotation A mismatch can mean a deliberate rebuild, the wrong address, or an attack. devmachine cannot tell those apart, so it prints both fingerprints and refuses. Verify the new fingerprint outside this SSH connection first, then record a deliberate rebuild explicitly: ```text devmachine machines trust --replace ``` `devmachine machines trust --check` shows both fingerprints without writing, together with a command that prints the server's own key of the same type. That command is meant for the machine's console, not for an SSH session: an attacker in the middle would answer an SSH session with whatever fingerprint you expect. An app built on the CLI reads the same report from `--format json` and should ask for that comparison before it offers to replace the key. `--yes` only skips the local confirmation — it cannot replace a key without `--replace`, and never touches the server. `UpdateHostKeys` is off, so a server can never rotate this decision on its own. Removing a machine from `config.yml` leaves its trust entry in place. Reusing the name must reach the same identity, or go through the same explicit replacement. --- # https://mydevmachine.sh/how-it-works/addresses-and-fallback/ A machine can answer on more than one address: ```yaml machines: - name: main hosts: - tailscale:vps - 203.0.113.10 ``` devmachine tries each in order and uses the first one that answers, printing which on stderr. A public address can stop working for you while it keeps working for everyone else — a provider's network can drop your traffic, your own can block a port. A second address costs one line and turns an outage into a slower connection. ## `:` entries An address written `:`, such as `tailscale:vps`, is not an address yet. It belongs to a private network, and the **network package** that declares that prefix turns it into one. The CLI knows the prefix and where the package's scripts are. It does not know Tailscale, Headscale or any other product: each is a package, and a new one needs no new CLI. To resolve `tailscale:vps`, devmachine: 1. Finds the package whose `package.yml` declares `network.prefix: tailscale`. A package this machine installs wins; otherwise any package in the pinned release or in your own `packages/` folder will do. Only a release a sync already downloaded counts — a connection never waits on a download. 2. Runs that package's `resolve` script **on your computer**, with `vps` as its one argument and at most 5 seconds to answer. 3. Tries the addresses it printed, in its order, then the next entry in `hosts`. When the script exits with status 3 — "this network is not reachable from here": the app is missing, off, or signed out — devmachine **drops that entry and tries the next address**. Not an error, since that is what the other addresses are for. If you do not use the network, you never have to care; if you do, your network being down should not lock you out. A script that fails in any other way, prints something that is not an IP address, or takes too long is dropped the same way, with its own reason. It is a bug to fix, but the public address still works, and refusing to try it would turn a broken script into an outage. An entry whose prefix no package declares is dropped too, and says so. An IPv6 address such as `2001:db8::1` is never read as a prefix. Only running out of addresses is an error, saying what was dropped and why: ``` no address left to try: tailscale:vps (tailscale is not running) ``` `devmachine resolve` prints the same list without connecting: every address in the order it is tried, which entry and package it came from, and every entry that was dropped. It is what the macOS app calls, and what to run when a connection goes somewhere you did not expect. ### The built-in `tailscale:` resolver (deprecated) Before network packages, the CLI resolved `tailscale:` itself, by running `tailscale status --json`. It still does, but only when no package declares the `tailscale` prefix — that is, with a packages release from before the `network:` block. It will go away once no supported release needs it. Pin a newer release and nothing changes for you: the `tailscale` package asks the same command. ## SSH aliases that resolve when you connect The aliases `devmachine aliases --write` puts in `~/.ssh/config` do not hold an address. Each one says: ``` Host acme-devmachine HostName main ProxyCommand /opt/homebrew/bin/devmachine --config /Users/you/.config/devmachine ssh-proxy main %p HostKeyAlias main-devmachine ... ``` When ssh connects, `devmachine ssh-proxy` resolves the machine's addresses as above, opens a TCP connection to the first that answers, and passes bytes between it and ssh. ssh does everything else as before — the key, the pinned host key, the session. Why not write the address itself, as older versions did? An address in a file is only right until the network changes. Turn Tailscale off, and an alias holding the tailnet address fails until you run `aliases --write` again. Resolving at connect time means the file only changes when a workspace or machine does. The trade-offs: - **The CLI has to be where the alias says.** The alias names the `devmachine` found on your `PATH`, by its full path, so an editor or app with a different `PATH` still finds it. When `devmachine` is not on your `PATH`, `aliases` writes the old form with the address resolved now. `devmachine doctor` warns when the file does not match what `aliases` would write today. - **Only the connection falls back.** Once an address answers, the SSH handshake has started on it, and cannot move to another. An address that answers and then refuses the login is a login problem, not a network one. - **The host key is still checked.** `HostKeyAlias` and `UserKnownHostsFile` make ssh check the key pinned for the machine, whichever address it came through. - **mosh.** `mosh` starts over ssh, so the alias works for that part. But its own UDP connection needs an IP address, and by default mosh finds one with its own ProxyCommand, which replaces this one. Use `mosh --experimental-remote-ip=remote acme-devmachine`, where the server says which address ssh reached, or `devmachine mosh acme`. A program that needs the address itself asks `devmachine resolve`. - **`-pub`.** When a machine has a private entry and a public one, an `acme-devmachine-pub` alias still goes straight to the public address, for when you want to skip the private network on purpose. ## Answered, or refused? These are different problems, and devmachine tells them apart: ``` machine "main": no address answered: 203.0.113.10 (dial tcp: i/o timeout) ``` Nothing is listening, or nothing can reach it — check the network, the port, the firewall. ``` machine "main" answered on 203.0.113.10 but refused the login for "bob": ... ``` The machine is there; the account or key is the problem. Reporting both as "nothing answered" would send you to check a network that was never at fault. --- # https://mydevmachine.sh/how-it-works/choosing-a-target/ ## A command never guesses which machine With one machine set up, a command uses it. With several, a command that acts on a server needs `--machine`: ``` $ devmachine doctor fail configuration several machines are configured (main, sandbox): say which one with --machine skip connection there is no machine to check ``` There is no `default_machine` setting, on purpose. These commands create accounts and update whole servers — landing on a machine nobody named is how the wrong server gets wrecked, and a default set months ago is exactly how that happens. Typing `--machine` is cheap; explaining what happened to production is not. ## Workspaces name themselves A command that acts on a workspace takes it as its first argument: ``` devmachine ssh bob devmachine mosh bob devmachine run --workspace bob "git status" ``` No `--machine` is needed there — the workspace already says where it lives. `run` uses a flag only because its first argument is the command to run. ## Skipping, not failing When a check cannot run because an earlier one failed, devmachine reports it as `skip` with the reason, never as a failure. A machine that is unreachable would otherwise fail every remote check, burying the one line that matters — the connection — in a wall of red. --- # https://mydevmachine.sh/how-it-works/why-nothing-is-embedded/ The CLI ships with no packages built in. Every package — even the ones every machine gets — is fetched from a pinned release of `github.com/mydevmachine/packages`, checked against a checksum, and cached. ## What that buys **Fixing how Docker is installed is a push, not a release.** Nobody upgrades a binary to receive it, and the fix reaches every machine on the next `sync`. **The CLI stays small enough to reason about.** It knows how to fetch a package, send it to a machine and run it — it does not know what Docker is, and never needs to. **One mechanism instead of two.** A package you wrote and one somebody published are the same kind of thing, resolved by the same code — no "built-in" set with different rules to learn. ## What it costs, plainly **A machine cannot be set up for the first time while GitHub is unreachable.** There is nothing embedded to fall back on: ``` error: fetching https://github.com/mydevmachine/packages/releases/download/v1/packages-v1.tar.gz: ... ``` Once a release is in the cache this stops mattering — the packages are on your disk, and bringing a machine up to date needs no network at all. The limit is only the **first** fetch of a **new** pinned version, not every run, and it is worth the simplicity of one mechanism. ## Why the checksum is on a release asset The CLI fetches `packages-v1.tar.gz` from the release, not the tarball GitHub generates for the tag — a tag can be moved, and its generated archive changes with it silently. A release asset is uploaded once, with its checksum published beside it, so `packages.lock` can record what was actually installed and refuse content that changed. Without that, "pinned" would be a word rather than a guarantee. ## Why only one source A package runs as root on a machine you own. Fetching one from anywhere and running it is the shape of a supply-chain attack, so a third-party source is not supported. Your own configuration folder is the exception, and not really one: a package you wrote is a package you already trust. --- # https://mydevmachine.sh/how-it-works/why-a-login-cannot-be-automated/ It is the first question everybody asks, so here is the answer before you go looking. ## Because a person is the point `gh auth login` opens a browser, or prints a device code and waits. `claude /login` does the same. The step in the middle is a human proving they are themselves, to a service that will not accept a script doing it for them. A CLI that automated this would either store your password — what the whole flow exists to avoid — or hold a token it got some other way, the same problem with an extra step. So `devmachine login` does not try. It knows **which command** to run, because the package declared it; **where** it has to happen — that workspace's account, that machine, a real terminal so a prompt or code actually reaches you; and **what to do with the result**: a machine-scoped login is copied to `/etc/devmachine//` and spread from there. You sit through one login; the CLI handles the rest. ## A real terminal, not a captured one `login` runs the system `ssh` with a TTY, the same path `devmachine ssh` takes — a device code you cannot read is one that expires. **One consequence worth knowing:** that path reads `~/.ssh/known_hosts`, which the Go client the rest of the CLI uses does not. So the first `devmachine login` against a machine `ssh` has never seen can fail with `Host key verification failed`, while `doctor` and `sync` worked fine a moment earlier. Connect once with `devmachine ssh` and accept the key, or add it yourself. ## `stored_at` is a claim, not a guarantee A package says where its tool keeps the result: ```yaml stored_at: ~/.claude/.credentials.json ``` That is how `doctor` and `credentials list` can check, and how a shared login knows what to copy. It is a claim by whoever wrote the package, checked against one version of one tool. A tool that moves its session file breaks the claim in the wrong direction: the CLI reports missing what is in fact present, and logging in again changes nothing. Worth having anyway — the alternative is no check at all — and worth knowing before you meet it. A credential with no `stored_at` reports **unknown** rather than missing, because "I cannot tell" and "it is not there" are different claims. --- # https://mydevmachine.sh/how-it-works/sharing-a-login/ One GitHub account usually serves every workspace on a machine. Logging into it six times is six chances to end up on six different accounts, so the login happens once and the result is copied. **The CLI generates the copying** — a package never writes it. The CLI is the only thing that knows both halves: a package says where its tool keeps a session (`stored_at`) and whether a copy works elsewhere (`shareable`); the configuration says which workspaces want the shared one. Put the copying in a package, and every shareable tool grows its own copy task, written again and slightly differently each time. ## What runs For each login that resolves to `machine` scope, `sync` generates two tasks: 1. Look for the master copy under `/etc/devmachine//`. 2. For each workspace that wants it, copy the master to `stored_at`, with mode `0600`, making the directories on the way. Both skip when the master is not there. Running `sync` before anybody has run `devmachine login` is normal, and the next run picks the session up. `stored_at` has to start with `~/`. The copy lands in each workspace's own home, so a path anywhere else has nowhere to go, and `sync` refuses it. ## Why the copy runs as the workspace, not as root The rest of `sync` runs as root, and root could copy the file and then give it to the account. The copy does not do that, because the workspace account owns its home. It can replace `~/.ssh` or `~/.config/gh/hosts.yml` with a link to `/etc` or `/etc/shadow`. Root would follow that link, and write, `chmod` or `chown` a file outside the home. So root only opens the master, which is its own file, and hands the bytes to a shell that runs as the account (`runuser -u ` on Linux, `sudo -u ` on a Mac, which has no `runuser`). That shell makes the directories, writes a temporary file, and renames it into place. It has only the account's own rights. A link can then reach only what the account could already write, and there is no gap between a check and a write for the account to slip a link into. Before it writes, the shell also resolves the path. When a directory on the way, or the file itself, is a link out of the home, it stops with "reaches outside the home of through a symbolic link". That check is there for the message, not for the safety: see [Troubleshooting](/troubleshooting/). Because the account makes the directories, they belong to it. The directory that holds the login is set to `0700`; the others keep the mode they had. A copy that is already in place, with the same content and mode `0600`, is left alone, and `sync` reports no change for it. ## The one that matters: opting out A workspace that says `gh: own` is **not in the loop at all**. ```yaml credentials: gh: machine workspaces: - name: acme - name: bob credentials: gh: own ``` The copy overwrites `stored_at`. A shared login copied into bob's home would replace the account he logged in with, with nothing saying why — so the generated loop carries acme and nobody else, and bob's name never appears near it. ## What beats what | Order | Where | | --- | --- | | 1 | the workspace's `credentials:` | | 2 | the configuration's `credentials:` | | 3 | the package's own `scope:` | A package that says `shareable: false` beats all three: asking for `machine` on one is refused by name, because the copy would land, the tool would reject it, and nothing would say why. A package that has not said `shareable: true` is treated as one that does not. Where each credential lives, and how a non-login value is delivered, is in [Configuration](/concepts/configuration/#credentials). --- # https://mydevmachine.sh/how-it-works/dns-providers/ Every fact here exists so you learn it from this page, not by damaging a zone. Read it before you touch a real one. ## A provider is a package, not a built-in vendor Talking to Hostinger, Cloudflare or GoDaddy is an ordinary package: `devmachine packages add hostinger`, run on the machine, never on your computer. There is no vendor list inside the CLI binary. That gives one safety property: **a provider nobody installed cannot be written to.** No code path reaches a registrar's write API unless its package is on the lock file for that machine. Adding a provider is a decision with a diff. ## What the provider gets from the shell `PATH`, `HOME`, and the one token its own credential declares — nothing else. The CLI sources `/etc/devmachine//env` right before running the entrypoint, so nothing else leaks in. A provider that reads a variable its credential does not declare works by accident on one machine and breaks everywhere else. The token never appears in a command argument, where `ps` would show it to every account on the machine. Only the credential's name does, and that name is not a secret. ## One value string, whatever the registrar keeps An MX record is a priority and a host. Hostinger stores them as one string, `10 mail.example.com.`; Cloudflare keeps the priority in a field of its own; GoDaddy keeps an SRV's service, protocol, priority, weight and port in five fields. The CLI's contract has one `value` string, so the same `dns add` works on all three and `dns list` prints the same thing everywhere: the zone-file spelling, `10 mail.example.com`. The provider is where the split and the join happen, because the provider is the only part that knows its registrar's shape. The CLI checks the grammar first (see [DNS](/concepts/dns/)), so a provider never has to guess at a value that does not fit. ## `append` is a separate command, not a flag on `upsert` `upsert` means "exactly this one value". A flag that quietly changed it to "this one too" would make the safe command and the additive one differ by one word nobody reads. `append` is its own entry in the provider's `commands`, so a package from before it exists simply does not list it — and the CLI refuses `--append` for that provider before running anything, instead of replacing the other values or failing on the machine with "unknown command". ## Hostinger ### RRsets, not records Hostinger's API has no idea of a single record. It has **RRsets**: one entry per `(name, type)`, holding a list of values. `www A` is one RRset that can carry several addresses at once. `list` splits each RRset into one entry per value, but every write has to work in RRset terms. ### `overwrite: false` appends, and the default is `true` Hostinger's `PUT` takes a whole RRset and an `overwrite` flag. With `false`, the request's values are **added** to what is already there — pointing an existing name at a new address this way leaves both, a round-robin nobody asked for. Leave the field out and Hostinger's own default is `overwrite: true`, the destructive mode, so the provider always sends it explicitly, decided by the code, never left to Hostinger's default. ### `append` is one `PUT` with `overwrite: false` Adding a value is the one write Hostinger makes easy: `overwrite: false` appends the request's values to the RRset and sets its TTL. The provider sends the RRset's own TTL back when none was asked for, so appending a value never changes how long the others are cached. ### Every host comes back with a trailing dot Hostinger stores `mail.example.com.` for the `mail.example.com` it was given, in CNAME, NS, MX and SRV content alike. The provider drops the dot and lower-cases the host in `list` and in every comparison, so a record is seen as already right instead of rewritten on every `dns add`. ### Replacing a value: delete, then append — not one call `upsert` must make a name hold **exactly** the new value. Hostinger gives two ways: one `PUT` with `overwrite: true`, or a `DELETE` of the RRset then a `PUT` with `overwrite: false`. The provider uses the second, at the cost of two calls: Hostinger's own docs say `overwrite: true` replaces every record in the payload, so a one-RRset `PUT` would empty the rest of the zone. The cost of the two-call path is real — **the name holds nothing for the gap between them**, so a resolver asking in that window gets NXDOMAIN — but that beats a write whose blast radius is the whole zone. ### Why `expose rm` will not take one value out of several The same two-call path is why `expose rm` and `workspaces destroy` leave a name alone when it holds the machine's address **and** another one: taking one value out means deleting the RRset and writing the rest back, and a failure between the two calls would take down the value somebody else added. The command prints the record to remove by hand instead, and reports it in `dns_error`. Removing several names at once — `workspaces destroy` with many sites — asks each machine for its providers and each provider for its zones once, and lists each zone once, not once per name. ### A DNS-only token needs its zones configured Hostinger's DNS API answers about one zone at a time and has no list-zones endpoint. Provider selection normally reads the account's domains from the Domains portfolio endpoint, but a least-privilege DNS token gets a 403 there even though it can read its own zone. Set `hostinger.zones` on the machine for that case: ``` devmachine machines edit main --set hostinger.zones=[example.com] ``` ### A delete filter takes the whole RRset Hostinger's `DELETE` removes an entire `(name, type)`, not one value inside it. Deleting one value out of several means: read the RRset, delete it whole, then `PUT` back the values you meant to keep. ### Writes are asynchronous A successful `PUT` or `DELETE` means "request accepted," not "done." A `list` called right after can still show the old state — which is why the provider never checks its own writes immediately. Give it a moment before checking with `dns status` or `dns list`. ## Cloudflare ### `PUT` clears every field it was not given Cloudflare's DNS record `PUT` replaces the whole record: send only `content` and `ttl`, and `proxied`, `comment` and `tags` reset to defaults. The provider always uses `PATCH` instead, which touches only the fields in the request. ### No upsert: every write past a create needs an id Cloudflare has no "make this name hold this value" call. Creating a record returns an id; changing or deleting one needs that id, found by listing first. So `upsert` always lists before it writes: create on no match, `PATCH` by id on one match, refuse to guess on more than one (`ambiguous`). ### An invisible zone is a 200, not a 404 Ask Cloudflare for a zone the token cannot see, and the answer is `200` with an empty `result` array, not an error. The provider treats an empty result as `zone_not_found` itself. ### MX, SRV and CAA are fields, not strings Cloudflare's record has `priority` beside `content` for MX, and a `data` object (`priority`, `weight`, `port`, `target` for SRV; `flags`, `tag`, `value` for CAA) in place of `content`. The provider builds the value `list` prints from those fields and splits the value `upsert` receives back into them; the quotes around a CAA value belong to the zone-file spelling and are not sent. ### `append` is a create Every value at a Cloudflare name is its own record with its own id, so adding one is a `POST` and the others are never touched. A value that is already there is found by comparing the joined value, not the raw `content`, so `10 Mail.Example.com.` matches the record Cloudflare holds. ### `proxied` is always `false` Certificates on this machine renew through a challenge that needs the request to reach the machine directly. A proxied record answers from Cloudflare's edge instead, and the challenge fails. ## GoDaddy ### A Personal Access Token, not a key and secret The provider sends the token as `Authorization: Bearer`. GoDaddy's older key and secret pair (`sso-key`) is deprecated for domains, and the provider does not support it. ### `PUT` on a type and name replaces that set `PUT /v1/domains/{zone}/records/{type}/{name}` swaps every value at that type and name for the ones you send. That is exactly what `upsert` means, so it is one call. Deleting one value among several reads the set and sends the rest with a `PUT`. Deleting the last value, or the whole set, is a `DELETE`. ### An SRV is five fields and a split name GoDaddy stores an SRV's `service`, `protocol`, `priority`, `weight` and `port` apart from `data` (the target) and `name` (the host under the zone, `@` for the apex). The CLI writes the owner the way a zone file does, `_sip._tcp.voice`, and the provider splits it into `_sip`, `_tcp` and `voice`. The `PUT` on `records/SRV/voice` replaces **every** SRV at `voice`, whatever its service, so the provider writes the other services back untouched on every `upsert`, `append` and `delete`. An MX is `data` plus a `priority` field. The provider keeps every field of the values it writes back — a set written back without its priorities would turn each mail server into an unreachable one. ### `append` writes the set back whole GoDaddy has no "add one value": the set at a type and name is written whole. `append` reads it, adds the new value and `PUT`s all of them. A value already there is a no-op. `list` shows A, AAAA, CNAME, TXT, MX, SRV, NS and CAA; `zones` lists only the account's `ACTIVE` domains. ### An account GoDaddy refuses answers 403 `ACCESS_DENIED` GoDaddy lets only some accounts call the Domains API: those that hold a domain, or a plan with management access. Any other account gets `403 ACCESS_DENIED` on every call, whatever the token. The provider reports it as `forbidden`, with GoDaddy's `code` and `message`. See [troubleshooting](/troubleshooting/). A `404` on a domain path means the account does not hold that zone. The provider reports it as `zone_not_found`. ### 60 requests a minute per credential A `429` is `rate_limited`, and the provider does not retry it. The package has no switch for GoDaddy's test (OTE) environment. ## No provider retries a rate limit A `429` is reported as `rate_limited` and the provider stops. Retrying inside the entrypoint would hide how throttled the registrar really is, and could turn one throttled request into a silent hang. Cloudflare blocks a token for five minutes after a single `429`, so retrying would not even help. --- # https://mydevmachine.sh/how-it-works/trust-bootstrap/ Setting up a server you have never logged into is the hardest moment this CLI handles, and the first thing a new user hits. This page explains what `devmachine setup` does, and why the steps run in this order. ## It does not ask which situation you are in Most providers let you paste an SSH key in when you create the server, so a lot of people arrive with a key that already works — asking them for a root password would ask for something they never had. So `setup` finds out for itself: where the machine is, which account and port, which key to use, then **tries the key first**. Only if that fails does it ask for the password. ## It checks what the machine runs first The first thing `setup` does on a connection is ask the machine what it is: `uname -s` for the kernel, then `ID` in `/etc/os-release` on Linux, or `sw_vers -productVersion` on a Mac. It sets up `debian`, `ubuntu` and `arch` (and `archarm`, Arch on ARM), and macOS. When `ID` is none of those, it reads `ID_LIKE`, the systems the distribution says it is based on, closest first. If one of them is in the list, the machine is set up as that one, and `setup` says nobody tested it: ``` 203.0.113.10 runs manjaro, which is based on arch: it is set up the arch way, but devmachine is not tested on it. ``` Why accept a derivative: Manjaro, EndeavourOS and CachyOS keep Arch's pacman and package names, and Linux Mint and Pop!_OS keep Ubuntu's apt. Refusing them stopped people whose machine would have worked. The sentence is there because it is a guess the CLI has not checked: a derivative can still rename or leave out a package its base has. Anything else stops the run **before the first change** — before the key is installed, on a server you reached with a password: ``` this CLI does not set up "fedora" yet: it supports debian, ubuntu and arch, and systems based on them "FreeBSD" is not a system this CLI sets up: it supports Linux (debian, ubuntu, arch) and macOS ``` Why refuse instead of trying: every step after this one is written for a system it has been run on, or for one based on it. A guess gets you halfway through a first run — a key installed, password login off — and then leaves you on a machine that cannot install Ansible. Stopping early leaves the server as you bought it. `doctor` makes the same check and accepts the same list; on a derivative its `operating system` check is a warning, not a pass. ## The proof is a new connection Installing a key does not mean it works — a wrong file permission, a world-writable home folder, SELinux, any of these can let a key install cleanly and still refuse every login. The connection that installed the key cannot prove it works either, since that connection used the password. So `setup` closes it, opens a **brand new connection using only the key**, and only counts that as proof. ## Locking down comes after the proof, never with it Turning password login off before proving the key works is locking the door with the key still inside. If the proof fails, `setup` stops and says plainly: ``` password login is still on: you can still get in with the password ``` `--no-harden` skips locking the server down; the key is still installed and proved. ## `machines add` writes the machine last `machines add` records the new machine only after the whole bootstrap worked: key proved, password login off, Ansible installed. Both files wait for that moment — `config.yml` and `known_hosts`. Until then the host key you approved is trusted in a file of the run's own, which is thrown away when the run ends. If any step fails, both files are as they were, so you fix the cause and run the same command again: it is not refused as a name already configured, and a corrected address or a rebuilt server that presents another host key is not refused as a changed key either. The new key still has to pass `--fingerprint` or your yes, like any first contact. A host key already in `known_hosts` under a name that is not configured — left by an older CLI, or by a machine you removed — is replaced, not compared: a name that is not a machine has nothing to protect. What a failed run leaves is harmless to the next one: the key it made is reused, and a key it already installed now logs in, so no password is asked for. `setup` writes `config.yml` earlier, once the key logs in, and running it again resumes from that file instead of starting over. ## Nothing is written before the key logs in Neither `setup` nor `machines add` writes a machine whose key has not logged in. A refused key with no password, a failed proof, an address that does not answer, a declined fingerprint: each leaves `config.yml` as it was, or absent if there was none, and records no agent key for the machine. Why: a machine in `config.yml` is one every command reaches for — `doctor`, `sessions`, the macOS app every minute or two. With a key the server refuses, each of those is a failed login in the server's SSH log. With fail2ban on, a few of them ban your address, and from then on the server refuses the connection outright, even after the key is fixed. See [the connection is refused on a machine that answered before](/troubleshooting/#connection-refused-on-a-machine-that-answered-before). Once the key logs in, there is no such risk, so `setup` writes the machine before it changes anything else. A later failure — no way to root, Ansible not installing — keeps it, and running `setup` again finishes from there. ## A fingerprint of any key type A server holds several host keys, ED25519, ECDSA and RSA, and a handshake shows one. `--fingerprint` may name any of them: when it is not the one shown, the CLI opens one handshake per other type, in which the server proves it holds that key, and trusts the key whose fingerprint matches. From then on the CLI asks for that type only. A fingerprint no key of the server has is refused, so this accepts no key the operator did not name. ## A local machine trusts its first host key Everywhere else, an unattended run needs `--fingerprint`: trusting whatever answers, with nobody looking, is how a wrong server gets your key. `machines create-local --add` is the one exception. It trusts the key the VM presents, because the same command created that VM a moment ago and the VM answers only on `127.0.0.1`, through a port Lima forwards on your own computer — there is no network in between for anybody to stand on. Locking down means writing one file that turns password login off, checking it is valid, and only reloading SSH if it passes — **an invalid file is taken back**: the one that was there before is put back, or the new one deleted when there was none, since a bad file left behind would break the next SSH reload, even a routine reboot. `setup` asks first whether every account loses its password, or some keep it. See [password login, account by account](/how-it-works/password-login/). ### Why the file name starts with `00` SSH uses the **first** value it finds for each setting, so a drop-in file only wins if it sorts before others. A cloud image often ships its own settings as `60-cloudimg-settings.conf`; a file named `99-` would read after it and **silently do nothing** — no warning, password login still on despite a successful run. ### Then it asks SSH, not the file A valid file is not proof that SSH reads it. A server whose main `sshd_config` has no `Include` line for `sshd_config.d`, or sets `PasswordAuthentication yes` above that line, accepts the file and ignores it. So after the reload `setup` runs `sshd -T`, which prints the settings SSH is really running with, and requires `passwordauthentication no`. If SSH still allows passwords, the file is taken back, SSH is reloaded without it, and `setup` stops — it never says "password login is off" about a server that still takes passwords. ### On a Mac A Mac gets the same file in the same folder, with two differences. The check is `/usr/sbin/sshd -t` alone: macOS has no `/run`, and its `/` is read-only. And nothing is reloaded: macOS starts SSH fresh for each connection (through launchd), so the next connection reads the new file. The `sshd -T` proof is the same. ## An admin login that is not root Many servers arrive with root closed and an ordinary account that has `sudo`: a home server, a VM made by Lima or Multipass, some providers' images. The CLI works the same on them, as long as that account's `sudo` asks for no password. Everything that changes the system — turning password login off, installing Ansible, unpacking a sync's bundle under `/opt/devmachine`, running the play — first asks `id -u`. Root runs it directly; any other account runs it through `sudo -n`. A server where the admin is root never sees `sudo` at all, and neither does your own computer as a `self` machine. Either way the step runs in `bash` when the server has it, and in `sh` only when it does not. Root's login shell was `bash` before any of this existed, and the two differ where it matters: `sh` on Debian and Ubuntu is `dash`, which stops a whole command when it cannot read a file it was told to load. A package's `help` loads its credential first, and before `credentials push` that file is not there yet; `help` must still answer. It asks, rather than trying without `sudo` and trying again with it. A retry would run a half-finished step twice, and would read any failure at all — a full disk, a refused SSH setting — as a missing permission. `-n` because nobody is there to type a password. So before anything is changed, `setup`, `machines add` and `sync` check that `sudo -n true` works, and stop with one sentence when it does not: ``` the admin login cannot become root: "alice" is not root, and `sudo -n true` fails as it. Log in as root, or give it passwordless sudo on the machine: echo 'alice ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/devmachine-alice ``` The whole play runs as root, not only the tasks that ask for it. A task that becomes a workspace account would otherwise go from one unprivileged account to another, which Ansible refuses without ACLs on its temporary files. ## Tailscale SSH proves nothing about a key A server with Tailscale SSH turned on answers port 22 on its tailnet address with Tailscale, not with `sshd`. Tailscale lets anyone on your tailnet in by tailnet identity and accepts any key, or none. "The key already logs in" would be true and mean nothing: the key was never checked, and may not be on the server at all. So when the server identifies itself as Tailscale, `setup` and `machines add` install the key anyway and say why, instead of taking the login as proof — and leave password login as it was, since locking down comes after the proof and there was none. Without the key, the machine is unreachable the day Tailscale SSH is off, or from anywhere outside the tailnet. Running `devmachine setup --machine ` again repairs a machine an older CLI set up this way. ## The password is never stored It lives in memory for one connection, then is gone — never written to `config.yml`, the lock file, or the log. Typed at a terminal, it is never shown on screen. ## Why this does not just run the `ssh` command If your SSH agent holds several keys, a password login can fail **before you see the prompt**: the agent offers key after key, and the server cuts the connection after too many tries — on a server you are meeting for the first time, that happens every time. `setup` talks to SSH directly in code, so it offers exactly one thing at a time — the key, or the password, never both. Sessions you use yourself, `ssh` and `mosh`, still run the real command, since there you want your own terminal and agent. ## After this step `setup` installs `ansible` — the last thing done by hand. From then on, every change goes through `devmachine sync`. It installs `ansible` rather than `ansible-core`, since the smaller package leaves out a piece the `firewall` package needs. On Debian and Ubuntu that is `apt-get install ansible`. On Arch it is `pacman -S --noconfirm --needed ansible`, with the package lists the machine already has. It never runs `pacman -Sy`: refreshing the lists without upgrading is a partial upgrade, which Arch does not support and which can install an Ansible built for a Python the machine does not have. A full `pacman -Syu` upgrades everything, and that is your call, not a side effect of `setup`. On an Arch server whose lists are too old for the mirrors, `setup` stops and says so — see [troubleshooting](/troubleshooting/#pacman-could-not-install-ansible). A distribution based on one of them takes its base's path: `pacman` on Manjaro, `apt-get` on Linux Mint. On a Mac the CLI installs nothing itself: the `mac-brew` or `mac-ports` package's bootstrap does, after you agree. See [what a machine needs](/how-it-works/what-a-machine-needs/). --- # https://mydevmachine.sh/how-it-works/password-login/ `setup` and `machines add` turn SSH password login off once the key is proved. On a server that only you reach, that is the whole story: the key is the only way in, and a password nobody can guess is better than one somebody might. A machine people use is different. A Mac has the accounts of the people who sit at it, and some of them may SSH in with their password. Turning password login off reaches **every account**, not only the admin login the CLI uses: SSH has one setting for the whole machine. So before it changes anything, the wizard asks: ``` SSH password login, now that the key is proved: On a Mac this is every account on it. Whoever logs in over SSH with a password needs a key afterwards; the login window, sudo and Screen Sharing keep their passwords. Other accounts on this machine: alice, bob. 1) off for every account 2) off, except for accounts you name 3) leave it as it is choice [1]: ``` Enter keeps the default, off for everybody. `--keep-password-login a,b` answers it without a terminal, and `--no-harden` is the third choice. Only SSH changes: the login window, `sudo`, Screen Sharing and FileVault keep their passwords. ## How an account keeps its password The file the CLI writes, `/etc/ssh/sshd_config.d/00-devmachine-hardening.conf`, turns password login off for everybody, then ends with a `Match User` block that turns it back on for the accounts you named: ``` PasswordAuthentication no KbdInteractiveAuthentication no PermitRootLogin prohibit-password Match User alice,bob PasswordAuthentication yes KbdInteractiveAuthentication yes ``` A `Match` block runs to the end of the file it is in. It does **not** run on into the main `sshd_config` past the `Include` line, which would make every later line in that file apply to those accounts only. This was checked, not assumed: with a `Subsystem` line after the `Include` — which `sshd -t` refuses inside a `Match` — `sshd -t` accepts the configuration, and `sshd -T -C user=…` gives `yes` for a kept account and `no` for the rest, on OpenSSH 9.6 (Ubuntu 24.04) and 9.9 (macOS). The CLI's own tests run the same check against the `sshd` they find. Still, the block stays last in the file, so a different reading of the rule could only affect lines the CLI does not write. After the change the CLI asks `sshd -T` twice: once for an account no exception names, which must say `no`, and once for each kept account, which must say `yes`. A file that does not do what it says is taken back. ## One place for the exceptions The accounts are written on the machine in `config.yml`: ```yaml machines: - name: studio hosts: [203.0.113.20] password_login_keep: [alice, bob] ``` They live on the machine, not in a package setting, because `setup` turns password login off before any package exists. The `ssh_hardening` package writes the same file on every sync, and it reads this list, so a sync keeps the same exceptions instead of wiping them. ## Changing it later ``` devmachine machines password-login studio # who can log in with a password devmachine machines password-login studio --keep alice # off, except alice devmachine machines password-login studio --off # off for every account devmachine machines password-login studio --on # the system's own setting ``` The change goes over the admin login's key, which is the proof that a way in stays open. `--on` takes the CLI's file away, so the system's own setting applies again: on macOS, Debian and Ubuntu that is password login on. It is refused while the machine has `ssh_hardening`, which turns password login off again on every sync. Each change keeps a copy of the file it replaced in `/etc/ssh/.devmachine-hardening.conf.previous`, outside `sshd_config.d`: macOS reads every file in that folder, not only `*.conf`, so a copy kept there would be read as configuration. --- # https://mydevmachine.sh/how-it-works/scheduled-tasks/ `devmachine scheduled` runs a shell command, or a prompt for a coding agent, in a folder of a workspace, on a schedule: once, every hour, every day, on weekdays, every week or every month. The macOS app shows the same tasks on its Scheduled page. For examples and how to set one up, see the [scheduled tasks guide](/guides/scheduled-tasks/). ## Each workspace runs its own tasks A task lives in the workspace that runs it, under `~/.devmachine/scheduled/`. Nothing on your computer has to be awake when it runs, and no machine reaches into another machine to start it. The other way, one machine that starts every task everywhere, needs that machine to hold a login to every other workspace. Today only your computer holds those logins, and that is on purpose. The list still reads as one, because `devmachine scheduled list` asks every workspace at once, the way `devmachine sessions` does. ## One timer, tasks in files The `scheduled` package installs one timer per workspace that fires every minute and runs `devmachine scheduled local tick`. On Linux it is a user systemd timer, with linger so it runs with nobody logged in. On macOS it is a launch daemon that runs as the workspace's account. Each tick reads the task files and starts what became due since the last tick. Creating, changing or pausing a task only writes a file: no root, no reload, and the same on both systems. One timer per task would need root on macOS for every change. ## The workspace runs the same devmachine The package puts the devmachine binary in the workspace and links it at `~/.devmachine/scheduled/devmachine`. The timer and your computer both call that path. Deciding when a task is due, building the agent's command and keeping the record of each run is the same Go code you run on your computer. Your computer reaches it as `sessions` does: it logs in to the workspace and sends a short program to `/bin/sh` on its input, so the account's own shell, which may be fish, never reads a task's text. ## A setup that did not finish The first task in a workspace adds the `scheduled` package to it and syncs its machine. If that sync fails, the package stays in the configuration and the binary is not in the workspace. It stays on purpose. Taking it off would undo the one part that worked, and the next attempt would add it again anyway. So the CLI never trusts the configuration alone. Before each call it checks the binary is there. When it is not, but the package is in the configuration, the error says `setup-incomplete` and names the sync that finishes it: `devmachine sync --machine --tags scheduled`. `scheduled add` runs that sync itself, with the same `--yes` rule as the first setup, and then creates the task. `scheduled list` shows the workspace as not installed, with the same error, so the app can offer to finish the setup. When the setup sync fails, the error names the Ansible task that failed and what it said. "1 task(s) failed" alone leaves you reading the whole run. ## A task runs as the workspace's account The task runs in the folder you chose, as that account, through its login shell, so the tools `mise` or Homebrew put on its PATH are there. A prompt starts with that account's Claude or Codex login, skills, MCP servers and connectors. A prompt that says "email me the summary" works when that account has an email connector, and does nothing more than the account can do. The prompt reaches the agent as one argument. No shell reads it, so quotes, `$(...)` and new lines arrive as you wrote them. A command, on the other hand, is a shell line, and the shell reads it as one. ## Permission modes A prompt runs with nobody there to approve a tool. A mode that asks before it acts, such as Claude's `manual`, stops at the first tool it needs and the run ends with nothing done. `acceptEdits` approves file edits only, so a call to a connector such as Linear or email is refused; `auto` lets the agent use its tools and connectors, and is what the app picks. A mode that never asks at all, `bypassPermissions` for Claude or `danger-full-access` for Codex, needs `--allow-dangerous`, so it is always a choice somebody made. `devmachine scheduled harnesses` lists each agent's modes and suggested models. ## A missed run is recorded, not run If the machine was off or asleep when a task was due, the next tick records one `missed` run and does not start it. Work that runs hours late tends to surprise more than it helps. A tick starts a task only when its time was in the last two minutes. A one-off task that was missed is done, like one that ran. ## No two runs of a task at once A run holds a lock while it goes. If the next time comes while it still runs, that time is recorded as `skipped`. A lock left by a run that died, after a reboot for example, is taken over. ## Each run is kept A run records how it started (`schedule` or `manual`), when, how long it took, its exit code and how it ended: `succeeded`, `failed`, `timeout`, `error`, `missed` or `skipped`. Its output, stdout and stderr together, is kept up to the last mebibyte, where the error usually is. The last 50 runs of each task are kept. A run stops after its timeout, 30 minutes unless the task says otherwise, at most 6 hours. Everything it started stops with it. ## Run now `devmachine scheduled run` starts the task in the workspace and returns at once with the run's id. The run goes on after the command returns, and after you close the connection. Its schedule does not change, and a one-off task run this way still runs at its time. ## Timezone A task keeps the timezone it was created in, by default your computer's. 09:00 in `America/Sao_Paulo` runs at 09:00 there, whatever the server's own clock says, and across daylight saving changes. A monthly task on day 31 runs on the last day of shorter months. --- # https://mydevmachine.sh/how-it-works/your-computer-as-a-machine/ A machine can declare `self: true`: your own computer, the one running the CLI. This page explains why that exists, why it is called `self` and not `local`, and what changes about `sync` and `setup`. ## Why `self`, not `local` `machines create-local` already means something else: a small VM made on your computer that stands in for a real server while you learn or test the CLI. It has its own address, port, root login and key, and its own `setup`, exactly like a real server — it only happens to live here. `self` is different: your own computer, right now, with no address to dial and no key to install. Reusing "local" for both would make two ideas share one word, and the first time someone typed the wrong one, they would find out the hard way. ## Why no address fields `hosts`, `user`, `port` and `key` describe how to reach a machine that is not your computer. A self machine has nothing to dial, no login, no key to install, so devmachine refuses all four if you try to set them, naming the field: ``` machine "mac" is your computer (self: true), so it has no hosts: remove it ``` The same reason is why a workspace can never live on a self machine: a workspace is an account reached over SSH with a key the CLI installed, and your own computer has no account system or SSH server for that. ## Why it never needs `sudo` for the work itself Homebrew, mise and Claude all live under your own home folder on a Mac, and none of them need root, so a self machine's setup never asks for extra permissions. It only runs on macOS — nothing about this path has been tried anywhere else — and stops with a clear error elsewhere. ## How `setup` gets Ansible onto your computer Ansible cannot install itself. On a real server, `setup` bootstraps a key, proves it, locks the server down, then installs Ansible. None of that applies to your own computer, so `setup` here does only the last part, the same way it does on a Mac reached over SSH: it runs the `bootstrap` of a package manager package. That is `mac-brew` (Homebrew), or `mac-ports` (MacPorts) when the machine lists it. The bootstrap runs from the package cache on your computer, as you. It is not copied to `/opt`, which would need `sudo` (see below). First it only checks. When Homebrew and `ansible-playbook` are already there (from Homebrew or pipx), nothing is installed and `setup` says so: ``` mac is already prepared: ansible-playbook is /opt/homebrew/bin/ansible-playbook. ``` When something is missing, `setup` lists it with how long it takes and asks before it installs anything; `--install-prerequisites` is the yes for a run with no terminal. `--yes` is never that yes. Installing the Command Line Tools or Homebrew needs `sudo`; the bootstrap only uses `sudo -n`, so on a Mac where `sudo` asks for a password it stops and says which step failed. See [what a machine needs](/how-it-works/what-a-machine-needs/). `sync` follows the same rule: with no `ansible-playbook` on `PATH`, it stops before touching anything and points you to `setup`. ## Where files end up, and why not `/opt` On a real server, devmachine's files live at `/opt/devmachine`, root's territory, which is fine since `setup` already has full control of a server it set up deliberately. On a Mac, `/opt` needs `sudo`, running into the same rule as Homebrew — not this CLI's place to ask. So on a self machine, those files live under your own home instead: ``` $HOME/.local/share/devmachine/bundle ``` --- # https://mydevmachine.sh/how-it-works/what-the-cli-knows-about-a-machine/ `setup`, `sync` and `doctor` already connect to a machine. While they are there, they read what it runs — `uname`, `/etc/os-release`, `sw_vers` on a Mac, where `ansible-playbook` is — in one extra command, and keep the answer in `/state/machines/.json`. `devmachine machines show ` prints it without connecting, and `devmachine --format json machines show ` gives it to a script or an agent under `observed`. `devmachine machines rm ` deletes the file with the machine, so a new machine that reuses the name does not inherit what the old one ran. ## Why it is not in `config.yml` `config.yml` says what you want. This file says what a command saw, and the next `sync` reads the machine again. Mixing the two would make a reinstalled server look like a change to your configuration, and an autocommit would record it as one. So the file lives under `state/`, which `devmachine setup git` keeps out of the repository. A repository made before this release gets the `.gitignore` line the next time you run `devmachine setup git`. It lives in the configuration folder, like `known_hosts`, and not in `~/.local/state`, because a machine name is unique only inside one configuration: two configurations can each have a machine called `vps`. ## Why it is written only when it changes The macOS app watches the configuration folder and reloads on every change. A `doctor` that rewrote the file on each run would make the app reload for nothing. So the file is written only when something other than the time differs, and `observed_at` is when the machine was first seen as the file describes it — not the last time somebody looked. The file is written to a temporary name in the same folder and then renamed, so a reader never sees half of it. ## What reads it - `run` puts `path_prefix` in front of `PATH`. A plain SSH command on a Mac gets `/usr/bin:/bin:/usr/sbin:/sbin` and nothing else, so `port`, `brew` and the Python they installed are not found without it. On Linux the list is empty and `run` sends the command as it is. - Every other command the CLI runs on a Mac by name gets the same prefix, plus `/Applications/Tailscale.app/Contents/MacOS` last, where Tailscale's app keeps its CLI: `login`'s command (`gh auth login`, `tailscale up`), a network package's `join` and `self_name`, and `expose`'s `caddy validate` and `caddy reload`. `expose` writes the prefix inside the script it pipes to `sudo`, because `sudo` replaces the `PATH` it was started with. - `sync` refuses, before it changes anything, a package whose `platforms` leave out the machine's system — see [troubleshooting](/troubleshooting/#package-x-runs-on-linux-machine-y-is-macos). A machine nobody has read yet is not refused: its first `sync` reads it. - On a Mac reached over SSH, `sync` calls Ansible by `ansible_playbook`, the absolute path the package manager package's bootstrap reported during `setup`. A MacPorts install can name it `ansible-playbook-3.14`, which no `PATH` would find. On Linux and on your own computer it is `ansible-playbook` from `PATH`, as before. - An agent reads `observed` before it writes a `run` command, so it uses `pacman` on Arch, `apt` on Debian and Ubuntu, and `brew` or `port` on a Mac. A distribution based on one of them, such as Manjaro, gets its base's `os_family` and `pkg_mgr` and keeps its own name in `distribution`. A command never fails because this file could not be written: it is a by-product of a read that already worked. --- # https://mydevmachine.sh/how-it-works/what-a-machine-needs/ `devmachine` runs Ansible on the machine itself, so every machine needs a few things before the first `sync`. This page lists them, says which ones the CLI installs and which only you can do, and explains why installing them needs its own yes. ## The list | Prerequisite | Linux server | Mac | Who handles it | | --- | --- | --- | --- | | SSH you can reach | yes | Remote Login on | You. On a Mac: System Settings > General > Sharing > Remote Login. | | An admin login with passwordless `sudo` (or root) | yes | yes | You. `setup` prints the exact command when `sudo -n true` fails. | | Xcode Command Line Tools | — | yes | The CLI, after you agree (5 to 10 minutes). | | Homebrew or MacPorts | — | one of them | The CLI, after you agree. You choose which. | | Ansible | yes | yes | The CLI: `apt` or `pacman` on Linux, Homebrew or MacPorts on a Mac. | | Python for Ansible | comes with Ansible | comes with Ansible | Nobody: the system Python on a Mac (3.9) is never used to run Ansible. | `devmachine doctor` checks the same list. On a Mac, the installable part shows up as one `prerequisite: ` check per missing item; with `--format json` those are ordinary entries of `checks[]`. ## On a Mac, the package manager package does the work The CLI holds nothing macOS-specific beyond running one script. A Mac gets Ansible through `mac-brew` (Homebrew) or `mac-ports` (MacPorts), like choosing between npm and pnpm. Each package carries a `bootstrap` script with two actions: `check` changes nothing and lists what is missing, and `apply` installs it, in order: the Command Line Tools, the package manager, then Ansible through it. A second `apply` changes nothing. Which package: the one the machine lists. With none, the one for the manager the Mac already has. With neither or both, `setup` asks, or takes `--package-manager brew|ports`; with no terminal and no flag it stops: ``` the Mac has neither Homebrew nor MacPorts: run again with --package-manager brew or --package-manager ports ``` The package goes on the machine's list. On a new Mac, `setup` and `machines add` also put `base` and `devmachine-app` there in place of `essentials`, which runs only on Linux; see [what a new machine starts with](/how-it-works/what-a-new-machine-starts-with/#on-a-mac). `setup` copies the package to `/opt/devmachine/bootstrap//` and runs the script there as the admin login, never as root: Homebrew refuses root, so the script reaches root only through `sudo -n` for the steps that need it. On your own computer (a `self` machine) it runs from the package cache instead, with nothing copied to `/opt`. `apply` reports the absolute path of `ansible-playbook`. `sync` calls Ansible by that path, because a plain SSH command on a Mac gets `PATH=/usr/bin:/bin:/usr/sbin:/sbin`, where neither Homebrew nor MacPorts lives. ## Remote Login set to "Only these users" Remote Login can allow all users or only some. With "Only these users", macOS keeps the list in the group `com.apple.access_ssh` and refuses any account outside it before it looks at the key: the server log says `pam_sacl: denying '' due to failed service ACL check`, and `ssh` gets only "Connection closed" (exit 255). So a workspace account has to be in that group. `sync` adds each one when the group exists; with "All users" there is no group and nothing to add. `workspaces destroy` takes the account out again before it deletes it. `devmachine doctor` reports one `ssh access: ` check per workspace, so an account left out shows as a warning and not as a mystery. The CLI never switches Remote Login to "All users": that is the Mac owner's choice. ## Why consent has its own flag Installing the Command Line Tools takes up to ten minutes and puts software on somebody's computer, so it happens only after a yes: an answer at the terminal, or `--install-prerequisites`. `--yes` is not that yes. It already means other things: in `setup` and `machines add` it writes SSH host entries, and in `sync` and `packages add` it skips the confirmation. The macOS app runs `sync … --yes` in the background with nobody watching. If `--yes` also meant "install the Command Line Tools", a background sync could start a ten-minute install nobody asked for. So `--yes` never installs prerequisites, and `sync` never installs them at all: that is `setup`'s and `machines add`'s job. Without a terminal and without the flag, a Mac that lacks something stops before anything is installed: ``` nothing was installed: run again with --install-prerequisites to install Xcode Command Line Tools and Homebrew ``` --- # https://mydevmachine.sh/how-it-works/packages-on-many-systems/ A machine runs Debian, Ubuntu, Arch Linux or macOS. A package is written once for all of them: never `gh-debian` and `gh-arch`. It carries a file per system only where that system really differs, and says in [`platforms`](/reference/package-format/#platforms) which systems it runs on. This page is for whoever writes a package: how the built-in packages do it, and the traps they already hit. ## Load the names for this system A package that needs different names or paths per system keeps them in `vars/`, and loads the first file that matches, most specific first: ```yaml # A loop over first_found, not a plain include_vars: when no file matches, the # loop is empty and the task skips, on ansible-core 2.14 as on the latest. - name: Load the names for this system ansible.builtin.include_vars: "{{ devmachine_vars_file }}" loop: "{{ query('ansible.builtin.first_found', devmachine_vars_chain) }}" loop_control: loop_var: devmachine_vars_file vars: devmachine_vars_chain: files: - "{{ ansible_facts['distribution'] }}.yml" - "{{ ansible_facts['pkg_mgr'] }}.yml" - "{{ ansible_facts['os_family'] }}.yml" - default.yml paths: - "{{ role_path }}/vars" skip: true ``` What each name matches: | File | Matches | | --- | --- | | `Ubuntu.yml`, `Debian.yml`, `Archlinux.yml`, `MacOSX.yml` | one distribution (`distribution`) | | `apt.yml`, `pacman.yml`, `homebrew.yml`, `macports.yml` | one package manager (`pkg_mgr`) | | `Debian.yml`, `Archlinux.yml`, `Darwin.yml` | a family (`os_family`): `Debian.yml` serves Ubuntu too | | `default.yml` | everything else | A package with no difference between systems has no `vars/` file and no such task. Defaults that hold everywhere stay in `defaults/main.yml`, and the files in `vars/` only change what differs. Read facts as `ansible_facts['...']`, never as the `ansible_*` variables. ## How to install a tool Take the first of these that works for the tool: 1. The project's official installer, such as `curl -fsSL https://mise.run | sh`. 2. A release binary for the system and the architecture, from the project's releases. 3. `mise`, for a language or a tool mise knows. 4. The `package` module, with the names in `vars/`. Never `apt`: the CLI refuses a package that uses it. 5. `tasks/.yml`, only when the steps themselves differ, not only the names. A release binary is named the way Go names systems and architectures, not the way the facts do. `ansible_facts['system'] | lower` gives `linux` or `darwin`. The architecture needs a map: Linux reports `x86_64` or `aarch64`, an Apple Silicon Mac reports `arm64`, and a release asset says `amd64` or `arm64`. The `glab` package carries the map: ```yaml devmachine_go_architectures: x86_64: amd64 aarch64: arm64 armv7l: armv6 devmachine_go_architecture: >- {{ devmachine_go_architectures.get(ansible_facts['architecture'], ansible_facts['architecture']) }} ``` ## Names across systems What the built-in packages install, by system. Check a name before you use it (see below); this table is a start, not the source. | What | Debian, Ubuntu | Arch Linux | Homebrew | MacPorts | | --- | --- | --- | --- | --- | | build toolchain | `build-essential` | `base-devel` | the Command Line Tools | the Command Line Tools | | curl, git, tar, unzip, zsh | same name | same name | come with macOS | come with macOS | | SSH client | `openssh-client` | `openssh` | comes with macOS | comes with macOS | | ACLs for Ansible's `become` | `acl` | `acl` | not needed | not needed | | tmux, mosh, ffmpeg | same name | same name | same name | same name | | GnuPG | `gnupg` | `gnupg` | `gnupg` | `gnupg2` | | OpenSSL headers | `libssl-dev` | `openssl` | `openssl@3` | `openssl3` | | zlib headers | `zlib1g-dev` | `zlib` | `zlib` | `zlib` | | YAML headers | `libyaml-dev` | `libyaml` | `libyaml` | `libyaml` | | readline headers | `libreadline-dev` | `readline` | `readline` | `readline` | | libffi headers | `libffi-dev` | `libffi` | `libffi` | `libffi` | | GMP headers | `libgmp-dev` | `gmp` | `gmp` | `gmp` | | Docker | Docker's repository | `docker`, `docker-buildx`, `docker-compose` | — | — | Arch ships headers inside the library package, so there is no `-dev` to add. Homebrew keeps `openssl@3`, `readline`, `zlib` and `libffi` out of its prefix (keg-only): a build finds them through `brew --prefix `. ## Traps already hit Each of these broke a real run before the packages handled it. **Swap on btrfs.** `fallocate` and `swapon` fail with `swapon: /swapfile: swapon failed: Invalid argument` when `/` is btrfs, as on Arch. Make the file with `btrfs filesystem mkswapfile` there, and `fallocate` elsewhere. macOS manages its own swap: `base` makes none on a Mac. **No `LANG` over SSH on Arch.** Nothing reads `/etc/locale.conf` for an SSH login, and `mosh-server` stops with `mosh-server needs a UTF-8 native locale to run`. `base` writes `LANG` to `/etc/environment`, which `pam_env` reads for every login. **`distribution_release` is `NA` on Arch.** Arch is a rolling release. A repository line built from the release name (Docker's, Tailscale's) belongs in `vars/Debian.yml`, never in a task every system runs. **No cache refresh alone on Arch.** `pacman -Sy` without `-u` is a partial upgrade, which Arch does not support. Refresh the lists only together with an upgrade, and only when the operator asked for one. **No group named after the account on macOS.** Every account is in `staff` (gid 20); `group: alice` fails with `chgrp failed: failed to look up group alice`. The `root` group does not exist either: a file root owns takes `wheel`. Read the account's home and group from the account itself, with the `user` module in check mode, which reads and never creates: ```yaml # check_mode makes the user module only read: it never creates the account, # and a missing one just leaves no home in the result. - name: Read the account's home and group ansible.builtin.user: name: "{{ devmachine_workspace.user }}" check_mode: true changed_when: false register: devmachine_account ``` Then use `devmachine_account.home | default('/home/' ~ devmachine_workspace.user)` for the home, and `devmachine_account.group | default(omit)` for the group. Every package that reads `devmachine_account` registers it itself. A registered variable outlives the role, so a package that skips this task reads whatever account the previous package left, which can belong to another workspace. `packages validate` warns about such a package. macOS has no `getent`, and homes are in `/Users`. **Homebrew refuses root.** On a Mac reached over SSH the play runs as root, and `brew` refuses to. A task that installs through Homebrew becomes the account that owns it: ```yaml - name: Find who owns Homebrew ansible.builtin.stat: path: "{{ '/opt/homebrew' if ansible_facts['architecture'] == 'arm64' else '/usr/local' }}/bin/brew" register: devmachine_base_brew when: ansible_facts['pkg_mgr'] == 'homebrew' - name: Install the base packages from Homebrew ansible.builtin.package: name: "{{ devmachine_base_packages }}" state: present become: "{{ devmachine_base_brew.stat.uid != ansible_facts['effective_user_id'] }}" become_user: "{{ devmachine_base_brew.stat.pw_name }}" when: ansible_facts['pkg_mgr'] == 'homebrew' ``` MacPorts is the other way round: it installs as root, so the play stays root. **MacPorts has no check mode.** `community.general.macports` does not support check mode, so `sync --check` skips its tasks and shows nothing they would install. Do not read an empty dry run as "nothing to do". **A plain SSH command on a Mac has a short `PATH`.** It gets `/usr/bin:/bin:/usr/sbin:/sbin`; Homebrew (`/opt/homebrew/bin` or `/usr/local/bin`) and MacPorts (`/opt/local/bin`) are added only by a login shell. Call a tool by its absolute path, or set `PATH` in the task's `environment`. **`platforms`.** A package that cannot work on a system says so: `firewall`, `fail2ban`, `caddy` and `docker` declare `platforms: [linux]`, `mac-brew` and `mac-ports` declare `[macos]`. `sync` refuses a package for another system before it changes the machine, naming both. Left out, the package claims to run everywhere, so leave it out only when that is true. ## Check, never guess A module's options, a package name and a fact's value differ by system and by version. Look them up: | What | How | | --- | --- | | a module's options and its check-mode support | `ansible-doc `, or docs.ansible.com | | a Debian or Ubuntu package | `apt-cache policy ` | | an Arch package | `pacman -Si ` | | a Homebrew formula | `brew info ` | | a MacPorts port | `port info ` | | what the machine reports | `devmachine --format json machines show `, under `observed` | ## Prove it on every system it declares A package that says `platforms: [linux, macos]` is proved on Debian or Ubuntu, on Arch and on a Mac, not on one of them. Each proof is the same: `devmachine sync` ends with `failed=0`, and a second `sync` reports `changed=0`. A machine for this is cheap: `devmachine machines create-local ` makes an Ubuntu VM, and `--distro arch` an Arch one. --- # https://mydevmachine.sh/how-it-works/machine-location/ Every machine has a `location`: where it is, such as `hostinger`, `home`, `office` or `bedroom`. It changes nothing about how the CLI reaches the machine. It is there so a view of your machines — the macOS app's network map, or your own script reading `machines list --format json` — can group them by place. ## Why empty means `external` Every machine added before this field existed has none. Treating "none" as a place of its own, `external`, keeps those configurations valid and gives every machine an answer without rewriting anyone's `config.yml`. `config show --format json` and `machines list --format json` always print the effective value, so a reader never has to know this default. `external` is also what `machines add` offers, because a server you add is most often one you rent. Picking that default writes nothing, since nothing already means `external`. ## Why `create-local` writes `local`, and `self` does not Your own computer (`self: true`) can only ever be here, so its default is worked out, not stored: a self machine with no `location` is `local`. A `create-local` VM is a normal machine in `config.yml` — an address, a port, a key. Nothing in that entry says it lives on this computer, so `create-local --add` writes `location: local` into it. A VM added before this release has no `location` and shows as `external`; set it with `devmachine machines edit --location local`. ## Why the value is checked The value is trimmed and lowercased, so `Home` and `home ` are one place, not two groups on a map. Only letters, numbers, spaces, dots, underscores and hyphens are allowed, up to 40, so it is always safe to show as a label. --- # https://mydevmachine.sh/how-it-works/versioning-your-configuration/ `devmachine setup git` turns `/` into a git repository, so it can live in a private remote, be reviewed, and be restored. It never runs on its own. ## What is committed, and what never is | Path | Holds | Committed | | --- | --- | --- | | `config.yml` | machines, workspaces, packages, settings | **yes** | | `packages.lock` | the resolved package versions | **yes** | | `known_hosts` | public SSH host identities you approved | **yes** | | `AGENTS.md` | rules for a coding agent working in this folder | **yes** | | `keys/` | private SSH keys | **never** | | `secrets.json` | the keyring fallback, in the clear | **never** | | `cache/` | downloaded package trees | **never** | | `history.log` | what was run, against which host | **never** | | `logs/` | what each command printed, and how it ended | **never** | | `chats/` | the local copy of your chats | **never** | | `*.env` | anything a package staged | **never** | | `state/` | what each machine was last seen to run | no: it is read again on the next sync | | `packages/.install-*` | a package being fetched from a git address | **never**: a fetch a Ctrl-C cut short is swept after an hour | `config.yml` holds hostnames and usernames, which is exactly why the remote must be private — and why the command says so out loud rather than assuming you worked it out. ## Why the remote must be private `config.yml` names every machine you run: its address, its admin login, which workspaces live on it. Nothing in it lets somebody in, but it is a map of your infrastructure, and a public repo is a map handed to whoever finds it. `devmachine setup git` offers to create the remote itself with `gh repo create --private`, so the moment somebody chooses to publish this directory is the moment they should not have to remember the flag. ## Why the `.gitignore` comes first The order is: write `.gitignore` → `git init` → `git add` → guard → commit. Written after `git init`, there would be a window where `git add -A` could pick up `keys/id_ed25519` or `secrets.json` before anything excludes them. That window can be milliseconds, and the result is permanent: a private key in a commit is not undone by removing it at the tip. See [troubleshooting](/troubleshooting/#i-already-committed-a-key) if that has already happened. Writing the file first removes the window instead of shrinking it. ## The guard, and why it refuses rather than warns Every commit this feature makes stages everything, checks what actually got staged, and refuses if any of it is a path that must never be committed. A warning printed above a commit that already happened is a warning nobody reads — refusing before the commit is the only version that matters. The check is a closed list of paths — `keys/`, `secrets.json`, `cache/`, `history.log`, `logs/`, `*.env`, `packages/.install-*`, `chats/` — not a scan for things that look like a token, because the CLI wrote every one of these paths itself: nothing else lands in the configuration folder. ## Why the CLI writes its own commit messages Every write the CLI makes — `machines add`, `workspaces new`, `sync` locking a machine's packages — commits itself, with a message the command chose, such as `chore(config): add machine box`. A history is only useful if every entry can be trusted to say what actually ran. A commit message a language model wrote by looking at a diff is a guess dressed as a fact; a commit message the CLI wrote is a report — the command that ran is the only thing that could have written that exact line. The auto-commit never fails the command that triggered it: a broken signing key, for instance, is written to `history.log` instead, and the configuration change stands. ## Secrets never enter this history, by a different route A secret's value never lives in the configuration folder — it is kept in the OS keychain (`devmachine secrets set`), with `secrets.json` as the fallback with no keychain, already in the first `.gitignore` this command writes. `devmachine secrets example` lists the `=` a machine's packages need, with no value — the *shape* of what a machine needs, safe to review or hand to somebody else. --- # https://mydevmachine.sh/how-it-works/chats/ `devmachine chat` talks to the coding CLI you are already logged in to, `claude` or `codex`, on one of your workspaces or on this computer. The macOS app's Chats mode, its quick panel and the Ask widget all go through it, and so can a terminal. ## The CLI, not an API A chat never calls a model's API and never asks for a key. It runs the same `claude` or `codex` you use in a session, logged in with your own subscription. If that CLI works when you type it on the workspace, a chat works there too. If it is not logged in, the chat says so (`harness-logged-out`), and the fix is to log in there once. ## One process per message Each message starts the harness, sends the message, streams the answer and ends. No process waits between messages. The next message continues the conversation by the harness's own session id: `claude --resume ` or `codex exec resume `. The harness keeps the conversation in its own transcript on the workspace; that transcript is what the model sees. So a chat survives a closed laptop, an app restart or a dropped connection: there is nothing to keep alive. ## Read only A chat cannot change your files. claude runs with `--permission-mode plan` and codex with `--sandbox read-only`. This is fixed, not a setting: coding happens in a session, and a chat is for questions. ## What read only means Read only is the harness's own rule, so it is worth knowing where it stops. - claude runs in `--permission-mode plan`, so its own tools that edit files are refused. - Every other tool follows the workspace's own Claude settings and its permission allow list. With `--mcp` that includes its MCP servers: on 2026-10-16 an MCP tool that only reads (Linear's list_teams) ran in a chat, and so did a Bash command that only reads. - A tool that would need your approval is refused, since a chat has nobody to ask. claude lists those at the end of its answer; the chat passes them on as `denied` lines and the app shows them as blocked. - codex runs with `--sandbox read-only`, and with `--mcp` the MCP servers from its own config. A command the sandbox blocks fails inside codex, which reports no list of refusals, so it shows only as a tool line that failed. ## Warm sessions `chat send` starts the harness for every message, and the start-up is most of the wait. `chat session` (and `chat ask --serve`) start it once, before the first message, and keep it running: claude reads one message after another on its stdin (`--input-format stream-json`) and keeps the same session id and context. On a workspace the harness runs over one ssh session that stays open. Measured on 2026-10-16 (claude 2.1.301 on this computer, 2.1.300 on a workspace), time from sending "Reply with exactly: …" to the first word of the answer: | | This computer | Workspace | | --- | --- | --- | | `chat send`, one process per message | 4.6 s | 3.2 s | | `chat send --mcp` | 6.7 s | 6.9 s | | `chat session`, first message | 2.0 s | 2.3 s | | `chat session`, next message | 1.2 s | 2.1 s | `ready` itself comes back in well under a second; the harness goes on starting while the person types. On a workspace session, `chat ask --serve` answered the first question in 4.1 s and the next in 2.0 s, against 8.6 s for a one-off ask before the changes on this page. A session closes after 10 minutes with no message, or when its stdin ends, so nothing is left running for a window nobody looks at. codex has no mode that keeps reading messages, so its sessions still run `codex exec` per message. A stop in the middle of an answer cannot be sent to claude: the process is stopped and started again with `--resume`, which keeps the conversation. ## MCP servers are off unless you ask Most of the time a harness takes to answer goes into starting up, and most of the start-up is the account's MCP servers, hooks and plugins. Measured on a workspace with 14 MCP servers (claude 2.1.300), "ok" took: | How claude ran | Time | | --- | --- | | `claude -p`, everything on | 12.5 s | | `--strict-mcp-config --setting-sources project` | 5.5 s | | the same, on haiku with no tools (an ask) | 3.6 s | | a reused ssh connection running `true` | 0.2 s | So a chat runs without them: claude gets `--strict-mcp-config --setting-sources project`, which starts no MCP server and reads no user settings, so no user hooks or plugins run. The login is not a setting and still works. `--mcp` on `chat send` or `chat session` turns them on, for a chat that needs a tool from an MCP server. The choice is kept on the chat (`"mcp": true`): later messages use it until `--mcp` or `--mcp=false` changes it. `devmachine config set chat.mcp true` makes it the default for new chats; the app's Settings → Chats switch writes the same key. codex has no flag that skips only its MCP servers: `-c mcp_servers={}` did not stop them. Without `--mcp` it runs with `--ignore-user-config`, which skips all of `~/.codex/config.toml` and keeps the login. A chat then uses codex's default model, not the one your config chooses; `--mcp` brings your config back, with its MCP servers. ## Where a chat runs A new chat runs on `--workspace`, or `--local` for this computer. With neither, it runs on `chat.default_workspace`; with that unset, on the first workspace in `config.yml`; with no workspace at all, on this computer. A chat keeps where it started: `--chat` with another harness, workspace or folder is refused rather than quietly moved. It runs in `~/chats` on that machine (`chat.folder`), created on first use, so a question with no project does not land in one of your repositories. The harness is found the way your login shell finds it: the command asks the account's login shell for its `PATH`, and adds `~/.local/bin`, where the claude and codex packages install. The message itself never passes through that shell: it goes to `/bin/sh` on its input, so a fish or zsh login shell cannot read its quotes differently. ## The local copy Every message and answer is also kept on your computer, in `/chats/` (`index.json` for the list, one `.jsonl` per conversation). The app reads this copy, so opening an old chat needs no connection. Writes go through a lock and a rename, so the app and a terminal writing at once lose nothing. The folder holds private conversations. It carries its own `.gitignore`, and `devmachine setup git` refuses to commit it. Deleting a chat removes the local copy only. The harness's transcript on the workspace stays. ## Asking about a session `devmachine chat ask` answers a question about a coding session without typing into it or interrupting it. It runs where the session's transcript is: on the workspace for a workspace session, here for a session on this computer. It first finds the session's folder (from tmux, or `--folder`), the harness running there, and its newest transcript: the same signals the Context tab uses. Then, on every question, it reads that transcript as it is now (a claude `.jsonl`, or a codex rollout) and turns it into plain text: what you asked, what the agent answered, and one line per tool it used, with long tool output cut short and its private reasoning left out. From that it keeps the last six turns, plus the lines that share a word with the question, up to about 28 KB. The record's `excerpts` says how many pieces went in. A transcript can be tens of megabytes, so it is not copied whole. The machine sends the last megabyte, plus the older lines that hold a word of the question, which `grep` finds there. When the caller names the harness, as the app does, finding the session and reading its transcript take one trip over the connection. On a workspace with a 22 MB transcript this part went from 1.5 s to 0.55 s. Before the question it adds the earlier questions and answers of this ask, the last six or about 8 KB, so a follow-up such as "and the tests?" makes sense. That prompt goes on stdin to the session's own harness, set up to answer fast and touch nothing: - claude: `claude -p --strict-mcp-config --setting-sources project --disable-slash-commands --tools "" --no-session-persistence --model haiku`. No MCP server starts and no tool can run, and nothing is saved. - codex: `codex exec --ephemeral --ignore-user-config --sandbox read-only`. It keeps its login but skips `config.toml`, so none of its MCP servers start, and it saves no rollout. Each question also finds the session again. A claude session can move to a new id, after `/clear` for example, and the next question then reads the newest transcript, not the one the ask started with. `source_session_id` follows it. ### Why not a fork The first version asked claude to fork the session (`claude --resume --fork-session`) and resumed that fork for follow-ups. That had two problems: - A fork re-sends the whole session to the model on every question. On a 17 MB session that was 639,041 tokens of cache writes for one question: slow, and a big bite of your usage limit. - A fork knows only what the session had done when it was made. Anything the session did after the first question was invisible to every later one. Reading the transcript again on each question fixes both. The answer comes from the part of the session that matters for the question, and it is always the session as it is now. A lean run answers a short question in about 2 to 3 seconds. Other harnesses get `harness-unsupported`. An ask is kept like a chat, with `kind: "ask"`, and `chat list` leaves it out unless `--all`. It stays an ask: it goes on only with `chat ask --chat`, and `chat send` refuses it, because it has no harness session to send to. --- # https://mydevmachine.sh/how-it-works/published-sites/ `expose add` used to write a Caddy file straight onto the machine and reload Caddy. It worked, but it left the only record of the site on the machine: rebuild from the configuration, and the sites `expose` had written never came back. So the record moved. A route is a field of the workspace that owns it: workspaces: - name: acme routes: - {host: app.example.com, port: 8080} `expose add` writes that line. `sync` renders one file per workspace, `acme-routes.caddy`, into the `sites.d` folder the `caddy` package provides, and reloads Caddy when the file changed. `expose rm` deletes the line (and the name's DNS record, see below). There is one direction — configuration to machine — devmachine never reads the machine to learn what should be published, only to check it agrees. ## Why `expose` does not wait for `sync` `sync` runs the machine's whole play: every package, every workspace. That takes minutes, and a new subdomain should take seconds. So `expose add` and `expose rm` also apply the one file the route changes, right after they record it: 1. Render the workspace's routes file from `config.yml` with the same code `sync` uses. Same bytes, same path, owner `root:root`, mode `0644` — so the next `sync` finds nothing to change. 2. Write it next to the real file, under a name the Caddyfile's `sites.d/*.caddy` import does not match. 3. Set the old file aside (and any one-host file the old `expose` wrote for one of these hosts), and move the new one in. 4. Run `caddy validate` on the whole `/etc/caddy/Caddyfile`. The new file has to be in place for this: nothing else would check the full configuration with it. 5. Reload Caddy (`systemctl reload caddy`, then `caddy reload` if that fails), and delete what was set aside. A Mac has no systemd: its Caddy runs under launchd, and `caddy reload` reaches it through Caddy's own admin endpoint. `sync` reloads it the same way there. If Caddy refuses the file in step 4 or 5, the old files go back, Caddy never loads the new one, and the command prints Caddy's own error. Caddy reads the files only on a reload, so the short time the new file sits in place changes nothing it serves. Only that workspace's file is touched, and it is rendered from the whole configuration, not patched: if the machine's copy has drifted, it comes back to what `config.yml` says. Other workspaces' files wait for `sync`. It runs over the same SSH connection `devmachine run` shares, as the machine's admin login (through `sudo -n` when that login is not root). A machine that cannot be reached, or a machine with `caddy` in the configuration but not installed yet, is not an error: the route stays `pending` and `sync` publishes it. A [self machine](/how-it-works/your-computer-as-a-machine/) always waits for `sync`. `--no-apply` skips all of this and only records the route. ## What `sync` takes away When the configuration owns a host, `sync` also removes the one-host file the old `expose` wrote for it, since Caddy refuses to reload with one host named twice. A workspace whose last route was removed gets its `-routes.caddy` removed, not emptied — an empty file would still serve. Nothing else in `sites.d` is touched. A file another package added, or written by hand, is not the configuration's to delete; `expose list` reports it as `unmanaged` and says how to adopt it. A file another package adds to `sites.d` — like the one `caddy-sites` writes — also reloads Caddy when `sync` changes or removes it. Without that reload, Caddy would keep serving the old file until something else reloaded it. ## Why DNS is still pointed by `add` The DNS record is not in the configuration, and `sync` does not write it. A name that does not resolve fails minutes later, in Caddy's certificate log, where nobody is looking — so `add` points the name in the same breath, printing the record to create by hand if the machine is unreachable. ## Why `rm` removes the record only while it points at the machine A name left pointing at a machine that no longer serves it still resolves: visitors reach Caddy, which has no site for it and refuses the TLS handshake. So `rm` takes the record off too, right after Caddy. But the record is not in the configuration, so `rm` cannot know it made it. It works out the record `add` would have made — the serving machine's first public address, the same one `add` uses — and asks the provider that holds the zone for the name's A records. Only a record with exactly that value is deleted. A different value means somebody repointed the name, maybe at a new server, and deleting it would take that down. A provider that cannot list the zone deletes nothing: a delete it cannot check first is a guess. The DNS step never undoes or blocks the Caddy step. When it fails, the site is still off Caddy, and the record to remove by hand is printed. `workspaces destroy` does the same for every site of the workspace, each on the machine that serves it, after the account is gone: once the workspace leaves the configuration, nothing would remember those names pointed at the machine. When a record is printed instead of written or removed, the line above it says why: the machine could not be reached (the provider runs on it), no DNS provider is installed there, or no installed provider holds the zone. `--no-apply` means "touch no machine", and a DNS provider runs on the machine, so `rm --no-apply` leaves the record and prints the `dns rm` to run later. `add --no-apply` still points the name: a name that resolves early does no harm, and one that does not stops the certificate on the next `sync`. ## Publishing through another machine A machine the internet cannot reach — a VM on your desk, a box behind NAT — can still have its port published, by a machine that the internet does reach and that runs Caddy: workspaces: - name: acme machine: lab routes: - {host: app.example.com, port: 8080, via: edge} `expose add acme 8080 --host app.example.com --via edge` writes that line. The name points at `edge`, and `edge`'s Caddy proxies to `lab`. Nothing is installed on `lab`. **There is no "main" machine.** Which machine serves a site is written on the route, so a configuration with three machines and two Caddys means the same thing to everybody. Without `via`, a route is served by its workspace's machine, as before. When that machine has no caddy, `expose` refuses and names the machines that have it, instead of picking one. **The address comes from `lab`'s `hosts`, not from a VPN.** The CLI resolves them the way it does to connect (see [addresses and fallback](/how-it-works/addresses-and-fallback/)) and takes the first address a network package gave, since that is a private network both machines can be on; then any other; never a loopback one, which would name `edge` itself. Tailscale, Headscale, plain WireGuard or a LAN address all work the same way, because the CLI only ever sees an address. **It is resolved every time, never stored.** `expose` and `sync` resolve it when they write `edge`'s file, so a machine that moves is followed by the next sync. When the address cannot be found from your computer — the private network is off here — `sync` leaves that workspace's file on `edge` exactly as it is and says so: the site keeps answering the way it did, instead of disappearing because of where you ran the command. **`edge` owns the file.** It is `acme-routes.caddy` in `edge`'s `sites.d`, the same name sync uses everywhere. A machine with caddy owns the routes file of every workspace in the configuration: written when it serves one of its routes, removed otherwise. Taking the last `via: edge` off a route therefore also takes the file off `edge` on its next sync, and `workspaces destroy` removes it there before the workspace leaves the configuration — afterwards nothing would. For the same reason `workspaces rm` refuses while one of the workspace's sites goes through another machine, and `machines rm` refuses a machine that still serves a site for another one: `expose rm` the host first. **`expose add` checks the path once.** After Caddy has the site, `edge` tries to open a connection to `lab`'s port. When it cannot, the site stays published and the command says what to look at, because otherwise every visitor gets a bare 502: the service listening only on `127.0.0.1`, a firewall on `lab`, or the two machines not on the same private network. --- # https://mydevmachine.sh/how-it-works/what-sync-removes/ `sync` only removes a file it recorded writing. Never a guess, never a whole directory swept clean — one path, remembered, removed once the plan stops writing it. ## Two kinds of file, one rule A workspace's routes and a package's `extends` both write into `sites.d`, and `sync` removes both the same way: it keeps a list of exactly what it wrote, and takes away whatever is no longer on that list. - **Routes** come from `expose`. See [why a published app lives in the configuration](/how-it-works/published-sites/). - **Extension files** come from `extends: caddy.sites.d: `, a package's way of adding to a place another package opened. `sync` records every extension file's path in the lock, per machine, and removes one once the package that wrote it drops out of the plan. ## Why not a glob `sites.d` can hold files nothing in the configuration wrote — one dropped in by hand, one from before this feature existed. A glob over the directory would delete those too, so `sync` only removes a path it remembers writing itself. ## The first-run caveat The list of extension paths lives in the lock. A lock from before this feature has no such list, so the first sync after upgrading removes nothing — there is nothing yet to compare against. A file left by a package removed *before* this version never enters the tracked list either, so no later sync catches it. Remove it by hand with `devmachine run`; see [Troubleshooting](/troubleshooting/). --- # https://mydevmachine.sh/how-it-works/syncing-one-workspace/ `devmachine sync --workspace ` applies one workspace and nothing else. It finds the machine the workspace lives on, so `--machine` is not needed. On a machine with many workspaces, a full sync runs every package of every workspace; this runs only the packages of the one you name. ``` devmachine sync --workspace acme devmachine sync --workspace acme --check devmachine sync --workspace acme --tags claude-code ``` ## What it runs - The workspace's own packages, with its own settings. - The skills its packages bring, and the shared logins it asked for. - The files its packages add to another package's folder (`extends`). - Its routes file in Caddy's `sites.d`, and a Caddy reload when that file changed. ## What it leaves alone - **The machine's own packages.** They do not run. A workspace package that relies on one assumes it is already there, as it is after any full sync. - **Every other workspace.** Its packages, its routes file and its extension files are not touched, and not even sent. - **Removals of extension files.** A full sync removes the file a package left behind when it left the plan. A one-workspace sync does not: see below. The host variables still list every workspace on the machine (`devmachine_workspaces`). Some machine packages read that list, and a package that ran with half of it would act on half of the machine. ## Why it removes no extension file An extension file's name starts with its workspace, so `acme`'s files look like `acme--`. But a workspace named `acme-api` writes `acme-api--`, which starts with `acme-` too. A narrowed sync could only tell its own old files from another workspace's by guessing, and a wrong guess deletes somebody else's site. So the narrowed sync writes, and never removes. The lock keeps every path it already knew, so the next full `sync` still removes a file that is no longer wanted. See [what sync removes](/how-it-works/what-sync-removes/). ## What the lock records Only the workspace's entry in `packages.lock` is replaced. The machine's entry, and every other workspace's, stay as the last sync left them. With `--tags`, only the named packages of that workspace are recorded, as for a tagged full sync. A dry run (`--check`) writes nothing. The lock's format does not change, so an older CLI reads a lock a one-workspace sync wrote, and its next full sync brings the rest of the machine up to date. ## When to run a full sync instead - After changing a machine package, or a machine's settings. - After removing a package that added a file to another's folder, to have that file removed. - On a new machine, where the machine packages have never run. --- # https://mydevmachine.sh/how-it-works/one-sync-per-machine/ Only one `sync` runs on a machine at a time. A second one, from another terminal, another computer, or the app's Prepare button, stops at once with: ``` another sync is running on main: wait for it to finish, then run this again ``` It changes nothing on the machine. Run it again when the first one ends. ## Why Every sync empties the bundle directory (`/opt/devmachine`, or `~/.local/share/devmachine/bundle` on your own computer) and sends its own copy before it starts the play. Ansible reads some files from that directory while the play runs, such as a file a `copy` task sends. Two syncs at once would delete each other's files halfway through, and the first one would fail on a file that was there when it started. A dry run (`sync --check`) takes the lock too: it sends the bundle the same way. ## How the lock works The lock is a directory next to the bundle: `/opt/devmachine.lock`, or `bundle.lock` on your own computer. Making a directory either works or fails in one step, on Linux and on a Mac alike. A Mac has no `flock` command, so the lock does not use it. A sync makes the lock directory before it touches the bundle, and keeps an SSH session open on the machine for the whole run. When the sync ends, the session closes and removes the lock. If the connection drops, or you stop the sync with Ctrl-C, the session ends and removes the lock the same way. The lock records the process that holds it and the machine's boot. If a sync dies with no chance to clean up, or the machine reboots in the middle, the next sync sees that nobody holds the lock any more and takes it over. You never have to remove it by hand. The lock waits for nothing: a second sync refuses instead of waiting, so a stuck run never leaves a queue of runs behind it. --- # https://mydevmachine.sh/how-it-works/uploads/ `devmachine upload` exists so an app or an agent can hand a file to a workspace and get back a path it can use. Each rule below serves that. ## It runs as the account the file is for With `--workspace`, the CLI logs in as the workspace's own account, the same way `run --workspace` does. Every folder and file it makes is that account's from the start. Root never writes into a workspace's home, so there is nothing to hand over with a `chown`, and nothing root could be tricked into writing somewhere else. ## A new name every time, never an overwrite The time goes before the extension (`report-20260930-143012.pdf`), so a second upload of the same file does not replace the first, and the file still opens with the right program. When two uploads land in the same second, the second gets `-2`. The file arrives under a temporary name and is then linked to its final name. A link fails when the name is taken, instead of replacing what is there, so even two uploads at the same moment cannot overwrite each other. A half-sent file never shows up under its final name. ## It stays inside the home `--dir` is checked twice. On your computer, a folder that climbs out with `../` is refused before anything connects. On the machine, the nearest existing folder on the way is resolved, and if it leads out of the home through a symbolic link, the upload stops before it writes. A link that stays inside the home is fine. A folder named with accents is matched the same way `download` matches one: when `--dir` as given is not on the machine, its composed form is used, so a Mac app that sends it decomposed does not get a twin folder next to the real one. See [how a download lands](/how-it-works/downloads/#an-accent-a-mac-spelled-differently-still-matches). ## A file name is never a command The name of a file is whatever its owner typed, and a name like `'; rm -rf ~; $(id).txt` is legal. The CLI sends names to the machine encoded in base64, and the machine decodes them into variables. The name is never part of a command line, so nothing in it can run. The file's content travels on standard input, over the same SSH connection `run` keeps open, so many uploads in a row share one login. --- # https://mydevmachine.sh/how-it-works/downloads/ `devmachine download` exists so an app, an agent or a person can take a file off a workspace without knowing how to reach it. Each rule below serves that. ## It reads as the account the file belongs to With `--workspace`, the CLI logs in as the workspace's own account, the same way `upload` and `run --workspace` do. It can read exactly what that account can read, and no more: nothing reads a workspace's files as root on its behalf. ## The name stays, and nothing is overwritten A download keeps its name, because it lands among your own files and you look for it by that name. When `~/Downloads` already holds one, the new file gets `-2`, `-3` and so on before the extension, the same counter `upload` uses on the machine. The bytes go to a hidden temporary file in the destination first. Only when the whole file has arrived does the CLI claim the first free name (a create that fails when the name is taken, so two downloads at the same moment cannot both take it) and move the file there. A transfer that fails or is cut never leaves a half file under the real name. ## A folder is one archive A folder comes back as `.tar.gz`, packed on the machine and streamed in one piece. One archive is written whole or not at all, the same as a file; a folder copied file by file could stop half way and look complete. It also keeps permissions and symbolic links as they were, and never merges into a folder of the same name you already have. ## A path is never a command A path is whatever its owner typed, and `'; rm -rf ~; $(id).txt` is a legal file name. The CLI sends it to the machine encoded in base64, and the machine decodes it into a variable. The path is never part of a command line, so nothing in it can run. ## An accent a Mac spelled differently still matches A letter like `ç` can be stored as one character (composed) or as `c` plus a separate cedilla (decomposed). Linux file names are almost always composed; a Mac app's process arguments arrive decomposed, even when the app had them composed. The bytes differ, so the machine would answer "does not exist" for a file that is there. When the path as given is not on the machine, `download` tries its composed form before giving up. ## The connection is the one `run` keeps open The file streams over the same SSH connection `run` and `upload` reuse, so many downloads in a row share one login. If that connection drops after part of the file arrived, the CLI does not try the machine's next address: the next address would send the whole file again after the part already written. It stops and says so instead. ## Progress knows the whole size before it starts With `--progress`, the CLI asks the machine about every path before it reads a byte of any of them, and prints a line with each size first. A reader that adds the sizes up has the real total from the start, so its bar never runs to the end for the first file and then jumps back when the second one appears. A folder has no size to give. Its archive is packed while it travels, and how well it compresses is not known until it ends, so its `total` is `0` and only `done` grows. The lines go to stderr, so stdout stays the same list of paths, or the same JSON, with or without the flag. --- # https://mydevmachine.sh/how-it-works/what-a-new-machine-starts-with/ `setup` and `machines add` write a new machine with one package, `essentials`. It installs nothing itself; it pulls in the packages almost every server wants: | Package | What it gives the machine | | --- | --- | | `base` | the everyday tools, and a shared tmux setup | | `git` | git | | `firewall` | a firewall that lets SSH, HTTP and HTTPS in | | `ssh_hardening` | password logins kept off on every sync | | `caddy` | Caddy, to publish sites with HTTPS | | `devmachine-app` | what the macOS app reads from the machine | `--no-essentials` starts the machine with none of it. ## On a Mac `essentials` runs only on Linux: a firewall, SSH hardening and Caddy have no macOS version, and `sync` refuses the package on a Mac. So when the machine turns out to be a Mac, `setup` and `machines add` start it with `base` and `devmachine-app` instead, and with the package manager package (`mac-brew` or `mac-ports`) that installs Ansible there. They print one line that says so: ``` studio is a Mac and essentials runs only on Linux, so it starts with base and devmachine-app instead. ``` The system is not known until the CLI connects, which is after the machine's packages are chosen, so the swap happens at that moment. It only replaces the default: with `--no-essentials` the Mac starts with the package manager package alone. Only what the pinned package release has goes in, as with `essentials` itself. ## Why a default, and not a question Nearly everyone wants these. A question at setup is one more thing a new user has to understand before they have seen anything work, and a list they must remember to add is a list they forget. So the choice is to leave them out, not to put them in. ## Why Docker is not in it Docker is large and runs a daemon all the time, and plenty of machines never run a container. Add it with `devmachine packages add docker` when you want it. ## Why the macOS app's package is in it The macOS app does not read a machine over plain SSH. It calls three small scripts through `devmachine run --package devmachine-app`: - `context` — the sessions running in a workspace, for the session list; - `stats` — memory, disk, load, containers and ports, for the health view; - `caddy-logs` — the tail of Caddy's log. Without the package, the app finds nothing to call and shows no sessions. Nothing in the app tells you a package is missing on the server side, and the app may be installed months after the machine was set up — long after anybody remembers there was a package to add. Shipping it with every new machine means the app just works, whenever it arrives. The cost is low. The three scripts only read: they change nothing on the machine, open no port, and run nothing in the background. They only run when something calls them. They also work on a machine without Docker (`stats` reports no containers instead of failing). ## A machine set up before A machine set up before `essentials` held `devmachine-app` gets it on its next `sync` after `devmachine packages pin` moves it to a package release that has it. A machine started with `--no-essentials` does not: add it with `devmachine packages add devmachine-app --machine ` if you use the app. --- # https://mydevmachine.sh/how-it-works/widgets-come-from-packages/ A widget you pick from the gallery comes from a package: the pinned packages release, or a package in your configuration folder. There is no widget store, no folder of loose widgets, and no copy inside the app. The one other way is to write a widget straight into a board (engine 1.1), which is how you or your agent make a one-off; one that runs something [waits for your approval](/how-it-works/why-an-agent-written-widget-waits/). ## One place for a tool and its widget The usage widget for Claude Code belongs next to the role that installs Claude Code. When the role changes, the widget can change in the same release, and both arrive together on the next update. A second source of widgets would be a second thing to pin, fetch, check and explain. It also means your own widgets work the same way as the published ones. A package in your configuration folder with a `widgets:` folder is all it takes, and it replaces a release package of the same name, as packages always do. ## When a widget is available A widget whose data comes only from the app — `app/clock`, `app/summary`, `app/machines`, `app/harness-usage` — is available at once. The app already has that data; adding a package to a machine would install nothing it needs. A `url` widget is available at once too: it reads a web page, and nothing on a machine is involved. A `command`, `prompt` or `session` widget runs something its package installs on a machine. It is available only when that package is added to a machine or workspace **and** a sync has applied it. Until then `widgets list` shows it with `available: false` and the command that fixes it: ``` add the package: devmachine packages add github-prs --machine sync to install the package: devmachine sync ``` "Synced" is read from `packages.lock`, which records what the last sync applied. The CLI does not connect to a machine to check. ## Why the app has no built-in copy The app ships no `widget.yml` of its own, not even for the clock. A built-in copy would be a second version of the same widget that drifts from the published one, and nobody could tell which one they are looking at. This is the same choice as [nothing embedded in the CLI](/how-it-works/why-nothing-is-embedded/). The cost: the first time the app starts with no network and no packages release in the cache, Home has nothing to draw and says it could not fetch packages. Once a release is in the cache, it works offline. ## Which release `widgets list` reads the release pinned in `config.yml`. With nothing pinned yet — or no `config.yml` at all — it uses the latest release, the one `setup` would pin, so the app has widgets before the first machine exists. If the latest release cannot be found, the command fails and says why, rather than showing an empty list. ## Why the CLI refuses a broken board `widgets add` and `widgets remove` read the board, change it, and write it back in one step that cannot leave half a file. If the board has a mistake, they stop: writing it back would replace your typo with what the CLI guessed you meant, and could drop widgets. If the file changes while the command runs — the app saved it a moment before — the CLI stops too, and running it again works on the new file. A save between the final check and the write could still be lost. Both the app and the CLI write the board rarely. --- # https://mydevmachine.sh/how-it-works/why-an-agent-written-widget-waits/ A board is a plain file in your configuration folder, and that is on purpose: your coding agent can add a widget to Home as easily as you can. It also means anything that can write that file can put a command on your Home. So a widget written in a board that runs something — a `command`, a `prompt` or a `session` — shows **Allow** and **Deny** instead of running, until you say yes. ## What waits and what does not - **A `command`, `prompt` or `session` written in a board waits.** These run a program on your computer, a machine or a workspace, or read a session's screen. - **A `url` does not wait.** It only reads a web page, the way a browser would. - **A widget from an official or a local package does not wait.** You chose that packages release, or you wrote the package; `devmachine packages validate` checks its widgets like the rest of it. - **A widget from a third-party package waits when it runs something** — a `command`, `prompt`, `session` or package provider. See [where a public widget comes from](/how-it-works/where-a-public-widget-comes-from/). ## What you approve The card shows what will run, where and how often. What you approve is that exact source: its kind, the command or script and its arguments, the target, the coding agent, its permission mode and prompt, the session. The app keeps a fingerprint of it (a SHA-256 of the source written in a fixed order). Change any of those — even one argument — and the fingerprint changes, so the widget asks again. Moving or resizing the widget changes nothing that runs, and does not ask. ## Where the answer is kept Approvals live in `~/Library/Application Support/Devmachine/widget-approvals.json`, outside your configuration folder. If they lived next to the board, the same agent that wrote a widget could write its approval too, and the question would protect nothing. **Deny** pauses the widget; it stays on the board, so you can change your mind from its card. To get rid of it, remove it. ## Why widgets on a machine go through the CLI A widget whose target is a machine or a workspace runs its command through `devmachine run`, the same door you use. The app never opens an SSH connection of its own: the CLI already knows the address, the account, the key and the host key, and reuses one connection for five minutes, so a widget polling every few seconds costs no new handshake. These runs use `--no-log`, so they do not fill [the command log](/reference/commands/#the-command-log). --- # https://mydevmachine.sh/how-it-works/where-a-public-widget-comes-from/ Anybody can publish a package with widgets in a git repository, and you can install it with one command: ``` devmachine packages install https://example.com/alice/tools.git@v1 ``` This page says what that brings onto your computer and your machines, and why some of its widgets ask before they run. ## Three kinds of package Every widget comes from a package, and the package says how far its widgets are trusted (`trust` in `devmachine widgets list --format json`): - **official** — the pinned packages release. You chose it with `packages pin`, and every change to it is reviewed before a release. - **local** — a package you wrote in `/packages/`. - **third-party** — a package installed from a git address. Its folder has a `.devmachine-source.yml` saying where it came from and which commit. ## What waits for you A third-party widget that runs something — a `command`, a `prompt`, a `session`, or a package provider — shows **Allow** and **Deny** in the app before it runs, the same as [a widget an agent wrote in a board](/how-it-works/why-an-agent-written-widget-waits/). A widget that only reads the app's own data or a web address does not ask. What you approve covers the widget's source, filled in, and the package's commit. `packages update` that moves to a new commit asks again, because the code behind the widget changed. Official and local widgets do not ask: you chose that release, or you wrote the package. ## What installing does, and what it does not `packages install` fetches one commit, checks it, and shows you what it brings before writing anything: its widgets and which run code, the commands of its entrypoint, its providers, every executable file, every task file, every other file of the role that decides what those tasks do (`meta/`, `library/`, `templates/`, `vars/` and the like) and the credentials it asks for. It refuses: - a name the pinned release has, because a package of yours always wins over the release's and would replace it on every machine; - a name you already have in `/packages/`, your own or one installed before (`packages update` is how a package from a git address changes); - a file name or a line of what it brings holding a character that moves or hides text in a terminal, such as ESC or a Unicode bidirectional override: such a name could erase the lines above the prompt, the "runs as root" warning included, and you would answer a question you cannot read. A file name that is not UTF-8 is refused for the same reason. The prompt also prints any such character as an escape, in case one gets past, and so does every error that quotes the repository: git's output, a problem in its `package.yml`, a link's name; - a link that leads outside the package, which would copy a file from your computer to your machines; - a package that does not validate. Installing touches no machine. **Adding it to a machine is the step that matters**: `packages add --machine ` and `sync` run its Ansible tasks there as root, like every package's. The widget approval does not cover that. Read its tasks before you add it; `install` lists them. ## When the release gains the same name later `install` checks the name against the release pinned at that moment. A later `packages pin` can bring a release that has a package of the same name. Your copy would then win on every sync and replace the official one without a word, so `sync` refuses instead, before it connects. It does not pick one for you: the two packages share a name, not an author. Take the third-party one off (`packages rm`, then `packages remove`), or pin an earlier release. ## Why there is no signature Nothing checks who wrote a third-party package. A signature would say who published it, not whether its code is safe, and you would still have to decide. So the CLI makes the decision visible instead: it shows what the package brings and asks, and its widgets that run code ask again in the app. A list of trusted publishers may come later. ## Why a package provider runs through the CLI A widget that reads a package's own command, such as `devmachine-app/stats`, runs `devmachine run --package --machine --no-log -- -- `. The CLI already knows the machine's address, account and key, and refuses any command the package does not list in `commands`. The app never builds a shell line: each value of the widget's `with` arrives as one word. --- # https://mydevmachine.sh/how-it-works/what-runs-in-the-menu-bar/ The menu bar item is two boards: the title you always see (`menubar.yml`) and the popover that opens when you click it (`menubar-panel.yml`). They run at different times, on purpose. ## The title runs whenever the app runs The title is on screen even when every window is closed, so its widgets run while the app runs, window or not. That is also why they are held back: a widget there runs at most every 30 seconds, whatever its `every` says. A command or a provider that reaches a machine over SSH every 5 seconds, all day, costs battery and the machine's time for a number you glance at. ## The popover runs only while it is open Nothing in the popover shows when it is closed, so its widgets start when it opens and stop when it closes. A tab is the whole popover, which is why a `size` there does nothing. ## Why three widgets, one line and 24 characters macOS draws the menu bar title as a small picture, in the same color as the other icons, and the strip is shared with the clock and every other app. So the title holds text and at most one symbol per widget (the status dot), never a chart or an image. Three widgets of at most 24 characters keep it from pushing other items off the screen. Longer text is cut with "…". That is also why only `text`, `number`, `status` and `app.brand` draw there. ## A widget that waits for your approval A widget that runs something you have not allowed yet cannot ask in one line. It shows "!" in its place; clicking the menu bar item opens the popover with an Approvals tab, where its Allow card is. See [why a widget an agent wrote waits for you](/how-it-works/why-an-agent-written-widget-waits/). --- # https://mydevmachine.sh/how-it-works/choosing-and-editing-a-widget/ A widget can let you pick what it shows: which machines, which coding agent. The widget only declares the input; the app draws the chooser. This page says where the choices come from and why a wrong one never breaks a board. ## Where the options come from A `choice` input names one of three lists: `machines` and `workspaces`, read from your `config.yml`, and `harnesses`, the coding agents that report usage. The app fills the list from what it already knows, so any widget with a choice gets a checklist (`many: true`) or a picker, with no code written for that widget. The board keeps the names you picked: one name, or a list for a choice of many, such as `with: {machines: [main, backup]}`. An empty list means all of them, so a widget you never touched follows your configuration as it grows. The app, not the CLI, builds the value a widget reads. A choice of many reaches `{{inputs.x}}` and `$DM_INPUT_X` as its names joined with commas, so `[main, backup]` arrives as `main,backup`. A comma is the separator, so a name with a comma in it would read as two names. The CLI does not allow one in a machine name, and `--set name=a,b` always splits at commas. It does not check a workspace name, so keep commas out of those. What an empty list (all of them) arrives as is the app's choice, so a widget should not depend on it. ## Why a name the configuration lacks is only a warning Machines come and go. If removing `backup` from `config.yml` made every board that once picked it invalid, the CLI would refuse to change those boards, and the app would refuse to draw them, until you edited each file by hand. So `widgets validate`, `widgets add` and `widgets set` print a warning, and the app leaves the name out. The board stays usable, and the warning tells you which pick to clean up. A name of the wrong shape is different: a single name where the widget takes a list, or a list where it takes one name. That is a mistake in the file, not a change in your setup, so it is a problem at its line. ## Why only a widget from a package takes title and every A widget from a package is shared: its `widget.yml` is the same for everybody, so a board entry is the only place to say "call this one Claude, and check it every two minutes". A widget written in the board has no such split: its title and its `source.every` are already in the entry, so a second `every` next to them would only leave two answers to the same question. The override may not go below the source's minimum, for the same reason the widget itself may not: the minimum protects the machine the source runs on, not the widget. A prompt widget whose `permission_mode` runs without any check takes only `every: manual` there too: changing one copy cannot put it on a timer. See [a prompt widget's permission mode](/how-it-works/a-prompt-widgets-permission-mode/). ## Why widgets set leaves a written widget's source alone A widget written in a board runs what its `source` says only after you press Allow, and the app asks again whenever that source changes. A command that rewrites the source from flags would make that change easy to make without looking at it, so `widgets set` changes a written widget's title only. Its source is changed in the board file, where you see the whole of it, or in the app's editor, which shows it and asks again. --- # https://mydevmachine.sh/how-it-works/why-a-widget-is-as-tall-as-what-it-shows/ On Home, a widget used to be a box of a fixed size. A one-line summary sat in a box 160pt high, and no preset was shorter than that. Engine 1.7 turns this round: a widget whose view has a natural height is as tall as its content, and a height you set can only make it shorter. This page says why it works this way. ## A box is never taller than its content Empty space under a widget says nothing and hides the widget below it. So for a view that grows, the app draws `min(content, cap)`, where the cap is the height you chose. `size: auto` means "no cap". A board file that still says `size: custom` with `h: 160` for a summary keeps working: 160 is now a cap, and the content is shorter. Which views have a natural height is in the engine contract: a view carries `grows: true` (`devmachine widgets schema --json`). A clock, a gauge, a web page or a terminal has no such height, so it keeps its preset or the size you gave it. ## The cap after a resize When you drag a growing widget shorter, the stored height is the height drawn when you let go, so it is never above the content. If the drag ends within one snap (8pt) of the content, the app writes `size: auto` instead. That way a widget you pulled to "about its size" goes on following its content, and one you made clearly shorter stays shorter. ## Why `auto` has no `h` An `h` next to `auto` would be a number nobody keeps true: the content changes (a machine is added), and the file would be wrong at once. So the frame of an `auto` widget is `{x, y, w}`. An `h` written by hand is read and ignored, and the next write by the CLI or the app drops it. Without `auto`, the `h` is required, as before. ## Pushing down is only on screen When a widget grows, the ones below it move down so nothing is covered. That happens when the app draws: each widget is placed in the order of its stored `y`, and it is moved down only as far as needed to keep 8pt below the widgets above it. The stored `y` does not change, and nothing is ever pulled up. If it were written to the file, a machine added at noon would rewrite your layout, and a machine removed would leave a hole in it. ## Why the CLI estimates The CLI cannot measure what the app draws. To find a free spot for a new widget (`widgets add` without `--at`), it counts an `auto` widget at the height of its `default_size` (160pt for a widget written in the board). This is a guess, and it is made on purpose: a guess that keeps new widgets apart is enough, the app draws the real height, and `--at` places a widget exactly where you say. ## What the CLI checks A growing view has no least height on Home, only a least width (the width of the smallest preset it takes), so the CLI refuses a frame that is too narrow with "frame width … is narrower than …". A view that does not grow keeps both limits. See [the widget format](/reference/widget-format/) for the rules, and [troubleshooting](/troubleshooting/) for the messages. --- # https://mydevmachine.sh/how-it-works/a-prompt-widgets-permission-mode/ A prompt widget asks a coding agent a question and shows the answer. By default the coding agent answers without using tools, so a widget asked to search the web says it has no permission to. `permission_mode` lets the widget use them. This page says why it looks the way it does. ## The coding agent's own names The values are the names Claude and Codex use themselves: Claude's `--permission-mode` choices, and Codex's `--sandbox` values and two of its flags. The CLI invents none of them, so what you read in a coding agent's own help is what you write in the widget, and what the app passes on. The lists live in the engine contract (`devmachine widgets schema`). When a coding agent release adds a mode, a CLI release adds it to the list; until then the CLI refuses the new name, the same way it refuses a typo. ## No mode means today's behaviour A widget without `permission_mode` runs exactly the command it ran before engine 1.6. Nothing about an existing widget changes. ## Why a mode with no checks never runs on a timer `bypassPermissions`, `danger-full-access` and `dangerously-bypass-approvals-and-sandbox` let the coding agent change files and run commands without asking anyone. A widget on a timer runs while you are away, so these modes take only `every: manual`: each run happens because you pressed refresh. One rule with no exceptions is easy to check, and easy to relax later if it proves too strict. The contract marks these modes as `dangerous`, so the CLI, the app and an agent all read the same list. ## What you approve A prompt widget written in a board waits for **Allow**. The mode is part of what you approve: change it and the widget asks again, and a mode with no checks shows a red warning on the card. See [why a widget an agent wrote waits for you](/how-it-works/why-an-agent-written-widget-waits/). ## Your login stays the same A mode changes what the coding agent may do, not who runs it. It does not change the account or the home folder, so the coding agent keeps the login it already has on that computer, machine or workspace. --- # https://mydevmachine.sh/how-it-works/updating/ `devmachine update` does five things in a row. Most of what it does is plain; these are the parts that are not. ## It stops before your machines Everything before the last step changes only your computer: the CLI, one line in `config.yml`, the skills in your home folder. The last step changes servers, and servers run things people are using. So `update` runs `sync --check` first, shows what would change, and asks one question. No is the default. An empty answer, closed input, or no terminal at all (a cron job, a pipe) is also no, and `update` prints the exact command to run when you are ready. A machine never changes on an answer nobody gave. `--yes` exists for automation you already trust to change servers. ## The new CLI runs the rest When the CLI itself is out of date, `update` replaces it and then starts the new binary to finish the job. The old process is still running the old code in memory; if it went on, steps 2 to 5 would run with whatever bugs the new release fixed. The new binary gets the same command line plus one hidden flag naming the version it replaced, so it skips step 1 and reports `0.7.17 → 0.7.18`. If the "new" binary turns out to be the same version, that is reported as a failure, not as success. ## Only the CLI, when that is all you asked for `update --cli-only` is step 1 and nothing more. It is what the Devmachine app runs behind its "Update CLI" button: the app replaces a program on your computer for you, but moving the packages pin or syncing a server stays something you start yourself. So `--cli-only` reads no configuration and refuses `--yes`, `--skip-…` and `--machine` instead of ignoring them. The new binary is still started after the swap, with `--cli-only`, only to confirm the version changed. ## Your computer only, for the app `update --no-machines` is steps 1 to 3: the CLI, the packages pin and the skills. It is what the Devmachine app runs to bring your computer up to date. It never runs `doctor` or `sync --check`, and never asks anything. The line it draws is the same one as above: before step 4, only your computer changes. A sync changes servers that people are using, and the app starts one only when you ask, on the machine you choose. So the app's update stops at the line, and refuses `--yes` and `--machine`, which are about servers. With `--format json` it prints one object with the before and after of each step, so the app can show what changed without reading the log. ## Why the CLI tells you a newer packages release is out `devmachine update` moves the packages pin. But many people never run it: they upgrade the CLI with `brew upgrade`, or with the app's "Update CLI" button, which runs `update --cli-only`. Both replace the binary and nothing else, so the pin and the skills stay where they were, and nothing said a newer packages release was out. `doctor` says it, but only to those who run it. So after a few everyday commands (`sync`, `doctor`, `machines list`, `workspaces list`) the CLI prints one line on stderr: ``` packages v33 is out (you pin v32): run devmachine update ``` It is a hint, not a warning, so it stays out of the way: - At most once a day. The same line on every command is noise people learn to skip. - Again on the first run of a new CLI version, whatever the daily limit. That is the moment right after `brew upgrade`, when the pin is most likely behind. - Never with `--format json` and never when stdout or stderr is not a terminal, so a script or the app never reads it as output. - `DEVMACHINE_NO_UPDATE_HINT=1` turns it off. GitHub is asked at most once a day for the hint, and for no more than three seconds. The answer is kept in your cache folder next to the one `doctor` keeps, and `packages outdated` reads the same answer. When GitHub cannot be asked, the hint says nothing: offline is not news. The time it asked is written before it asks, so a cache folder that cannot be written means the hint never asks, not that it asks on every command. ## Homebrew's binary goes through Homebrew A binary Homebrew installed (the real file lives in Homebrew's `Cellar`, under `/opt/homebrew`, `/usr/local` or whatever `brew --prefix` says) is upgraded with `brew upgrade`. Writing a new file over it by hand would work once, and then Homebrew would believe in a version that is not there. `brew update` runs first so the tap knows about the new release, and `brew trust --formula` runs when your Homebrew has it — newer Homebrew refuses a third-party tap without it. The same steps `install.sh` takes. Any other binary is replaced from the release archive. The archive is checked against the release's `checksums.txt` before anything is written; a mismatch stops the update and leaves the old binary alone. The new file is written next to the old one and renamed over it, so there is never a moment with a half-written `devmachine` on your `PATH`. ## Packages before skills The skills your coding agent reads come from the packages release `config.yml` pins. Pinning first, then refreshing the skills, means the skills match the release your machines are about to get, not the one they are leaving. ## A pin moves only forward `update` pins the newest packages release only when yours is older. A pin that is already the newest, or newer (a release you are testing), stays where it is. A configuration with no pin stays without one: that is a choice to use only your own packages, and `update` does not undo it. ## An unreachable machine is not a reason to stop `doctor` runs on every machine. Warnings and failed checks are printed and counted, and the run goes on — one broken credential should not stop the other machines from being checked. A machine `doctor` could not reach (configuration, host key or connection failed) skips its sync check, since there is nothing to compare against, and the summary lists it as `skipped (unreachable)`. What `doctor` finds never changes `update`'s exit code. `update`'s job is its own steps: the CLI, the pin, the skills and the sync. If a missing login on one machine made `update` exit non-zero, a script could not tell "the update failed" from "the update worked and a login is missing". The summary line says what doctor found (`doctor 2 warning(s)`, `doctor machine far unreachable`), and `devmachine doctor` keeps its own exit code for scripts that care. ## Warn or fail `doctor` fails a check only when the machine is unusable: the configuration is invalid, the host key is unknown or changed, the machine cannot be reached, or an essential is missing (a supported operating system, Ansible, and on a self machine a bundle folder `sync` can write). Each of those stops `sync` itself. A missing login or secret, and a DNS provider whose token stopped working, is a `warn`. The machine still works; only the tool that needs the login does not, and the detail says the command that fixes it. ## Old is a warning, and offline is a skip `doctor` also says when the CLI or the packages pin is behind. That is a `warn`, never a `fail`: an old CLI still works, and a script that runs `doctor` should not start failing the day a release comes out. When GitHub cannot be asked, both checks `skip` — being offline says nothing about your versions. GitHub allows 60 unauthenticated API requests an hour, and `doctor` runs often, so its answers are kept for 6 hours in your cache folder. `update` always asks GitHub again, and stores what it hears, so `doctor` is current right after an update. --- # https://mydevmachine.sh/how-it-works/the-cli-log/ The CLI keeps its own log at `/logs/devmachine.log`. `devmachine logs path` prints where that is. When `setup`, `sync` or another command that changes a machine fails, the last line it prints says where too: ``` error: the bootstrap stopped at "install ansible" log: /home/alice/.config/devmachine/logs/devmachine.log ``` That file is what to send when you ask for help. ## What goes in it A command that changes a machine is logged whole: `setup`, `machines add`, `sync`, `update`, `doctor`, `packages add` and `remove`, `run`, `login`, `credentials push`, and the others that add, remove or start something. Each run writes a start line, every line the command printed (Ansible's output included), and an end line: ``` 2026-10-20T12:00:00.000Z [4242] start devmachine 0.16.0 darwin/arm64: sync --machine main 2026-10-20T12:00:03.120Z [4242] out TASK [base : install packages] on main (203.0.113.10) 2026-10-20T12:00:41.900Z [4242] err fatal: [main]: FAILED! => {"msg": "no package matching 'foo'"} 2026-10-20T12:00:42.010Z [4242] end failed (exit 1) after 42.01s: sync on main failed ``` The number in brackets is the process. The macOS app can run several commands at once, and their lines mix in the file; the number tells them apart. Every other command only writes a line when it fails, and never its output. The app runs `sessions`, `stats`, `machines list` and `run --package devmachine-app` every few seconds. Their output, logged whole, would fill 5 MB in a day and push out the `setup` you wanted to read. `run --no-log` counts as one of these reads. A command that only reads does not print the `log:` line either. The app reads what those commands print, and a line it did not expect is a line it has to skip. ## What is taken out Before a line reaches the file, the CLI replaces with `***`: - the value of any `NAME=value` or `"name": "value"` whose name holds `token`, `secret`, `password`, `passwd`, `api_key`, `private_key` or `auth` - a line shaped like a `.env` file, `NAME=value` in capitals - `Authorization:` headers and `Bearer` tokens - GitHub tokens (`ghp_`, `gho_`, `github_pat_`), keys starting with `sk-`, and Tailscale auth keys (`tskey-`) - the password in an address like `https://alice:…@example.com` - a private key, from its `-----BEGIN … PRIVATE KEY-----` line to its end - on the command line, the value of a flag like `--token`, `--password` or `--value`, and the value given to `secrets set` A password typed at a prompt or piped with `--password-stdin` never reaches the log at all: the log copies what the CLI prints, not what it reads. What stays is what makes the log useful: addresses, host names, machine, workspace and user names, and the commands that ran. Read the file before you send it if any of those are private to you. ## What it looks like The file holds plain text. Colours, cursor moves and window titles are taken out, and a line that redraws itself, like a download's progress bar, keeps only the state it ended in: `Downloading 100%`, not every step on the way. ## Why the programs it runs still see your terminal To copy what a command prints, the CLI has to read it on its way to your terminal. A program like Homebrew, or a command `run` starts on a `self: true` machine, would then find itself writing into the CLI instead of a terminal, and print plain: no colours, no progress bars, the wrong width. So when your output is a terminal, the CLI gives such a program a terminal of its own, the same size as yours, and passes everything it prints to yours unchanged while the log keeps a plain copy. What you see is what you saw before the log existed. When the output is not a terminal, as in the macOS app, a pipe or a file, the program gets a pipe and prints plain, as it always did. Questions the CLI asks you are not affected either way: the log copies what the CLI prints, never what you type. ## Size When the file passes 5 MB, it becomes `devmachine.log.1`, the old `.1` becomes `.2`, `.2` becomes `.3`, and the old `.3` is deleted. So the logs never take more than about 20 MB. ## Why it never fails a command Writing the log can go wrong: a full disk, a folder you made read-only. The CLI then carries on without it, and says nothing. A log that can stop `sync` is a log somebody turns off the first time it does. ## Why it is never committed `logs/` holds a `.gitignore` of its own that ignores everything in it. A configuration folder that became a repository before the log existed has a `.gitignore` without `logs/`, and its next commit would have picked the log up. With its own `.gitignore`, the folder stays out whatever the top one says. `devmachine setup git` also adds `logs/` to the top one, and refuses a commit that tracks it, the same as `history.log`. See [versioning your configuration](/how-it-works/versioning-your-configuration/). --- # https://mydevmachine.sh/how-it-works/session-indicators/ `devmachine sessions` lists the tmux sessions of each workspace. For each session it says whether the agent in it is busy and whether it wants you. Both are best guesses from what tmux shows, not facts from the agent. ## Why the CLI reads the sessions The reading lives in one place, in Go. The macOS app and the Linux app both call `devmachine sessions` and show the answer, so they cannot disagree. The command uses the multiplexed SSH connection that `run` uses. The connection stays open, so asking every 5 seconds costs one small command each time, not a new login. ## After the computer sleeps The shared connection can outlive a sleep or a change of network. Its TCP link is dead, but nothing closes it, so every command sent through it waits. Before, that wait lasted minutes. A new login, and the SSH agent's prompt that comes with it, only happened once the system finally gave up on the link. Now ssh checks the link every 3 seconds and drops it after three missed answers, about 10 seconds. A shorter limit would also cut a long `sync` on a network that drops for a few seconds. The next command logs in again on a fresh connection. A machine that does not answer at all fails after 5 seconds. ## A login waiting for your approval After a wake, 1Password asks for Touch ID (or to be unlocked) before its SSH agent signs with your key. `sessions` used to wait 30 seconds for that, then kill the login and call the machine `unreachable`. Killing it closed the prompt, counted as a failed login in the machine's SSH log, and the next poll knocked again. Now `sessions` opens the shared connection first, once per machine and Linux user, not once per workspace. When the machine has accepted the key and only the agent's signature is missing, it answers `login-waiting` within a few seconds and leaves that login running on its own, with the prompt still up. Every `sessions` call while it waits answers `login-waiting` without touching the network. Once you approve, the connection is up and the next call lists the sessions through it. The machine ends a login nobody approves after its `LoginGraceTime`, two minutes by default; the CLI ends one left longer than three. If you refuse the prompt, the next call answers `login-refused` once, and does not ask again on its own. The CLI tells the two waits apart from ssh's own log: the line `Server accepts key` comes after the machine answered and before the agent signs. `sessions` still waits up to 30 seconds for a slow machine. ## Busy is a guess A session is busy when its screen changed in the last 5 seconds. The CLI reads the time of the last change from tmux. An agent that is thinking and draws nothing shows as idle. A plain terminal that prints a log shows as busy. When no agent runs in the session, any program other than a shell counts as busy. ## Attention needs the bell A session needs attention when tmux holds a bell mark in one of its windows. The mark appears only when the agent rings the terminal bell. Claude Code does not ring it by default. To turn it on, set `"preferredNotifChannel": "terminal_bell"` in `~/.claude.json`, or run `claude config set --global preferredNotifChannel terminal_bell`. tmux clears the mark when you open the window. ## Times come from the machine Age and busy use the clock of the machine that runs tmux, not the clock of your computer. The command reads that clock in the same call as the sessions. A computer whose clock is wrong still shows the right ages. ## The list does not depend on the locale The command reads tmux's list with fields split by tabs. tmux prints a tab as `_` when the login has no UTF-8 locale, and an ssh login to a Mac sets none. So every tmux call asks for UTF-8 with `tmux -u`, whatever the locale. Without it, a Mac's workspace read as having no sessions at all. --- # https://mydevmachine.sh/reference/commands/ Every command accepts: | Flag | Meaning | | --- | --- | | `--config ` | the configuration folder to use | | `--format table\|json` | how to print; JSON is the stable contract | | `--machine ` | which machine to act on, for commands that act on a server | | `--help` | what this command does | `devmachine help --json` prints the whole tree, including every flag, in one document — read this instead of parsing help text. ## setup ``` devmachine setup [--force] [--no-harden] [--keep-password-login a,b] [--no-essentials] [--no-aliases] [--yes] [--package-manager brew|ports] [--install-prerequisites] ``` Connects to your server for the first time and gets it ready to use. With no `config.yml` yet, it asks for a machine name, an address, the admin account, a port, a domain, and how to log in: a key devmachine makes for itself (recommended), a key file already on your computer, or one your SSH agent holds (for a key in a password manager). Choosing an agent key records its public half as `agent_key:`, so only that key is offered from then on — never every key the agent holds. It shows the server's fingerprint first and asks you to check it against your provider's dashboard. Say no and nothing is sent or changed. Then it gets the server ready, in order: try the key; if that fails, ask for the password (never shown on screen); install the key; open a **new connection using only the key** to prove it works; turn password login off, and ask SSH (`sshd -T`) that it really is off; install Ansible. Before password login goes off it asks how: off for every account (the default, Enter), off except for accounts you name, or left as it is. It lists the other accounts people log in with, and on a Mac it says plainly that the change covers every account on it: whoever logs in over SSH with a password today needs a key afterwards. The accounts you keep are written as `password_login_keep:` on the machine, and `ssh_hardening` keeps the same exceptions on every sync. Change it later with [`machines password-login`](#machines). See [password login, account by account](/how-it-works/password-login/). The new machine is written with the `essentials` package (base, git, firewall, ssh_hardening, caddy and devmachine-app — see [what a new machine starts with](/how-it-works/what-a-new-machine-starts-with/)), so the first `sync` installs them; `--no-essentials` leaves it with none. Only a pinned package release that has `essentials` gets it — an older one starts empty and says so. On a Mac, where `essentials` does not run, the machine starts with `base`, `devmachine-app` and the package manager package instead, and `setup` says so; with `--no-essentials`, with the package manager package alone. If the proof step fails, nothing is locked down and the error says where to look. See [setting up a server for the first time](/how-it-works/trust-bootstrap/) for why the order matters. Works on **Debian, Ubuntu, Arch Linux and macOS**. Before it changes anything it asks the machine what it runs (`uname -s`, then `ID` in `/etc/os-release`, or `sw_vers` on a Mac). A distribution based on one of them (`ID_LIKE`), such as Manjaro or Linux Mint, is set up as its base, with a note that it is not tested; anything else is named and it stops, with the machine untouched. See [what `setup` refuses](/how-it-works/trust-bootstrap/#it-checks-what-the-machine-runs-first). The password is used once and written nowhere. **On a Mac** Ansible comes from a package manager package, `mac-brew` (Homebrew) or `mac-ports` (MacPorts), not from the CLI. A machine that lists one keeps it. Otherwise `setup` adds the one for the manager the Mac already has, and asks when it has neither or both (`--package-manager`). It copies the package to `/opt/devmachine/bootstrap//`, runs its `bootstrap check` as the admin login, lists what is missing with the time each takes, and installs only after you agree (or with `--install-prerequisites`). `--yes` never installs them. See [what a machine needs](/how-it-works/what-a-machine-needs/). Once the machine answers, it asks two more questions: whether to write SSH host entries to `~/.ssh/config` (default yes — `ssh -devmachine` and `mosh` then work from any terminal, and the CLI keeps the entries up to date on its own from then on; see [SSH aliases](/concepts/reaching-your-server/#ssh-aliases)), and whether to reach the machine over Tailscale too (default no — adds the `tailscale` package; `devmachine login tailscale` finishes the job, see [private networks](/concepts/private-networks/)). A Mac is not asked about Tailscale, since the `tailscale` package runs only on Linux, and `machines add --tailscale` says so and adds nothing. It writes `config.yml` once the key logs in, before it changes anything on the server. A run that stops earlier — the key refused and no password, the proof failed, nothing answered, the fingerprint declined — writes no `config.yml`, and with `--force` leaves the old one as it was. A run that stops later, at root or Ansible, keeps the machine, and running `setup` again finishes the job. See [nothing is written before the key logs in](/how-it-works/trust-bootstrap/#nothing-is-written-before-the-key-logs-in). With no `config.yml` yet, it also writes `AGENTS.md` if none exists, telling a coding agent how to work in this folder — it never overwrites one already there. | Flag | Meaning | | --- | --- | | `--force` | discard the existing configuration and start over | | `--no-harden` | leave password login on; the key is still installed and proved | | `--keep-password-login a,b` | turn password login off for every account except these, without asking | | `--no-essentials` | start the machine with no packages, instead of `essentials` (on a Mac, instead of `base` and `devmachine-app`) | | `--no-aliases` | do not ask about SSH host entries, and do not write them | | `--yes` | answer yes to the SSH host entries question, without asking; never installs prerequisites | | `--package-manager brew\|ports` | on a Mac with neither or both, the package manager to install Ansible with | | `--install-prerequisites` | on a Mac, install what is missing (Command Line Tools, Homebrew or MacPorts, Ansible) without asking | Run again with a configuration in place, and it just makes sure Ansible is installed — it never rewrites `config.yml`, a key, or SSH settings. **Without a terminal.** `setup` only asks. A script, an agent or an app runs `machines add --address …` instead: with no `config.yml` yet it writes the same configuration `setup` would — the latest packages release pinned, `defaults.workspace`, the machine with `essentials`, and `AGENTS.md` — and runs the same bootstrap. Each question has a flag: | `setup` asks | `machines add` flag | | --- | --- | | machine name | `--name` | | address | `--address` | | admin login | `--user` | | SSH port | `--port` | | location (`machines add` only) | `--location` (left out, `external`) | | domain | `--domain` (only when it writes a new `config.yml`) | | trust this fingerprint? | `--fingerprint` (read it first with `machines scan`) | | how to log in | `--key new`, `--key ` or `--key agent:` | | the password | `--password-stdin` | | write SSH host entries? | yes, unless `--no-aliases` | | reach it over Tailscale? | `--tailscale` | | install the agent skills? | run `devmachine skills add` afterwards | | which package manager? (a Mac with neither or both) | `--package-manager brew` or `--package-manager ports` | | install what the Mac lacks? | `--install-prerequisites` (`--yes` never does) | It creates that file only if it is still missing when the bootstrap ends. If another `add` (or `create-local --add`) wrote one in the meantime, this machine is added to it instead of overwriting it; a `--domain` given then is not written, and the output says so. Only `--address` does this. `machines add` with questions and no `config.yml` stops and sends you to `setup`, which asks the same questions plus the domain. Unlike `setup`, it writes `config.yml` only once the bootstrap worked, so a run that fails leaves no configuration behind. Workspaces then come from `devmachine workspaces new`, and packages from `devmachine packages add`, both without questions when given `--yes`. **On a self machine** (`self: true`, your own computer — see [`machines`](#machines)), setup runs the `mac-brew` package's bootstrap on your computer (`mac-ports` when the machine lists it), from the package cache, with no `sudo` and nothing under `/opt`. When Homebrew and `ansible-playbook` are already there it installs nothing and prints ` is already prepared: ansible-playbook is .` Otherwise it lists what is missing and asks first, as on a remote Mac. No fingerprint, key or password involved. ## setup git ``` devmachine setup git [--yes] [--check] ``` Turns your configuration folder into a git repository, so you can push it to a private remote. `config.yml`, `packages.lock`, `known_hosts` and `AGENTS.md` are committed — see [versioning your configuration](/how-it-works/versioning-your-configuration/) for what never is. In order: writes `.gitignore` **before** `git init`, so a key can never be picked up; `git init -b main`; commits the files above; checks what got tracked and **refuses** if a key is already tracked, with the fix; if `gh` is on `PATH` and logged in, offers to create a **private** repo and push. | Flag | Meaning | | --- | --- | | `--yes` | skip local-write questions; never create or push a remote | | `--check` | say what would happen, write nothing | Run again on an existing repository, and it skips straight to the tracked-files check. ## doctor ``` devmachine doctor [--machine m] ``` Checks whether your machines are healthy and reports what is wrong. With one machine, or with `--machine`, it checks that machine. With several machines and no `--machine`, it checks every one of them, in the order of `config.yml`, one block each: ``` machine main: pass configuration machine "main", 2 address(es), admin root, port 22, 1 workspace(s) pass host key SHA256:… at 203.0.113.10 pass connection connected through 203.0.113.10 … machine laptop: pass configuration machine "laptop", your computer as a machine, 1 workspace(s) … this computer: pass cli 0.7.21 is the latest pass packages pin v17 is the latest ``` Doctor only reads, so checking all of them is safe; it never guesses which one you meant, because it does not have to. A machine that cannot be reached gets its own `fail` and does not stop the others. Six checks in order: configuration, SSH fingerprint, login, operating system (the same check `setup` makes: Debian, Ubuntu, Arch Linux or macOS, shown as `macos 15.7.9`), Ansible installed, SSH aliases. A broken fingerprint stops the rest. Then one check per needed credential (`credential: `) and per installed DNS provider (`dns: `). On a Mac, the Ansible check looks where the bootstrap said `ansible-playbook` is, then in the Homebrew, MacPorts and pipx folders, since a plain SSH command has none of them on `PATH`. Then the package manager package's `bootstrap check` lists what the Mac lacks: one `prerequisite: ` warning per item (`devmachine setup` installs it once you agree), or one `prerequisites` check that passes when nothing is missing, or is skipped when no package manager is chosen yet. The script reaches the Mac on stdin, so doctor leaves nothing on it. Last, one `ssh access: ` check per workspace on the Mac: it passes when Remote Login allows all users or the account is in the list, warns when Remote Login allows only some users and the account is not one of them, and is skipped while the account does not exist yet. One SSH command answers for every workspace. See [what a machine needs](/how-it-works/what-a-machine-needs/). A missing or logged-out credential **warns**, with the fix (`devmachine login `, or `secrets set` then `credentials push`); so does a DNS provider whose token no longer works. The machine still works; only the tool that needs the login does not. A **fail** is kept for what makes the machine itself unusable: an invalid configuration, an unknown or changed host key, a machine that cannot be reached, and a missing essential (an unsupported operating system, no Ansible, or, on a self machine, a bundle folder that cannot be written). The exit code is `0` when every check passed, warned or was skipped, and non-zero only when a check failed — on any machine, when there are several. The error names the machines that failed. `--format json` prints the same checks with the same statuses (`pass`, `warn`, `fail`, `skip`); `ok` is `false` only when a check failed. For one machine (or with `--machine`) the shape is: ```json {"checks": [{"name": "configuration", "status": "pass", "detail": "…"}, …], "ok": true} ``` With several machines and no `--machine`, each machine gets its own entry under `machines`, and the top-level `checks` holds only the checks about this computer (`cli`, `packages pin`). The top-level `ok` is `false` when any check anywhere failed: ```json { "machines": [ {"machine": "main", "checks": [ … ], "ok": true}, {"machine": "laptop", "checks": [ … ], "ok": false} ], "checks": [{"name": "cli", "status": "pass", "detail": "…"}, …], "ok": false } ``` The SSH aliases check runs only when `ssh_aliases: true` is set, that is, when devmachine keeps the aliases for you. It runs `ssh -G ` for each workspace alias — a local lookup, no connection — and compares the hostname, user, port and host key alias against what `devmachine aliases` would write today. It passes as soon as every alias resolves correctly, whatever file it actually lives in. Otherwise it **warns**, never fails, naming the alias and what is wrong, with the fix `devmachine aliases --write`. With `ssh_aliases: false` (or left out) it reports `skip ssh aliases managed outside devmachine (ssh_aliases: false)`: you keep `~/.ssh/config` yourself, so there is nothing for devmachine to compare it to. It is not reported at all on a self machine — there is no address to write a Host entry for. Last come two checks about your computer, not the machine: `cli` (is this the newest CLI release) and `packages pin` (does `config.yml` pin the newest packages release). Either one **warns** when it is behind, with the fix `devmachine update`, and never fails. When GitHub cannot be reached they report `skip`. The answers are kept for 6 hours in your cache folder (`~/Library/Caches/devmachine` on macOS, `~/.cache/devmachine` on Linux), so running `doctor` often does not hit GitHub's rate limit. No credential or DNS provider needed is not a failure. A check that could not run reports `skip` and why — "I cannot tell" is not "it is not there". A `warn` is the same idea for something worth fixing that does not mean the machine is broken. ## config ``` devmachine config path the directory in use, and the rule that chose it devmachine config show machines, workspaces and their effective values devmachine config set change one setting devmachine config unset take it out, so its default applies again ``` Shows where your configuration lives and what is in it. `show` validates as it prints, so it is the quickest way to find what is wrong. With no `config.yml` yet, `show` is not an error: it says there is no configuration, and `--format json` prints `{"machines": [], "workspaces": [], "defaults": {"workspace": []}, "credentials": {}}`. `machines`, `workspaces` and `defaults.workspace` are always arrays, never `null`. `defaults.workspace` is the package list a new workspace gets (see [workspaces](#workspaces)). `credentials` is the top-level answer per login, `machine` or `own`; a workspace's own `credentials` (in `workspaces list --format json`) wins over it. `set` and `unset` take the settings of [`chat`](#chat), written under `chat:` in `config.yml`: | Key | Default | Meaning | | --- | --- | --- | | `chat.default_workspace` | the first workspace, else this computer | where a new chat runs; `local` means this computer | | `chat.folder` | `~/chats` | the folder a new chat runs in, created on first use | | `chat.harness` | `claude` | `claude` or `codex` | | `chat.mcp` | `false` | `true` starts new chats with the account's MCP servers, hooks and plugins | A value that would not load (a harness other than these, a workspace not in `config.yml`) is refused and the file is left as it was. `show --format json` prints them, with their defaults filled in, as `"chat": {"default_workspace", "folder", "harness"}`. ## machines ``` devmachine machines list each machine, its addresses, port, location and workspaces devmachine machines show [name] one machine, and what it runs as setup, sync or doctor last read it devmachine machines add [--location l] [--no-harden] [--keep-password-login a,b] [--no-essentials] [--no-aliases] [--yes] [--package-manager brew|ports] [--install-prerequisites] set up another server and record it devmachine machines add --self [--location l] [--package-manager brew|ports] [--install-prerequisites] add your computer as a machine, with no address devmachine machines add --name --address --fingerprint [--user u] [--port p] [--key new|file|agent:] [--location l] [--password-stdin] [--tailscale] the same, asking nothing devmachine machines trust [name] [--check] [--replace] [--expect ] [--yes] check or update its SSH fingerprint devmachine machines password-login [--off | --keep a,b | --on] [--check] [--yes] show or change which accounts log in over SSH with a password devmachine machines scan --address [--port p] the SSH fingerprint of a server not added yet; writes nothing devmachine machines edit [--set k=v] [--unset k] [--location l] [--check] [--yes] change a machine's package settings or location devmachine machines rm [--yes] forget a machine; the server keeps running devmachine machines create-local [--distro ubuntu|arch] [--cpus n] [--memory GiB] [--disk GiB] [--add [--key k] [--no-essentials] [--no-aliases] [--location l]] a machine on your computer devmachine machines start start a local machine devmachine machines stop stop a local machine devmachine machines delete-local [--yes] destroy it and everything on it ``` Manages the list of machines devmachine knows about. With no `config.yml` yet, `list` is not an error: it says how to add the first machine, and `--format json` prints `[]`. `list --format json` prints each machine with `name`, `hosts`, `admin_user`, `port`, `key`, `agent_key`, `workspaces`, `packages` (the machine's own package list from `config.yml`, `[]` when it has none), `location` (never empty: `external` or `local` when `config.yml` names none), `platform` (`linux` or `macos`, the names `platforms` uses in a `package.yml`, from what a command last read on the machine; `macos` on your own computer; left out for a machine no command has read yet), and `self: true` on your own computer. Without `--format json`, `list` prints a table with a `LOCATION` column. `config show --format json` carries the same machine entries. **Your computer is never picked by default** — a command with no `--machine` still acts on the server, even with a self machine also configured. `show` prints one machine — the one named, or the one `--machine` or the configuration picks — with what `setup`, `sync` or `doctor` last read from it: the system, distribution and version, architecture, package manager, init system, where `ansible-playbook` is, and the `PATH` prefix `run` uses. It does not connect; `devmachine doctor --machine ` reads the machine again. `devmachine --format json machines show ` prints the same entry as `list --format json`, plus `observed`: ```json { "name": "studio", "hosts": ["203.0.113.10"], "admin_user": "alice", "port": 22, "workspaces": [], "packages": ["mac-ports"], "location": "external", "platform": "macos", "observed": { "observed_at": "2026-10-05T15:22:00-03:00", "system": "Darwin", "os_family": "Darwin", "distribution": "MacOSX", "distribution_version": "15.7.9", "pkg_mgr": "macports", "service_mgr": "launchd", "architecture": "x86_64", "ansible_playbook": "/opt/local/bin/ansible-playbook-3.14", "path_prefix": ["/opt/local/bin", "/opt/local/sbin"] } } ``` A machine no command has read yet has no `observed` key. The names follow Ansible's facts; `path_prefix` is `[]` on Linux. Why this lives beside `config.yml` and not in it: [what the CLI knows about a machine](/how-it-works/what-the-cli-knows-about-a-machine/). `edit` changes a machine's `settings:` and nothing else, the way `workspaces edit` does for a workspace. `--set .=` writes a package option, read as YAML (`--set hostinger.zones=[example.com]` writes a list); an empty value or `--unset .` removes it. Both repeat. A setting for a package the machine does not install is refused, and so is one that does not fit the [type](/reference/package-format/#types) its package declares. Comments in `config.yml` survive, and `sync` applies the change. `--location ` sets or changes where the machine is; `--location ""` clears it, back to `external` (or `local` for your own computer). **Location.** Every machine has one: where it is, such as `hostinger`, `home`, `office` or `bedroom`. It is trimmed and lowercased, and must be at most 40 letters, numbers, spaces, dots, underscores and hyphens, starting with a letter or number. `add` asks for it, with `external` as the default; with `--address` it takes `--location` or stays `external`. `add --self` and `create-local` default to `local`. See [where a machine is](/how-it-works/machine-location/). `add` sets up another server, same as [setup](#setup) — including the SSH aliases and Tailscale questions. `add --self ` instead names the computer devmachine runs on: no address, port or key, and neither question is asked. Refuses if a self machine already exists, or the name is taken. See [your computer as a machine](/how-it-works/your-computer-as-a-machine/) for how this differs from `machines create-local`. `add` writes the machine to `config.yml` only once the key is proved and the bootstrap finished. A run that fails leaves `config.yml` untouched, so the same command can simply run again — see [`machines add` writes the machine last](/how-it-works/trust-bootstrap/#machines-add-writes-the-machine-last). **Unattended.** `--address` makes `add` ask nothing, so a script or an agent adds a machine in one command; every question has a flag, and what is left out takes its default. With no `config.yml` yet, it writes a new one the way `setup` does — see [setup without a terminal](#setup): | Flag | Default | Meaning | | --- | --- | --- | | `--name` | (required) | the machine's name | | `--address` | — | an IP, a hostname, or `tailscale:` | | `--user` | `root` | the admin login: root, or an account with passwordless sudo | | `--port` | `22` | the SSH port | | `--key` | `new` | a key of the CLI's own for this machine (made, or reused when it exists), a private key file, or `agent:` for a key your SSH agent holds | | `--fingerprint` | — | the host key to trust on first contact, of any of its types (ED25519, ECDSA, RSA) | | `--tailscale` | off | also add the `tailscale` package | | `--domain` | — | the domain; only when there is no `config.yml` yet, and refused otherwise | | `--password-stdin` | off | read the admin password from stdin, for a server that takes nothing else yet | | `--keep-password-login` | — | accounts that keep SSH password login when it goes off for everybody else; without it, it goes off for every account | | `--package-manager` | — | on a Mac with neither or both managers, `brew` or `ports`; without it such a Mac stops | | `--install-prerequisites` | off | on a Mac, consent to install what is missing; without it a Mac that lacks something stops | `--key agent:SHA256:…` picks one key from the SSH agent by its fingerprint (`ssh-add -l` lists them), the way choosing an agent key does in the questions: its public half is recorded as `agent_key:`, and only that key is offered from then on. If the agent does not hold it — a locked password manager, another `SSH_AUTH_SOCK` — `add` stops before changing anything and lists the fingerprints the agent does hold. SSH aliases are written unless `--no-aliases`. `--fingerprint` is required for a machine not trusted yet: with nobody to ask, trusting whatever answers would be trust on first use with no one looking. Without it, or with a different one, `add` stops before changing anything and prints the fingerprint it was shown, to check through the provider console or a connection you already trust. `machines scan --address ` shows the same fingerprint before you run `add` at all. A key that does not log in yet needs the password once, to install it. With nobody to ask, it comes on stdin: `--password-stdin` reads all of stdin as the password (only the final line ending is dropped), so it is never in the command line, the shell history or a log: ``` printf '%s' "$PASSWORD" | devmachine machines add --name box --address 203.0.113.20 \ --fingerprint SHA256:… --password-stdin ``` It is used exactly as the interactive password is: one connection that installs the key, then a new connection that proves the key alone, then password login is turned off (unless `--no-harden`). It is written nowhere. When the key already logs in, the password is never used. Without `--password-stdin`, a key that does not log in stops `add` and says so; put the key's public half in the admin's `authorized_keys` first, or pass the password. `--password-stdin` needs `--address`: without it, stdin carries the answers to the questions instead. Adding or removing a machine, like adding or removing a workspace, refreshes the SSH aliases when `ssh_aliases: true` is set — see [SSH aliases](/concepts/reaching-your-server/#ssh-aliases). A self machine has no `hosts`, `user`, `port` or `key`, and no workspace can live on one. Any command needing a real SSH address — `ssh`, `mosh`, `tunnel`, `login`, `expose`, `dns`, `machines trust`, `aliases` — refuses on it, naming the reason. `trust` reads the server's public fingerprint without logging in: asks before saving a new one, does nothing if it matches, refuses a changed one unless `--replace`. `--check` compares without writing and reports a changed key instead of refusing it; it exits 0 for every status, so a script reads `status`, not the exit code. `--expect ` writes only the host key with that fingerprint — the key the operator verified, not whatever a second scan happens to meet. It may be the fingerprint of any of the server's keys, ED25519, ECDSA or RSA: when it is not the one negotiation showed, `trust` asks the server for each other type and writes the one that matches. A fingerprint none of them has is refused, and nothing is written. JSON fields: `machine`, `address`, `status` (`matching`, `changed`, `missing`), `key_type`, optional `current_key_type` and `current_fingerprint` (the pinned key), `presented_fingerprint`, `check`, `changed`, and, while the key is not yet trusted, `fix` (the command that trusts it, with `--expect`) and `verify` (a command that prints the same key's fingerprint on the server, to run from its own console). `password-login` asks the machine's sshd, account by account, who can log in over SSH with a password, and changes it. With no flag it only reads. `--off` turns password login off for every account; `--keep a,b` turns it off for every account except those; `--on` takes the CLI's drop-in away, so the system's own setting applies again (password login on, on macOS, Debian and Ubuntu). The change goes over the admin login's key, the proof that a way in stays open. sshd checks the new file before anything uses it, and sshd -T is asked afterwards for every kept account; a file it refuses, or one that does not do what it says, is put back as it was. The kept accounts are written as `password_login_keep:` on the machine, which `ssh_hardening` reads on every sync. `--on` is refused while the machine has `ssh_hardening`, which would turn it off again. On a Mac it says first that the change covers every account on it. `--check` says what would change; `--yes` skips the question. JSON fields: `machine`, `default` (password login for an account no exception names), `drop_in` (whether the CLI's file is there), `accounts` (each with `user` and `password_login`) and `keep` (what the configuration says). See [password login, account by account](/how-it-works/password-login/). `scan` reads the host key a server presents, for an address that is not a machine yet — the step before `add --fingerprint`, so a person (or an app) can compare it with the provider console before anything trusts it. It does not log in, trusts nothing and writes nothing, and it needs no `config.yml`. It reports the key the server offers for the same negotiation `add` makes, so its fingerprint is the one `add` compares against. JSON fields: `address` (the one that answered), `port`, `key_type`, `fingerprint`, and `verify` — a command that prints the same key's fingerprint on the server, to run from its own console (left out for a key type with no standard file). `rm` takes a machine out of `config.yml` and **does nothing to the server itself**. Asks first unless `--yes`; refuses to leave a workspace pointing at a gone machine. It also deletes what the CLI last read from the machine (`state/machines/.json`). **Not `delete-local`**: `rm` only forgets a server, `delete-local` erases a machine on your computer. `create-local` builds a machine on your computer, arriving password-only like a bought server — `devmachine setup` still has to run against it. Root password `devmachine`, public on purpose: this VM holds no real data. By default the VM gets 2 CPUs, 4 GiB of memory and a 20 GiB disk. `--cpus `, `--memory ` and `--disk ` change that, in whole numbers. Each is checked against this computer before Lima starts: `--cpus` from 1 to its number of cores, `--memory` from 1 GiB to less than its memory (the computer needs some for itself), `--disk` at least 10 GiB. The disk is a sparse file, so a large one only uses the space the VM writes. The output says the size the VM got. `--distro` picks the system: `ubuntu` (the default, Ubuntu 24.04) or `arch` (Arch Linux). The Arch VM is x86_64 under qemu on every computer, because the only aarch64 Arch image Lima offers is an old third-party build that does not boot under Apple's hypervisor. On Apple Silicon that means emulation: it boots and works, but the first boot and `setup` take many minutes. It arrives the same way as the Ubuntu one: root by password, no key. `create-local --add` does both steps at once: it creates the VM, then adds it the way `machines add --address` adds a server — installs a key with that password, proves the key, turns password login off, installs Ansible, and writes the machine (and, with no `config.yml` yet, a new configuration). No second command, and no question. Its host key is trusted as it answers, without `--fingerprint`: the command made the VM a moment ago and it answers only on this computer's loopback. `--key`, `--no-essentials`, `--no-aliases` and `--location` mean what they mean for `machines add`, and are refused without `--add`; `--location` defaults to `local` here. The name is checked against the configuration before any VM is made. If adding fails, the VM keeps running and nothing is written; the error ends with the exact `machines add` command that adds it by hand, ready to copy. The host key is read once, and that same key is the one trusted. `--format json` prints the machine as `machines list` does, with its `key` once added, its `location` and its `size` (`cpus`, `memory_gib`, `disk_gib`); the progress goes to stderr. `start`, `stop` and `delete-local` only act on a local machine. Two limits: needs [Lima](https://lima-vm.io) (`brew install lima`), macOS and Linux only; not reachable from the internet, so `dns`, HTTPS and subdomains do not work on it. ## workspaces ``` devmachine workspaces list devmachine workspaces new [--machine m] [--like w] [--packages a,b] [--user u] [--check] [--yes] devmachine workspaces edit [--machine m] [--user u] [--add p] [--rm p] [--set k=v] [--unset k] [--share c=machine|own] [--check] [--yes] devmachine workspaces defaults [--add p] [--rm p] [--check] [--yes] no flag: print the list devmachine workspaces rm [--yes] devmachine workspaces destroy [--confirm ] [--check] [--keep-dns] ``` A workspace is one account on one machine. See [workspaces](/concepts/machines-and-workspaces/). These commands only edit `config.yml` — `devmachine sync` creates or changes the account. `new` takes its package list from `defaults.workspace: [pkg, ...]` in `config.yml`. `--packages` overrides it for one workspace; `--like ` copies another workspace's package list instead — packages only, never the account or the machine. When the CLI knows the machine's system (what `setup`, `sync` or `doctor` last read from it), `new` leaves out of the default or copied list any package that does not run there, itself or through a package it needs, and says which one and why: a workspace on a Mac starts without `claude-remote-control`, which runs only on Linux. A package named in `--packages` is refused instead of dropped, since you asked for it by name. `edit --add` refuses the same way. With the system not yet known, nothing is left out. `defaults` with no flag prints that list and changes nothing. With `--add` or `--rm` it edits it; existing workspaces keep their own lists. With `--format json`, both print `{"packages": ["dev", "zsh"], "changed": false}` — `changed` is `true` after an edit, and `packages` is `[]` when the list is empty. `list --format json` prints `{"workspaces": [...]}`, one entry per workspace: ```json { "name": "alice", "machine": "main", "user": "alice", "packages": ["workspace", "dev"], "settings": {"zsh.theme": "plain"}, "credentials": {"claude": "own"} } ``` `user` is the account on the machine. `packages` is `[]` when there are none, and `settings` is left out. `credentials` is the workspace's own `credentials:` answer per login — `own` keeps its own login, `machine` shares the machine's — exactly what `edit --share` writes, and `{}` when it has none. A login it does not name follows the top-level `credentials:` (in `config show --format json`), then the package's own `scope`. **`new` refuses on a machine with no key**, since a workspace is reached through the copied admin key. Run `devmachine setup` first. With several machines, pass `--machine`. `edit` changes one workspace. `--add`/`--rm` take a package name each, repeatable. `--set .=` writes a package option (read as YAML — see [packages](/concepts/packages/)); an empty value or `--unset .` removes it. `--share =own` keeps this workspace's own login instead of the shared one; `=machine` shares it again. A package option for a package the workspace does not install is refused, and so is one that does not fit the [type](/reference/package-format/#types) its package declares. **Changing `--machine` does not move a workspace.** The next `sync` creates the account on the new machine; the old one keeps everything. **`rm` leaves the account, home and files on the machine** — remove those by hand if you want them gone. `new`, `rm`, `destroy` and `edit --machine` all refresh `~/.ssh/config`'s managed block afterwards, when `ssh_aliases: true` is set, and say so when it changed. See [SSH aliases](/concepts/reaching-your-server/#ssh-aliases). **`destroy` deletes for real**: the account, its home, its Caddy routes, and its `config.yml` entry. Asks you to retype the name first (or `--confirm ` from a script). Needs the machine reachable; use `rm` for one that is gone. After the account is gone, the DNS record of each of its sites goes too, with the same rules as `expose rm`: only an A record that still points at the machine serving the site (the `via` machine for one published through it), through the provider that holds the zone. Anything else is printed, and a DNS failure never stops the destroy. `--check` also prints those DNS removals. The list it shows before asking names each record it would remove; `--keep-dns` leaves every one alone instead, and prints the `dns rm` that removes each later. `defaults` only changes `defaults.workspace`, which new workspaces inherit; existing ones are unchanged. ## skills ```text devmachine skills add [--package name] [--agent claude|codex|opencode|pi|antigravity|kimi|cline] [--yes] devmachine skills list devmachine skills update [--yes] devmachine skills remove [--yes] ``` Manages Agent Skills on your own computer; never touches a machine. Bare `add` installs `devmachine-skills` from the pinned release (or the latest, before `setup` has pinned one). `--package` only accepts a local package. Without `--agent`, it detects installed agent tools and asks. `list` shows each source, its skills and agent tools. `update` reinstalls every recorded source. `remove` takes one exact skill name. Real copy: `~/.agents/skills/`. Codex, OpenCode, Pi and Kimi read it there. Claude, Antigravity and Cline get a link to it: | Agent | Link | | --- | --- | | `claude` | `~/.claude/skills/ -> ../../.agents/skills/` | | `antigravity` | `~/.gemini/antigravity-cli/skills/ -> ../../../.agents/skills/` | | `cline` | `~/.cline/skills/ -> ../../.agents/skills/` | Detection looks for `~/.claude`, `~/.codex`, `~/.config/opencode`, `~/.pi`, `~/.gemini/antigravity-cli`, `~/.kimi-code` and `~/.cline`. ## widgets ```text devmachine widgets list [--board home|sidebar|context-sidebar|menubar|menubar-panel] devmachine widgets help devmachine widgets validate [path...] devmachine widgets schema [--json] devmachine widgets add [--board home|sidebar|context-sidebar|menubar|menubar-panel] [--id x] [--set name=value]... [--size s] [--at x,y | --after id | --before id] devmachine widgets remove [--board home|sidebar|context-sidebar|menubar|menubar-panel] devmachine widgets move (--after id | --before id) --board sidebar|context-sidebar|menubar|menubar-panel devmachine widgets set --board home|sidebar|context-sidebar|menubar|menubar-panel [--title t] [--every d] [--set name=value]... ``` The widgets the app draws, and the boards they sit on. Local only: these commands never connect to a machine. See [Widgets](/concepts/widgets/) and [the widget format](/reference/widget-format/). `list` reads the pinned packages release and your own packages. With nothing pinned, or no `config.yml` yet, it reads the latest release; when that cannot be found it fails, with nothing on stdout. `--format json` prints: ```json { "engine": "1.7", "packages_release": "v40", "widgets": [ { "name": "claude-code/usage", "package": "claude-code", "widget": "usage", "origin": "release", "trust": "official", "version": "v40", "path": "/Users/alice/.config/devmachine/cache/packages/v40/packages/claude-code/widgets/usage", "summary": "Coding-agent usage windows.", "requires_engine": ">= 1.0", "fits": ["canvas", "stack", "slot"], "context": {}, "inputs": {"harness": {"type": "string", "default": "claude", "summary": "Which coding agent."}}, "source": {"kind": "provider", "name": "app/harness-usage", "with": {"harness": "{{inputs.harness}}"}, "every": "60s"}, "view": {"kind": "app.harness-usage"}, "sizes": ["small", "medium", "wide"], "default_size": "medium", "places": ["home"], "single": false, "surfaces": ["context-sidebar", "home", "sidebar"], "available": true, "unavailable_reason": "" } ], "providers": { "devmachine-app/stats": { "package": "devmachine-app", "command": "stats", "scope": "machine", "trust": "official", "returns": {"disk": "object", "load": "object", "errors": "list"}, "min_every": "10s" }, "alice-tools/disk": { "package": "alice-tools", "command": "disk", "scope": "machine", "trust": "third-party", "package_source": {"url": "https://example.com/alice/tools.git", "ref": "v1", "commit": "0123abc"}, "returns": {"used": "number"}, "min_every": "30s" } }, "problems": [ {"path": "/Users/alice/.config/devmachine/packages/mine/widgets/bad/widget.yml", "message": "view.kind \"gauge\" needs engine 1.1"} ] } ``` `origin` is `release` or `local`; `version` is the release tag, or `""` for your own package. `surfaces` are the areas the widget fits, planned ones included: the area's layout is in `fits`, the widget's view is drawn there (in the menu bar, only `text`, `number`, `status` and `app.brand`), and the area gives every context key the widget requires. `single` is `true` when a board holds the widget at most once. `available` is `false` when the widget needs its package added and synced; `unavailable_reason` then names the command to run (see [why widgets come from packages](/how-it-works/widgets-come-from-packages/)). A widget with a problem is left out of `widgets` and listed in `problems`, and the command still exits 0, so one broken widget never hides the rest. A `package.yml` that cannot be read is a problem too: its widgets are left out, and when it is one of your own packages the release package of the same name is not used in its place. `trust` says how far the app trusts the widget: `official` for the pinned release, `local` for a package you wrote in `/packages/`, and `third-party` for a package installed with `packages install`. A third-party widget that runs something — a `command`, `prompt`, `session` or package provider — waits for your approval in the app, like a widget written in a board (see [where a public widget comes from](/how-it-works/where-a-public-widget-comes-from/)). A third-party widget also has `package_source`: `{"url", "ref", "commit"}`, where its package was fetched from. When its `.devmachine-source.yml` cannot be read, the widget is still third-party but has no `package_source`, and `problems` says why. A widget that reads a package provider has `provider`: that provider's `returns` and `min_every`. `providers` lists every package provider a widget may read, by `/`, with its package's `scope` and `trust` — a widget written in a board names one of these. A third-party provider has `package_source` too, the same as its widgets. The app puts that commit in what you approve for a board widget that reads it, so when `packages update` brings new code the widget asks again. In the text listing, a third-party widget says `(third-party from )` in place of its origin. `--board ` keeps only the widgets whose `surfaces` include that area — what the app's gallery offers when you press "Add widget" there. `problems` are kept as they are. `help` prints one widget's inputs, context, sizes and the areas it fits, and `once per board` for a single widget; with `--format json`, the same entry as `list`. `widgets help ` describes a widget; `--help` shows how to use a command. `validate` takes a `widget.yml`, a widget folder, a package folder or a board file. With no path it checks every board in `/boards/` and every widget in your own packages. For each widget that passes it prints its full name and the areas it fits (`mine/clock fits home`); a widget folder that sits in no package's widgets folder prints its name alone (`clock fits home`). It reports every problem at once, with file and line, and exits non-zero when there is one. `--format json` prints `{"ok": false, "checked": [...], "widgets": [{"path": ..., "name": ..., "surfaces": [...]}], "problems": [{"path": ..., "line": ..., "message": ...}], "warnings": [...]}`, with `name` written the same way and each warning shaped like a problem. A widget written in a board that names a machine or a workspace `config.yml` does not have is a problem. A widget written in a board that reads a package provider is checked too: the package exists and declares it, and `every` is not below its `min_every`. With no release in the cache, a missing package is not reported, since it may be one the release has. `widgets add`, `move` and `remove` skip that check, so removing a package never locks a board; they still refuse a provider name that is not `/` in lower case letters, digits, dashes and underscores. A package widget that names one by its literal name is only a warning (`warning: …` lines, and `"warnings"` in `--format json`), because a published widget is written for many configurations. A name that holds a template, such as `{{inputs.machine}}`, is not checked. `widgets add`, `move` and `remove` never refuse a name, so removing a machine does not lock a board. `schema` prints the engine contract: areas, providers, views and sizes. `--json` prints it as JSON, the same document the app is built against. `add` places a widget on a board and writes `/boards/.yml`. The id defaults to the widget's name, made unique (`usage`, `usage-2`). `--set` gives an input a value, converted to the input's type. For a choice of many, `--set machines=main,backup` writes a list, and `--set machines=` an empty one, which means all. A name your `config.yml` lacks is a `warning:` on stderr (and in `"warnings"` with `--format json`); the widget is still added. The widget must fit the area (`devmachine widgets list --board ` shows which do), and a widget marked `single` is refused when the board already has it. On Home (the default), `--size` is a preset the widget takes or `auto`. Without it the widget gets `auto` when its view grows with its content (the summary, machines and coding agent usage views, and the generic `text`, `number`, `status`, `list` and `markdown`) and its `default_size` otherwise. `--size auto` on a view that does not grow is refused. An `auto` widget is written as `frame: {x, y, w}` with no `h`: `w` is the width of its `default_size`, and the app works out the height from the content. The CLI cannot measure, so when it looks for a free spot it counts an `auto` widget at the height of its `default_size` (160pt for one written in the board). `--at x,y` is the top-left corner in points, snapped to 8pt; the widget goes exactly there, even on top of another, because widgets may overlap on Home. Without it the widget takes the first free spot, scanning rows of 8pt from 24,24 across a band 1280pt wide and keeping 8pt from every other widget. `--after` and `--before` are refused. The point is on Home with the app's sidebar open. With the sidebar hidden, the app spreads the widgets over the wider canvas: one at an edge stays at that edge, and any other keeps its share of the space between the edges. In the sidebar or the Context tab, the widget goes at the end of the list, or right after `--after `, or right before `--before ` (one of the two at most). `--size` is a preset or `auto`; without it the widget gets `auto` when its view grows with its content and its `default_size` otherwise. `--at` is refused. When the board file is missing, the CLI starts from the board the app draws by default, so the workspace list and the Context tab's sections stay. The default boards are listed in [the widget format](/reference/widget-format/#a-board-in-a-sidebar). In the menu bar (`--board menubar`) and its popover (`--board menubar-panel`), the widget goes in the list the same way, with `--after` or `--before`. Neither takes `--size` or `--at`. The menu bar holds 3 widgets, so a 4th is refused, and only a widget whose view draws one line fits it. A missing board starts from the default, so "❯_", the pull request count and the two tabs stay. See [the widget format](/reference/widget-format/#a-board-in-the-menu-bar). `remove` takes the widget with that id off the board. On a missing sidebar or menu bar board it starts from the default board, so `widgets remove publish-port --board context-sidebar` drops that one section and keeps the rest. `move` changes a widget's turn in a list (a sidebar, the menu bar or its popover): right after `--after ` or right before `--before ` (exactly one). `--board` is required, and Home is refused: a widget there has a place, not a turn. A missing board is read as the default board. A move that leaves the order as it was does not rewrite the file. An empty `--after ""` or `--before ""` is refused, on `add` as on `move`. `set` changes one widget on a board and leaves every other entry as it was. `--title` is the title this copy shows and `--every` how often it runs (`2m`, or `manual` for any source but a provider); `--title ""` and `--every ""` take the override off, so the widget's own comes back. `--every` is refused below what the widget's source allows and on a stream, with the same words as `widgets validate`. `--set` gives an input a value as on `add`, `name=a,b` for a choice of many. A widget written in the board takes `--title` only: to change what it runs, edit its `source` in the board file, and the app asks for your approval again. `--board` is required; a missing sidebar or menu bar board is read as its default board, and a missing Home board is an error. It prints `changed on the board: `, then any `warning:` about a choice your `config.yml` lacks. A `set` that changes nothing prints the same line but does not touch the file, so its comments stay. All four re-read the board first and write it in one step (a temporary file, then a rename). A board with a problem is refused and left as it is; so is a board that changed while the command ran. Comments in a board are lost when the CLI rewrites it. `--format json` prints `{"board", "path", "widget", "warnings"}` for `add` (`warnings` only when there are some; for a widget in a list, which is a sidebar, the menu bar or its popover, `frame`, `minimized` and `z` are zero and mean nothing, and in the menu bar and its popover `size` is `""`; `collapsed` appears when true; an `auto` widget on Home has `"h": 0`, which means it follows its content), `{"board", "path", "removed"}` for `remove`, `{"board", "path", "moved", "order"}` for `move`, `order` being every id after the move, and `{"board", "path", "widget", "warnings"}` for `set`. ## aliases ``` devmachine aliases [--write] [--path p] [--check] [--yes] ``` Prints one SSH `Host` entry per workspace, so `ssh acme-devmachine` works from an ordinary terminal, an editor or an app. ``` # >>> devmachine — generated, do not edit Host acme-devmachine HostName main User acme Port 22 ProxyCommand /opt/homebrew/bin/devmachine --config /home/you/.config/devmachine ssh-proxy main %p IdentityFile /home/you/.config/devmachine/keys/main IdentitiesOnly yes HostKeyAlias main-devmachine StrictHostKeyChecking yes UserKnownHostsFile "/home/you/.config/devmachine/known_hosts" GlobalKnownHostsFile /dev/null UpdateHostKeys no CheckHostIP no VerifyHostKeyDNS no KnownHostsCommand none HostKeyAlgorithms ssh-ed25519 # <<< devmachine ``` `--write` puts this block in the aliases' file, after asking first. **Only the text between the two markers is ever replaced** — the rest of the file may hold hosts devmachine knows nothing about. The aliases live in **one file**: `ssh_aliases_path` in `config.yml`, or `~/.ssh/config` when that is not set. Every writer uses it — `--write`, the automatic refresh after a workspace or machine changes, `setup` and `machines add` — and so does `doctor`'s check. `--write --path ` moves them: it writes the block there, records the file as `ssh_aliases_path`, and empties the block in the file they lived in before, because ssh keeps the first value it reads and a stale copy read first would win. Use it when `~/.ssh/config` is generated by something else and `Include`s a file of its own. - `ProxyCommand` runs [`ssh-proxy`](#ssh-proxy) when ssh connects, which picks the first of the machine's addresses that answers at that moment. The file holds no address, so a private network going up or down never makes it stale. `HostName` is the machine's name, and nothing dials it. The path is the `devmachine` on your `PATH`, written in full. - **When `devmachine` is not on your `PATH`,** the entry has no `ProxyCommand`, and `HostName` is the first address that resolves now, as in older versions. Run `aliases --write` again when that changes. - `HostKeyAlias` is the same for every alias of one machine, so ssh checks the pinned key whichever address it came through. - `IdentitiesOnly yes` goes with `IdentityFile`, so ssh offers only this key and does not burn login attempts on others in your agent. `IdentityFile` points at `key:` when the machine has one, or at the recorded `agent_key:`'s public file otherwise — ssh matches a public-key `IdentityFile` against the agent instead of reading a private key from it. With neither, there is no `IdentityFile`, and ssh offers everything the agent holds. A `-pub` alias goes straight to the machine's first literal address, without `ProxyCommand`. With `ProxyCommand` it is written when the machine has more than one `hosts` entry; without, only when a second address exists and the first did not already resolve to it. `mosh acme-devmachine` needs `--experimental-remote-ip=remote` with the `ProxyCommand` form: mosh's default replaces the ProxyCommand with its own. See [SSH aliases that resolve when you connect](/how-it-works/addresses-and-fallback/#ssh-aliases-that-resolve-when-you-connect). `--format json` adds `proxy_command` to each alias that has one. ## resolve ``` devmachine resolve [--machine m] [--format json] ``` Prints the machine's addresses in the order every connection tries them, without connecting. A `:` entry is asked of the network package that declares the prefix, and a DNS name is looked up, so every address is an IP. An entry that gave no address is listed under `skipped`, with the reason. ``` ADDRESS FROM PACKAGE 100.64.0.5 tailscale:main tailscale 203.0.113.10 203.0.113.10 - skipped: tailscale:vps tailscale is not running ``` The JSON is what the macOS app reads, and its shape is stable: ```json { "machine": "main", "addresses": [ {"address": "100.64.0.5", "source": "tailscale:main", "package": "tailscale"}, {"address": "203.0.113.10", "source": "203.0.113.10", "package": ""} ], "dropped": [ {"source": "tailscale:vps", "reason": "tailscale is not running"} ] } ``` - `addresses` is in try order. `address` is always an IP address. `source` is the `hosts` entry it came from; `package` is the network package that resolved it, empty for a literal entry. An entry that gives several addresses appears once per address. - `dropped` is every entry that gave nothing, with why. Both lists are `[]` when empty, never missing. - A `tailscale:` entry resolved by the deprecated built-in resolver reports `"package": "tailscale"`. A mosh client needs an IP for its UDP connection: this is where to get it. Refused for a `self: true` machine, which has no address. See [addresses and fallback](/how-it-works/addresses-and-fallback/). ## sessions ``` devmachine sessions [--workspace name]... [--json | --format json] ``` Prints the tmux sessions of every workspace: name, window count, folder, git branch, age, which coding agents run in it, and whether it is busy or needs attention. It asks all workspaces at once, each with a 5 second limit. `--workspace` limits the answer to the workspaces you name, and can repeat. A name that is not in the configuration gets its own `not-configured` error, so one stale name never hides the workspaces that do answer. ``` WORKSPACE SESSION BRANCH AGE STATE alice checkout feature/checkout 3h busy bob - - - error: machine "main": no address answered: ... ``` `--json` is the same as `--format json`. The JSON is what the macOS app reads, and its shape is stable: ```json { "workspaces": [ { "name": "alice", "machine": "main", "sessions": [ { "name": "checkout-flow", "windows": 2, "path": "/home/alice/acme-web", "branch": "feature/checkout-flow", "created_at": "2026-10-08T12:00:00Z", "age_seconds": 10800, "last_activity_at": "2026-10-08T14:59:58Z", "harnesses": ["claude"], "busy": true, "attention": false } ] }, { "name": "bob", "machine": "main", "sessions": [], "error": {"kind": "unreachable", "message": "machine \"main\": no address answered: ..."} } ] } ``` - `sessions` is `[]` when empty, never missing. - `error` appears only on a workspace that could not answer; the others still answer, and the command exits 0. - `error.kind` is one of `unreachable` (no address answered, or the 5 seconds ran out), `host-key-rejected` (the machine's key is not the one pinned), `login-refused` (the machine answered but refused the workspace's login, most often because the workspace is not synced yet, so its account does not exist), `login-waiting` (the machine accepted the key and the SSH agent has not approved it yet, as 1Password asks after a wake; the login stays open until you approve), `tmux-missing` (tmux is not installed there), `not-configured` (the name given to `--workspace` is not in the configuration) or `other`. - The table shows `busy`, `attention` or nothing under `STATE`, and the folder's name when a session has no branch. See [session indicators](/how-it-works/session-indicators/) for how `busy` and `attention` are decided. ## scheduled ``` devmachine scheduled list [--workspace name]... devmachine scheduled add --workspace w --name n --folder f (--command c | --harness h --prompt p [--model m] [--permission-mode x]) --every once|hourly|daily|weekdays|weekly|monthly [--at HH:MM] [--minute M] [--weekday mon..sun] [--day D] [--date YYYY-MM-DD] [--timezone zone] [--timeout 30m] [--allow-dangerous] [--yes] devmachine scheduled edit --workspace w [any flag of add] devmachine scheduled pause|resume --workspace w devmachine scheduled rm --workspace w [--yes] devmachine scheduled run --workspace w devmachine scheduled runs --workspace w devmachine scheduled log --workspace w devmachine scheduled harnesses ``` A scheduled task runs a shell command, or a prompt for a coding agent, in a folder of a workspace, on a schedule. The workspace keeps and runs its own tasks, so they run with your computer off. See [scheduled tasks](/how-it-works/scheduled-tasks/) for how. ``` devmachine scheduled add --workspace alice --name "Daily briefing" --folder ~/dev/app \ --harness claude --prompt "Summarize yesterday's commits" --every weekdays --at 09:00 ``` - `--every` says how often, and which other flag it needs: `once` needs `--date` and `--at`; `hourly` needs `--minute`; `daily` and `weekdays` (Monday to Friday) need `--at`; `weekly` needs `--weekday` and `--at`; `monthly` needs `--day` (1 to 31, a short month uses its last day) and `--at`. - `--timezone` is the zone `--at` is in, such as `America/Sao_Paulo`. It defaults to your computer's. - `--harness` is `claude` or `codex`. `--model` is passed to the agent as written; empty means the agent's own default. `--permission-mode` takes the agent's modes, listed by `scheduled harnesses`. A mode that never asks for approval needs `--allow-dangerous`. - `--folder` may start with `~`, the workspace's home. It must exist when the task runs. - `--timeout` stops a run after that long: 30 minutes by default, at most 6 hours. - The first task in a workspace without the `scheduled` package asks to set it up: it adds the package to the workspace and runs `sync` for its machine, then creates the task. `--yes` does that without asking. It refuses, and changes nothing, when the packages release your configuration uses has no `scheduled` package yet. - `edit` changes only the flags you give. Changing `--command` or `--prompt` switches what the task runs. Changing `--harness` drops the old agent's model and permission mode, unless you give new ones. - `pause` stops a task from running on its schedule; `run` still runs it. `resume` refuses a one-off task that already ran; give it a new `--date` with `edit`. - `run` starts the task now and prints the run's id at once. `runs` shows when it ends, and `log` what it printed. - `rm` asks first, and deletes the task and the record of its runs. ``` WORKSPACE ID NAME SCHEDULE ACTION NEXT LAST alice t_7f3a9c Daily briefing Weekdays at 09:00 claude 2026-10-16 09:00 succeeded 2026-10-15 09:00 ``` With `--format json`, `list` prints what the macOS app reads: ```json { "workspaces": [ { "name": "alice", "machine": "main", "installed": true, "tasks": [ { "version": 1, "id": "t_7f3a9c", "name": "Daily briefing", "paused": false, "done": false, "folder": "~/dev/app", "timeout": "30m", "schedule": {"every": "weekdays", "at": "09:00", "timezone": "America/Sao_Paulo"}, "action": {"kind": "prompt", "harness": "claude", "prompt": "Summarize yesterday's commits"}, "created_at": "2026-10-15T12:00:00Z", "updated_at": "2026-10-15T12:00:00Z", "next_run_at": "2026-10-16T12:00:00Z", "last_run": { "id": "20261015T120000Z-ab12", "task_id": "t_7f3a9c", "status": "succeeded", "trigger": "schedule", "started_at": "2026-10-15T12:00:00Z", "ended_at": "2026-10-15T12:01:10Z", "duration_ms": 70000, "exit_code": 0 } } ] }, {"name": "bob", "machine": "main", "installed": false, "tasks": []} ] } ``` - `installed` is whether the workspace has the `scheduled` package. A workspace without it is not asked, and has no error. - `next_run_at` is `null` for a paused task and for a one-off task that is `done`. `last_run` is `null` before the first run. - A run's `status` is `running`, `succeeded`, `failed`, `timeout`, `error`, `missed` or `skipped`; `message` says why when it is not `succeeded`. - `error` appears only on a workspace that could not answer, and the command still exits 0. `error.kind` is `unreachable`, `host-key-rejected`, `login-refused`, `not-installed` (the package is in the configuration but not on the machine yet), `outdated` (the workspace's devmachine is older than yours), `not-configured` or `other`. The other commands print, with `--format json`: `add`, `edit`, `pause` and `resume` `{"workspace", "task"}`; `rm` `{"workspace", "removed"}`; `run` `{"workspace", "task", "run_id"}`; `runs` `{"workspace", "task", "runs"}`, newest first; `harnesses` `{"harnesses": [{"name", "package", "permission_modes", "dangerous", "models"}]}`. `log` prints the output as it is. ## chat ``` devmachine chat send [--chat ID] [--workspace W | --local] [--harness claude|codex] [--folder DIR] [--mcp] -- MESSAGE devmachine chat session (--chat ID | [--workspace W | --local] [--harness claude|codex] [--folder DIR]) [--mcp] devmachine chat ask (--workspace W | --local) --session S [--folder DIR] [--harness claude|codex] [--chat ID] -- QUESTION devmachine chat ask (--workspace W | --local) --session S [--folder DIR] [--harness claude|codex] [--chat ID] --serve devmachine chat list [--all] [--json] devmachine chat show ID [--json] devmachine chat rename ID TITLE devmachine chat delete ID ``` Talks to the `claude` or `codex` you are logged in to, on a workspace or on this computer, read only. See [chats](/how-it-works/chats/) for why it runs the CLI and not an API. `send` without `--chat` starts a conversation. The defaults come from `chat.harness` (`claude`), `chat.default_workspace` (else the first workspace, else this computer) and `chat.folder` (`~/chats`); set them with [`config set`](#config). With `--chat` it continues that conversation, on its own harness, workspace and folder. A flag that disagrees with them is an error, printed before any output. `send --chat` on an ask is refused: an ask goes on with `chat ask --chat`. A chat runs without the account's MCP servers, hooks and plugins, which are most of a harness's start-up. `--mcp` turns them on; the choice is kept on the chat, and `--mcp=false` turns them off again. A new chat without either flag takes `chat.mcp` (`false`). See [MCP servers are off unless you ask](/how-it-works/chats/#mcp-servers-are-off-unless-you-ask). `ask` asks about a coding session without writing to it. `--session` names the tmux session on the workspace. For a session on this computer that is not in tmux, `--folder` gives the session's folder. `--harness` names the harness when the caller already knows it; otherwise it is read from the session. The first call creates an ask (`kind: "ask"`); `--chat` continues it. Every question reads the session's transcript again and runs the harness with no tools and nothing saved; see [asking about a session](/how-it-works/chats/#asking-about-a-session). `send` and `ask` always print NDJSON, one object per line: ```json {"type":"started","chat":{...record...}} {"type":"status","stage":"connecting","message":"Connecting to alice…"} {"type":"status","stage":"starting","message":"Starting Claude…"} {"type":"status","stage":"waiting","message":"Claude is thinking…"} {"type":"text","delta":"It charges "} {"type":"tool","name":"Read","summary":"acme/billing.go"} {"type":"text","delta":"in cents."} {"type":"denied","name":"Edit","summary":"acme/billing.go"} {"type":"done","chat":{...record...}} ``` - `started` is always the first line, `done` the last on success. - `status` says what the wait before the answer is spent on, each stage when it really starts, and only the stages that apply: `connecting` ("Connecting to …", not for `--local`), `reading-transcript` ("Reading the session…", `ask` only: finding the session and building its excerpt), `starting` ("Starting Claude…" or "Starting Codex…": the harness was launched) and `waiting` ("Claude is thinking…": the harness is up, claude's `system/init` or codex's `turn.started`, and no text came yet). There is no stage for loading MCP servers: claude prints nothing that says it is doing that. A caller clears the status at the first `text`, `tool` or `denied`, and on `done` or `error`. `status` lines are never stored with the messages. - On failure the last line is `{"type":"error","kind":"…","message":"…"}` and the exit code is 1. See [the error kinds](/troubleshooting/#chat-error-kinds). - `text` carries the answer as it arrives; claude streams it in small pieces, codex one paragraph at a time. - `denied` is a tool claude wanted and was refused, because a chat has nobody to approve it. They come right before `done`, one per tool, with the same `summary` as a `tool` line. codex reports no such list: a command its sandbox blocks shows only as a `tool` that failed. See [what read only means](/how-it-works/chats/#what-read-only-means). - SIGINT or SIGTERM stops the harness (on a workspace, the ssh session) and ends with `cancelled`. The part of the answer that arrived is kept. ### chat session and ask --serve `chat session` keeps a chat's harness running and answers messages read on stdin; `chat ask --serve` does the same for an ask, with questions instead of messages. `send` stays for scripts. The harness starts before the first message, so a message pays only for its answer; see [warm sessions](/how-it-works/chats/#warm-sessions). Stdin takes one JSON object per line: ```json {"type":"send","text":"why is the build slow?"} {"type":"cancel"} ``` Stdout, one JSON object per line: ```json {"type":"ready","chat":null} {"type":"started","chat":{...record...}} {"type":"text","delta":"…"} {"type":"done","chat":{...record...}} {"type":"closed","reason":"eof"} ``` - Before `ready` come the start-up stages: `connecting` (on a workspace), `reading-transcript` (`--serve` without `--harness`) and `starting`. Each turn then has its own `waiting`; `ask --serve` also reads the session again, with `reading-transcript`, on every question. - `ready` comes once, when the harness is running. `chat` is the record for `--chat`, or `null` for a new conversation: the first `send` creates it, and its `started` carries it. - Each `send` then prints the events of `chat send`: `started`, `text`, `tool`, `denied`, then `done` or `error`. The process stays running after either. A `send` that arrives during an answer waits for it. - `cancel` stops the answer that runs; it ends with `error` `cancelled`. claude's process cannot drop an answer, so it is stopped and started again with `--resume`, and the next message works as before. A `cancel` with no answer running is ignored. - `closed` is the last line: `reason` is `eof` (stdin ended, or SIGINT or SIGTERM), `idle` (no message for 10 minutes) or `error` (the harness could not start; an `error` line with its kind comes first, and the exit code is 1). - A line that is not one of the two commands is ignored, with a note on stderr. - An unknown flag or command fails before `ready` with cobra's own `unknown flag` or `unknown command`, which is how a caller tells an older CLI. - claude runs as one process for the whole session. codex has no such mode: each message runs `codex exec`, with `resume` after the first, and `ready` comes at once. - With `--serve`, every question still finds the session and reads its transcript again; only the lean harness that answers stays running. When `--harness` is left out, the session is looked up before `ready`, and a missing session closes with `session-not-found`. A record, as `started`, `done`, `list` and `show` print it: ```json { "id": "c_3f9a1b2c4d5e", "title": "why is the build slow?", "harness": "claude", "workspace": "alice", "folder": "~/chats", "harness_session_id": "22222222-aaaa-4bbb-8ccc-000000000001", "created_at": "2026-10-15T12:00:00Z", "updated_at": "2026-10-15T12:00:09Z", "kind": "chat", "mcp": false } ``` - `workspace` is `"local"` for this computer. - `mcp` says whether the harness runs with the account's MCP servers. - `harness_session_id` is empty until the harness answered once. - `title` is the first line of the first message, cut to 60 characters. - An ask adds `session`, `session_folder` (the session's folder), `source_session_id` (the id of the transcript the last question read), `mode` (`"transcript"`) and `excerpts` (how many pieces of the transcript went into the last question). Its `harness_session_id` stays empty: an ask keeps no harness session. `list --json` prints `{"chats": [...]}`, the most recently updated first, without asks unless `--all`. `show --json` prints `{"chat": {...}, "messages": [...]}`, each message `{"role": "user" | "assistant", "text", "tools": [{"name", "summary"}], "at"}`, plus `denied: [{"name", "summary"}]` on an answer where claude was refused a tool, and `error: {kind, message}` on an answer that failed. `delete` forgets the local copy; the harness's own transcript stays on the workspace. ## ssh-proxy ``` devmachine ssh-proxy ``` The `ProxyCommand` the SSH aliases run; hidden from `help`. It resolves the machine's addresses like `resolve`, connects to the first that accepts a TCP connection on ``, and passes bytes between ssh (its standard input and output) and the machine until either side closes. Only the connection is retried on the next address — once one answers, the SSH handshake is under way there. When none answers it exits 1 with every address and why on standard error, which ssh shows as the reason the connection closed. ## stats ``` devmachine stats [--machine m] ``` Prints memory, swap, disk and load. The table rounds; JSON gives raw byte counts. On Linux it reads `free`, `df` and `/proc/loadavg`. A Mac has none of those, so there it reads `sysctl`, `vm_stat` and `df -k` of the data volume; "available" memory is the free, inactive and speculative pages. ## ssh, mosh ``` devmachine ssh [workspace] devmachine mosh [workspace] ``` Opens an interactive session: a workspace's account if named, the machine's admin if not. Both run the real `ssh`/`mosh` program, so your terminal, agent and tmux behave normally. Both connect to the first address [`resolve`](#resolve) lists. `mosh` survives a dropped or roaming connection and needs mosh on both sides. Both check `/known_hosts` first. ## run ``` devmachine run "" [--workspace w] [--no-log] devmachine run --argv [--workspace w] [--no-log] -- [args...] devmachine run --package [--workspace w] [--no-log] -- [args...] devmachine run --package --script [--workspace w] [--no-log] [-- args...] ``` Runs one command on a machine and prints its output. Its standard output goes to yours and its standard error to yours, as they arrive, so a program can parse stdout (`run --package devmachine-app -- stats` prints JSON there) while a warning or the reason a command failed still reaches the person, before the error. `--package` calls an installed package's entrypoint directly — everything after `--` goes to the package; `commands:` in its manifest can limit what it accepts. With `--workspace`, it runs as that workspace's own account, for a command that needs that account's own files or logins. Each word after `--` reaches the entrypoint as it is, an empty one too: over SSH the command is `/bin/sh -s` and the words go on its input, so the account's login shell never reads them. See [packages](/concepts/packages/). `--argv` runs a program with its arguments exactly as given: each word after `--` is quoted before it reaches the machine's shell, so a space, a `;` or a `$(…)` in one is just a character. It is how the app runs a widget's command; use it whenever the words come from somewhere else. Over SSH the command is always `/bin/sh -s`, and the words go on its input, so the account's login shell — even fish, which reads quotes differently — never sees them. On your own computer (`self: true`) bash runs the quoted words directly. `--script `, with `--package`, runs one file of the installed package instead of its entrypoint — the copy `sync` put on the machine, as the same account, with the package's credential loaded first, the way the entrypoint runs. The path is relative to the package's `package.yml` and must stay inside the package. `commands:` limits only the entrypoint, not a script. Arguments for the script follow `--`; like `--argv`, over SSH they go on the input of `/bin/sh -s`, so the account's login shell never reads them. `--no-log` leaves the run out of [the command log](#the-command-log). The app uses it for widgets that run every few seconds. `run` never sends your input to the command: it reads end-of-file. **Exit code.** `run` exits with the command's own code: 0 when it worked, the same non-zero code when it ran and failed. A command that ran and failed already said why on its own stderr, so `run` adds no `error:` line under it. When the command never ran — no such machine or workspace, no connection, a changed host key, a package that is not installed, a command `commands:` does not allow — it exits **255**, the code `ssh` uses for the same thing. So 255 has three meanings: the command never ran, the command itself exited 255, or it was stopped (see below). Only the first and the last print an `error:` line, and that line says which. A mistake in how `run` was called — an unknown flag, a missing `--`, a `--script` path outside the package — exits 1 before anything connects. **Stopping.** SIGINT (Ctrl-C) or SIGTERM ends `run` and the ssh or shell it started, and it exits 255. On your own computer (`self: true`) the command runs in a process group of its own, and everything it started gets SIGTERM, then SIGKILL five seconds later if it is still there. On a machine reached over SSH, a command that ignores its closed connection, such as an idle `tail -f`, ends the next time it writes. `run` keeps its SSH connection open for five minutes and reuses it, so a script calling it every few seconds skips the handshake each time. On a machine whose package manager lives outside the system `PATH` — a Mac with MacPorts or Homebrew — `run` puts the machine's `path_prefix` (see `machines show`) in front of `PATH`, so `devmachine run 'port installed'` finds `port` the way `run 'apt list --installed'` finds `apt` on Debian. A Linux machine has no prefix, and the command goes as written. ## upload ``` devmachine upload ... [--workspace w] [--dir path] [--mode 0600] ``` Sends local files into a home on a machine and prints, one per line, the absolute path each one landed at. With `--format json` it prints `[{"local": "...", "remote": "...", "bytes": N}]`; a file that failed has an `error` field instead of `remote`. - **Where.** `--workspace` sends into that workspace's home, as its own account. Without it, the files go to the home of the machine's admin, on the machine `--machine` names, or the only one configured. A workspace and a `--machine` it does not live on is refused. - **Folder.** `~/.cache/devmachine/uploads` by default. `--dir` names another folder, relative to the home (`notes`, `~/notes`) or absolute inside it (`/home/acme/notes`). A folder outside the home is refused, and so is one that leaves it through a symbolic link. Missing folders are created, mode `0700`. - **Names.** Each file keeps its name, with the local time before the extension: `report.pdf` becomes `report-20260930-143012.pdf`, `photo.final.png` becomes `photo.final-20260930-143012.png`, and `Makefile` and `.env` get it at the end. A name already taken gets `-2`, `-3` and so on: nothing is ever overwritten. Spaces and accents are kept; only `/`, line breaks and NUL become `_`. - **Mode.** `0600` unless `--mode` says otherwise. - **Failures.** A folder, a missing file or one you cannot read is refused before anything connects. With several files, every one is tried; the command exits non-zero if any failed, and names each on stderr. stdout holds only the paths, so a script or an app can read them. Each upload is one line in [the command log](#the-command-log). See [how an upload lands](/how-it-works/uploads/). ## download ``` devmachine download ... [--workspace w] [--to dir] [--progress] ``` Brings files or folders from a home on a machine to this computer and prints, one per line, the local path each one was saved at. With `--format json` it prints `[{"remote": "...", "local": "...", "bytes": N, "folder": false}]`; a path that failed has an `error` field instead of `local`. - **Who reads.** `--workspace` reads as that workspace's own account, so it gets exactly what that account can read. Without it, the machine's admin reads, on the machine `--machine` names, or the only one configured. A workspace and a `--machine` it does not live on is refused. - **Which path.** Relative to the home (`proj/report.pdf`), starting with `~/`, or absolute (`/home/acme/proj/report.pdf`). Put `--` before a path that starts with `-`. - **Where to.** `~/Downloads` by default. `--to` names another folder, which must already exist: a typo is refused before anything connects. - **Names.** Each file keeps its name. A name already taken gets `-2`, `-3` and so on before the extension: nothing is ever overwritten. - **Folders.** A folder arrives as one `.tar.gz`, with the folder at its top. Unpack it with `tar xzf .tar.gz`, or double-click it in Finder. - **Failures.** With several paths, every one is tried; the command exits non-zero if any failed, and names each on stderr. A failed or cut transfer leaves nothing behind. - **Progress.** `--progress` writes JSON lines to stderr as each file arrives, about a hundred at most: `{"remote": "...", "done": N, "total": N}`, with `done` in bytes. Every path is sized first, so a line with `"done": 0` for each one comes before any bytes move. A folder's `total` is `0`: its archive is packed as it travels. A path that does not exist gets no line. stdout holds only the paths, so a script or an app can read them. Each download is one line in [the command log](#the-command-log). See [how a download lands](/how-it-works/downloads/). ## dns ``` devmachine dns status [host] devmachine dns providers devmachine dns list [zone] [--dns-provider p] [--zone z] devmachine dns check [--dns-provider p] [--zone z] devmachine dns add [--ttl s] [--append] [--dns-provider p] [--zone z] [--check] [--publish] devmachine dns rm [value] [--dns-provider p] [--zone z] [--check] [--yes] ``` Manages DNS records through an installed provider package (Hostinger, Cloudflare, GoDaddy). See [DNS providers](/how-it-works/dns-providers/) for what differs between them. `status` checks a name from the outside — resolves, certificate accepted, answers a request. Defaults to `domain`. A 4xx counts as serving; a 5xx does not. `providers` lists every installed provider and the zones it can see — run first when a DNS command surprised you. `list`/`check` ask the registrar, unlike `dns status` which asks the public internet. `check` exits non-zero when a name is not set. `--dns-provider` picks a provider directly; `--zone` only for a token that cannot list its own zones. Which provider answered goes to stderr. `add` makes a name hold **exactly** one value, replacing what was there, after showing the zone, provider and value it replaces. `--append` keeps the values the name holds and adds this one, showing what it sits next to. `--ttl` sets the seconds a resolver may cache it; without it the registrar chooses. Types: `A`, `AAAA`, `CNAME`, `TXT`, `MX`, `SRV`, `NS`, `CAA`, with the value written the way a zone file writes it (`10 mail.example.com`, `10 5 5060 sip.example.com`, `0 issue "ca.example.net"`); a value that does not fit its type is refused before any provider is asked. `--check` previews; `--publish` is the non-interactive consent (`--yes` alone never grants it). `rm` removes one value, or every value at that name and type with none given — not always one atomic step on the registrar's side, so it warns first. A name is always the full name (or the zone itself for the apex). ## expose **HTTPS only.** Caddy handles HTTPS for you; anything else, or anything only you should reach, uses [`devmachine tunnel`](#tunnel) instead. ``` devmachine expose add --host [--via ] [--check] [--publish] [--no-apply] devmachine expose list devmachine expose rm [--check] [--yes] [--no-apply] [--keep-dns] ``` Publishes a workspace's port to the internet, over HTTPS, at a hostname you choose. `add` records the site in `config.yml`, points the hostname at the machine's first public address in `hosts` (same as `dns add`; a private network address listed first is skipped, since visitors cannot reach it), and then puts it on Caddy at once: it writes the workspace's routes file on the machine and reloads Caddy. That takes seconds, not a whole `sync` — and it is the very file `sync` writes, so the next `sync` has nothing to change. **Refuses if `caddy` is not on the machine.** It asks for confirmation first — the port becomes reachable by anyone who learns the hostname; see [tunnel](#tunnel) for what should not get a yes. `--publish` is the non-interactive way past that. - When Caddy refuses the new file, the old one stays, Caddy's own error is printed, and the command fails. The route stays in `config.yml` as `pending`: fix it and run `sync`. - When the machine cannot be reached, the route is recorded as `pending` and the command still succeeds. The next `sync` publishes it. - `--no-apply` only records, the way `add` worked before: the next `sync` publishes it. - `--check` changes nothing. It prints the line `config.yml` would gain and the routes file as it is on the machine against what it would become (`+` added, `-` removed). - When a DNS provider refuses the record (a rejected token, a zone it cannot change) or its setup is broken, the site is still put on Caddy: the command says why, prints the record to create by hand, and its JSON carries `dns_error`. - With `--format json` it prints `host`, `port`, `workspace`, `applied` (`true` once Caddy serves it) and `status` (`published` or `pending`), with a `note` saying why when it is pending. A site published with `--via` also carries `via`, and a `note` when that machine cannot reach the port. - `--via ` publishes through another machine's Caddy, for a workspace on a machine the internet cannot reach (a VM on your desk, a box behind NAT). The route is recorded with `via:`, the name points at that machine, and its Caddy proxies to the workspace's machine at the address its `hosts` give — one from a private network first, never a loopback one. Without `--via`, a workspace whose machine has no caddy is refused with the machines that have it. See [publishing through another machine](/how-it-works/published-sites/#publishing-through-another-machine). See [why a published app lives in the configuration](/how-it-works/published-sites/). `list` prints every host the machine's Caddy serves — those sent to it with `--via` too, naming the machine they come from — with its port, workspace, and one of four words: `published` (both agree), `pending`/`differs` (needs `sync`), `unmanaged` (only the machine has it — adopt with the `add` shown). Unreachable machine or missing `caddy`: rows print `unknown`. `rm` takes a host out of the configuration and off Caddy at once, on the machine that serves it whatever `--machine` says, the same way `add` puts it on: the workspace's routes file is written without it (or removed, with no route left) and Caddy reloads. With the machine out of reach it keeps serving the site until the next `sync`. `--no-apply` and `--check` work as for `add`; in JSON, `status` is `removed` or `pending`. A host the configuration does not know is refused, with how to adopt or remove it by hand. After Caddy, `rm` removes the A record `add` created — through the provider that holds the zone, and only while its value is still the serving machine's address (the `via` machine for a site published through one): - A record that points somewhere else now is left alone, and the command says where it points. Somebody repointed the name; deleting it would take down whatever answers there. - With no provider installed, or the machine out of reach, it prints the record to remove by hand, and the JSON carries `dns_error` saying so — the record is still there. - A name that holds the machine's address **and** another value is not deleted through the provider: some providers take one value out by rewriting the whole set, and a failure halfway would take the other value down too. The record to remove by hand is printed, and the JSON carries `dns_error`. - When the provider cannot list the zone or refuses the delete, nothing is deleted, the site still comes off Caddy, the record to remove by hand is printed, and the JSON carries `dns_error`. - The question it asks says so: "Stop publishing https://, and remove its DNS record while it points at ?". - `--keep-dns` takes the site off Caddy and leaves the record alone, for a name you will point somewhere else yourself. It prints the `devmachine dns rm … --machine ` that removes it later, and the question no longer mentions DNS. - `--check` also prints the DNS removal it would make. - `--no-apply` touches no machine, so no DNS either: it prints the `devmachine dns rm A
--machine ` to run later — `--machine` names the machine whose DNS provider holds the zone, which is the serving one, not necessarily the only one. (`add --no-apply` still points the name, since a name that does not resolve yet stops the certificate on the next `sync`.) See [Publishing](/concepts/publishing/) for the cases this question exists to catch. ## tunnel ``` devmachine tunnel [--local ] ``` Opens an SSH tunnel so a remote port shows up as `localhost:` on your computer. **Nothing is published** — no DNS, no certificate, no Caddy, only you can reach it. Use this instead of `expose` for anything not plain HTTP, or that only you should see: a database tool with real data, an inbox with real mail, a queue dashboard that can drain a queue. | Traffic | Anyone | Only you | | --- | --- | --- | | **HTTP** | `expose` | `tunnel` | | **Anything else** | nothing | `tunnel` | `--local` picks the port on your computer, if the remote one is already taken here. Holds your terminal open while the tunnel is up; Ctrl-C closes it, nothing left running. ## machine ``` devmachine machine setup devmachine machine doctor ``` Sets up and checks your own computer — the one thing you still install by hand, once. `doctor` checks `ssh`/`mosh` on `PATH` (mosh is a warning only), an SSH agent or configured key, and whether `~/.ssh/config` matches what `devmachine aliases --write` would produce now. That last one runs only with `ssh_aliases: true`; otherwise it reports `skip` — you keep the file yourself. `setup` installs what is missing via Homebrew on a Mac; on Linux it names what to install instead of guessing. Never installs an editor, shell plugins or language runtimes — that stays your choice. ## secrets ``` devmachine secrets set [value] [--stdin] devmachine secrets set [value] --workspace w [--env-file path] [--push] devmachine secrets list [--workspace w] devmachine secrets rm [--workspace w] [--from-file] devmachine secrets example ``` Stores values packages need that are not logins — API keys, tokens. `set` with no value asks without echoing, so it never reaches your shell history. `list` prints names only. Values go to the OS keychain when there is one, and otherwise to `secrets.json` in the configuration folder, readable only by you. `DEVMACHINE_KEYCHAIN=off` skips the keychain and always uses the file — the tests and the acceptance suite set it, so a run never writes to, or prompts about, your own keychain. `example` lists which `=` a machine's packages need, no values, always to stdout — never to a file, since `.env.example` sits one typo from `.env`. ### A workspace's own secret `--workspace` is a different thing from the plain form above: not a value a package declared, but your own app's secret — a key your code reads. It stores the value under `/` and delivers it on the next `devmachine credentials push`, or right away with `--push`. By default it lands in `~/.devmachine/env` — see [the `~/.devmachine/env` contract](#the-devmachineenv-file). `--env-file ` delivers into that dotenv file instead, relative to the workspace's home: the existing `=` line is replaced, or a new one appended, and everything else in the file is left exactly as it was. A path that would reach outside the workspace's home is refused — here for `../` or an absolute path, and on the machine for a symbolic link that leads out of it. The first time it edits a file that already existed, it keeps a copy at `.devmachine.bak`. See [credentials: your app's own secrets](/concepts/credentials/#your-apps-own-secrets). Setting the same name again with a different `--env-file` (or with none, back to the default) moves it: the next push takes the `=` line out of the file it was in before, then writes it to the new one. `list --workspace w` shows only that workspace's own secrets, with where each is delivered. `rm --workspace w --from-file` also removes the name from its file, on the next `credentials push` — it is not edited here, so `rm` never needs to reach the machine. ### The `~/.devmachine/env` file A sourceable file inside every workspace, `KEY='value'` per line, 0600, owned by the workspace's own account. It holds every workspace secret delivered with no `--env-file`. The `workspace` package makes every shell source it on login (zsh, bash and sh, through `~/.devmachine/shellenv`), so `export`ing anything more is never necessary. ## login ``` devmachine login [--workspace w] [--machine m] ``` Runs the login a package declared, in the account it belongs to, over a real terminal session (`ssh -t`) — a device code or browser prompt has to reach a person. A workspace credential needs `--workspace`: no single session to copy between accounts. A machine credential logs in once, as the admin, and copies what the tool wrote to `/etc/devmachine//`; the next `sync` spreads it to workspaces using that package. A `kind: secret` credential is refused — use `devmachine secrets set`, then `devmachine credentials push`. **A network package** — one whose `package.yml` has a [`network:` block](/reference/package-format/#network) with `join` — is logged in to by its package name: `devmachine login tailscale`. Instead of a declared command, it runs the package's `join` script on the machine, as the admin, over `ssh -t`, with the machine's settings for that package (for example `tailscale.login_server`). Then it runs the package's `self_name` script and, unless the machine's `hosts` already has it, adds `:` above the other addresses in `config.yml`, writing `hosts:` as a block list, one address per line, with any comment next to an address kept. The public address stays as a fallback. When the name cannot be read, it prints the machine's `hosts:` block to paste instead, with `- :` first. The package must be synced first: `join` runs from where `sync` put it. `--workspace` is refused: a network joins the machine. With a packages release whose `tailscale` package has no `network:` block yet, `login tailscale` runs its declared `tailscale up`, then reads the name from `tailscale status --json` on the machine and adds `tailscale:` the same way. This path is deprecated. See [private networks](/concepts/private-networks/) and [the network package contract](/reference/network-package-contract/). Same strict fingerprint check as every other command. See [SSH: logging in and knowing it is your server](/how-it-works/ssh/). ## credentials ``` devmachine credentials list [--machine m] devmachine credentials push [--machine m] [--check] [--yes] ``` Shows what a machine's packages need to authenticate, and what is missing. Every row names the fixing command. `unknown` means the package never said where its tool keeps the result — not the same as missing. Never prints a value. `push` delivers the values that are missing, and a token it delivered as an env file that the machine holds an older copy of: it asks the machine only for a SHA-256 of that file, so a token rotated with `secrets set` reaches the machine on the next push (reported as `replaced`) without a value ever crossing back. A file a tool keeps for itself (`path:`) is never rewritten once it is there. It skips logins (nobody can push a browser session) and names any secret never stored; exits non-zero if it found one. A workspace's own value (`/`) wins over the shared one. `--check` previews and writes nothing. It also delivers every workspace's own secret set with `secrets set --workspace` (see above) whose workspace lives on the machine being pushed to, and removes the ones marked with `secrets rm --from-file`. Anything it delivers inside a workspace's home — a package's workspace credential or a workspace's own secret — is refused when a symbolic link on the way leads out of that home, and the file is replaced, never written through, so a link in its place cannot redirect the write. ## packages ``` devmachine packages list devmachine packages add [--machine m | --workspace w] [--check] [--yes] devmachine packages rm [--machine m | --workspace w] [--check] [--yes] devmachine packages install [@] [--check] [--yes] devmachine packages update [--check] [--yes] devmachine packages remove [--yes] devmachine packages new [--scope machine|workspace] [--into ] devmachine packages validate devmachine packages schema [--json] devmachine packages help [--json] devmachine packages pin [release] devmachine packages outdated ``` Manages what is installed on your machines and workspaces. See [the package format](/reference/package-format/). `add` refuses a package that does not run on the machine's system — or on the system of the workspace's machine — once the CLI knows that system, so the mistake shows now and not at the next `sync`. See [troubleshooting](/troubleshooting/#package-x-runs-on-linux-machine-y-is-macos). `list` shows each package once with every machine and workspace that uses it; one nothing provides is listed as `missing`. `list --format json` prints `{"release": "v17", "packages": [...]}`: `release` is the packages release the list was read from (empty when nothing is pinned, so only your own packages are listed), and one entry per package: ```json { "name": "hostinger", "scope": "machine", "source": "release", "summary": "DNS zones on Hostinger.", "category": "DNS", "kind": "dns", "platforms": [], "needs": [], "credentials": [ {"name": "hostinger", "kind": "secret", "scope": "machine", "env": "HOSTINGER_API_TOKEN", "shareable": false} ], "variables": [ {"name": "zones", "summary": "Zones to manage.", "default": [], "type": "list"} ], "installed_on": ["machine main"] } ``` `kind` is the contract a callable package answers — `dns` marks a [DNS provider](/how-it-works/dns-providers/) — and is left out for an ordinary package. `platforms` are the operating systems it runs on (`linux`, `macos`), and `[]` means any — a package that says `["macos"]` runs only on a Mac machine, one reached over SSH or your own computer as a self machine. `needs` are the packages it brings in before itself, `[]` when none: for `essentials` that is the list it is made of. `category` is the manifest's grouping, left out when it has none. `credentials` lists what the package declares, always an array: each one's `name`, `kind` (`secret`, `file` or `manual`), `scope`, and `env` or `path` where the value is delivered. **It never carries a value** — it is there so a client knows the name to store with `secrets set` before the package is added. `shareable` is `true` when a workspace can take that login from the machine — `workspaces edit --share =machine` — because the package says a copy of its session works on another account. When it is `false`, `sync` refuses that choice (see [troubleshooting](/troubleshooting/#credential-x-cannot-be-shared)), so the only answer is `own`; it is always `false` for a secret or a file. `variables` lists the settings the manifest declares, sorted by name, always an array: each one's `name`, `summary`, the manifest's `default` (`null` when it has none) and `type` (`string`, `number`, `boolean`, `list` or `map`): the one the manifest declares, or else read off the default, and left out when there is neither. It is what `--set .=…` on `machines edit` or `workspaces edit` accepts. **It carries the manifest's default, never a value you set** — your values are in `workspaces list` and `config.yml`. `installed_on` is `[]` when nothing uses the package. With no `config.yml` yet, `list` reads the **latest** packages release — the one `setup` would pin — so a new user sees what a first machine can start with. With no network to find it, it fails and says so. `add`/`rm` only edit `config.yml` — `sync` applies the change. Pass `--machine` or `--workspace`; with one configured machine, that is the target. Comments in `config.yml` survive. `install` brings in a package somebody published in a git repository: `https://example.com/alice/tools.git`, or `git@example.com:alice/tools.git` to use your SSH key. `@` picks a tag, a branch or a commit; without it, the default branch. Only `https://` and `git@` addresses are accepted. The repository holds one package, with `package.yml` at its top. It fetches that one commit (needs `git`), checks it the way `packages validate` does, and refuses: - a name the pinned release already has — your package would replace the official one everywhere; - a name you already have in `/packages/`; - a link that leads outside the package; - a file name, summary, command, provider, credential or needed package holding a character that moves or hides text in a terminal (a control character such as ESC, or a Unicode bidirectional mark or override), or a file name that is not UTF-8; - a package that does not validate (every problem is listed). Then it shows what the package brings — its widgets and which of them run code, the commands of its entrypoint, its providers, every executable file, every task file (`tasks/`, `handlers/`), every other file of the role that decides what those tasks do (`meta/`, `library/`, `module_utils/`, `*_plugins/`, `templates/`, `files/`, `vars/`, `defaults/`) and the credentials it asks for — and asks before writing `/packages//`. `--yes` does not ask; `--check` shows and writes nothing. It records where the package came from in `/packages//.devmachine-source.yml`: ```yaml url: https://example.com/alice/tools.git ref: v1 commit: 0123456789abcdef0123456789abcdef01234567 installed_at: "2026-10-07T12:00:00Z" ``` That file is what makes it third-party: its widgets that run code ask before they run (see [where a public widget comes from](/how-it-works/where-a-public-widget-comes-from/)). Installing touches no machine: `packages add --machine ` and `sync` do, and its tasks then run as root there, like any package's. `--format json` needs `--check` or `--yes`, since it cannot ask, and prints `{"name", "scope", "summary", "needs", "widgets": [{"name", "source", "runs_code"}], "commands", "providers", "scripts", "tasks", "role_files", "credentials", "url", "ref", "commit", "path", "installed"}`. `update` fetches the address and ref recorded in `.devmachine-source.yml` again, checking the address as `install` does. When the commit did not move it says so and changes nothing. Otherwise it shows the old and new commit; the widgets, commands and providers added or removed; and the credentials, scripts, tasks and role files added, removed or changed (a script, task or role file changed when its bytes did, a credential when anything `package.yml` says about it did), and asks before replacing the folder (`--yes`, `--check` as for `install`). A new commit changes what the app approved, so the package's widgets that run code ask again. It refuses a package you wrote yourself, a repository that now holds a package of another name, and a name the pinned release now has. A fetch or a check that fails leaves the old copy as it was: the new one is fetched and checked in a folder beside it, and only then swapped in. `--format json` prints `{"package", "path", "url", "ref", "previous_commit", "commit", "changes": {"widgets_added", "widgets_removed", "commands_added", "commands_removed", "providers_added", "providers_removed", "credentials_added", "credentials_removed", "credentials_changed", "scripts_added", "scripts_removed", "scripts_changed", "tasks_added", "tasks_removed", "tasks_changed", "role_files_added", "role_files_removed", "role_files_changed"}, "updated"}`, each an array of names. A Ctrl-C in the middle of the swap can leave the folder missing, with both copies kept under `/packages/.install-…/`: see [troubleshooting](/troubleshooting/#a-package-is-gone-after-a-ctrl-c-during-packages-update). `remove` deletes `/packages//` for a package installed with `install`, after asking. It never deletes a package you wrote, and it refuses one still added to a machine or a workspace: take it off with `rm` and `sync` first, or the next sync would find it missing. It also refuses one listed in the future workspace defaults: take it out with `workspaces defaults --rm ` first, or the next workspace would find it missing. Not to be confused with `rm`, which takes a package off a machine or a workspace and deletes nothing. `--format json` prints `{"package", "path", "removed"}`. `new` writes a package that already passes `validate`; refuses to overwrite one that exists. `validate` reports every problem at once, with file and line. It also prints warnings, which do not fail it: today, a package that reads `devmachine_account` without registering it (see [troubleshooting](/troubleshooting/#packages-validate-warns-about-devmachine_account)). `--format json` adds them as `warnings`, apart from `problems`. `schema` prints the `package.yml` format this binary reads. `pin` writes `packages: ` — with none given, the latest; a release is a tag such as `v8`, never a branch. `help` asks an installed package what it accepts, by running its own `help`. `outdated` says whether a packages release newer than your pin is out. It changes nothing; `devmachine update` moves the pin. `--format json` prints: ```json {"pinned": "v32", "latest": "v33", "newer": true, "notes_url": "https://github.com/mydevmachine/packages/releases/tag/v33"} ``` `pinned` is empty and `newer` is `false` when nothing is pinned, or there is no `config.yml` yet. `newer` is `false` when your pin is the newest or newer. `notes_url` is the release page for `latest`. The newest release is asked of GitHub at most once a day and kept in your cache folder; `update` and `packages pin` ask again and store the answer. Offline, the last answer is used, however old. Offline with no answer ever stored is an error and a non-zero exit (with `--format json`, nothing on stdout and the error on stderr). Exits 0 whether or not a newer release is out. ## sync ``` devmachine sync [--machine m | --workspace w] [--check] [--yes] [--tags a,b] ``` Applies your configuration to a machine — installs what is missing, updates what changed. In order: checks the configuration, fetches the pinned release if needed, plans what the machine and its workspaces should get, checks your own packages, prints the plan, asks, then runs Ansible on the machine, streaming output. | Flag | Meaning | | --- | --- | | `--check` | dry run: reports what would change, changes nothing | | `--yes` | apply without asking | | `--tags a,b` | only the packages named | | `--workspace w` | only that workspace, on the machine it lives on ([how](/how-it-works/syncing-one-workspace/)) | One tag beyond package names: `credentials`, which only copies shared logins — run after `devmachine login` instead of a full sync. `--check` never writes the lock file. Only your own packages (in `/packages/`) are checked before the run. A package installed with `packages install` whose name the pinned release now has too stops the sync before it connects, since your copy would replace the official one ([troubleshooting](/troubleshooting/#x-is-installed-from--and-packages-release-vn-has-an-official-x)). Every package's `platforms` is checked against the machine's system before the machine is changed — from what was last read, then again from what `sync` reads as it connects — and a package for another system stops the sync, naming both ([troubleshooting](/troubleshooting/#package-x-runs-on-linux-machine-y-is-macos)). `sync` also keeps what it read in `/state/machines/.json` (see `machines show`). With `--format json`, stdout is the result; the plan and machine output go to stderr. On success, `/packages.lock` records what was applied, at which release and checksum, for the machine synced. With `--tags`, it records only the packages named: every other package keeps the entry the last full sync left, and one that never ran stays out of the lock, so `run --package` and the next `sync` see what is really there. The files a package added to another's folder (`extends`) are recorded only for the packages named, and none of the old ones is forgotten, since the step that removes them did not run. The whole bundle is still sent, so every package's entrypoint comes from the pinned release. It also refreshes `~/.ssh/config`'s managed block, when `ssh_aliases: true` is set, and prints how to reach each workspace on that machine: `devmachine ssh ` always, and `ssh -devmachine` when aliases are on. With `--workspace`, the machine's own packages and every other workspace are left alone, and so is their part of the lock. It writes extension files and never removes one: the next full sync does that. Naming a `--machine` the workspace does not live on stops the sync before it connects ([troubleshooting](/troubleshooting/#workspace-x-lives-on-y-not-z)). ## update ``` devmachine update [--machine m] [--skip-cli] [--skip-packages] [--yes] devmachine update --no-machines [--skip-cli] [--skip-packages] [--format json] devmachine update --cli-only [--format json] ``` Brings everything up to date, then stops before it changes a machine. Five steps, in order, each with a short header: 1. **CLI** — asks GitHub for the newest release. If it is newer: when Homebrew installed the CLI, runs `brew update`, `brew trust --formula` (only on a Homebrew that has it) and `brew upgrade mydevmachine/tap/devmachine`; otherwise downloads the release archive for your system, checks it against the release's `checksums.txt`, and swaps it in for the running binary. Then the new binary runs the other steps. A development build (`devmachine version` says `dev`) is never replaced. 2. **Packages** — when `config.yml` pins an older packages release, pins the newest, like `packages pin`. Only `config.yml` changes (and, in a versioned configuration, one commit). Nothing is pinned when nothing was. 3. **Skills** — `skills update`, for the skills on your computer, from the release just pinned. 4. **Doctor** — `doctor` on every machine (or the one `--machine` names). Warnings and failed checks are shown, and the run goes on. A machine that cannot be reached skips step 5. 5. **Sync check** — `sync --check` on every machine it reached, and the tasks each one would change. If any would change, it asks once: `Apply these changes with sync? [y/N]`. Yes runs `sync` on those machines. No, an empty answer, or no terminal at all prints the exact `devmachine sync` command to run later. | Flag | Meaning | | --- | --- | | `--skip-cli` | leave the CLI as it is | | `--skip-packages` | leave the packages pin as it is | | `--yes` | answer yes to the sync question — this changes machines; use it only in automation you trust | | `--no-machines` | run steps 1 to 3 and stop: no doctor, no sync check, never a question. It takes `--skip-cli` and `--skip-packages`, and refuses `--yes`, `--cli-only` and `--machine` | | `--cli-only` | run step 1 alone and stop: no packages pin, skills, doctor or sync, and no configuration is read. It cannot be combined with the other flags or `--machine` | With `--cli-only`, a build from source (`devmachine version` says `dev`) is an error, not a skip: there is no install to update, so it says what to run instead. With `--cli-only --format json`, the log goes to stderr and stdout gets one object at the end: ```json {"from": "0.7.22", "to": "0.7.23", "method": "homebrew", "status": "updated", "ok": true} ``` `method` is `homebrew`, `download` (the release archive) or `source`; `status` is `updated`, `already latest` or `failed`, and a failure adds `error` with the reason and exits non-zero. With `--no-machines --format json`, the log goes to stderr and stdout gets one object at the end: ```json {"cli": {"from": "0.7.30", "to": "0.7.31", "updated": true}, "packages": {"from": "v32", "to": "v33", "pinned": true}, "skills": {"updated": true}} ``` Every field is always there. A step that changed nothing has `to` equal to `from` and `false`; so does a skipped one. `packages.from` is empty when nothing is pinned, and then nothing is pinned. When a step fails, the object is still printed, with what was done, and the command exits non-zero with the reason on stderr. When the CLI was replaced, the object comes from the new binary. The output ends with one line per step: `updated`, `already latest`, `ok`, `nothing to do`, `skipped` or `failed`, with the reason. The doctor line instead says what doctor found, such as `2 warning(s)` or `machine far unreachable`, and the sync line lists each unreachable machine as `far skipped (unreachable)`. The exit code is non-zero only when one of update's own steps failed: the CLI update, the packages pin, the skills, the sync check, or a sync you applied. What doctor finds never fails `update`; run `devmachine doctor` when a script needs that exit code. Saying no to the sync is not a failure. Without `--cli-only` or `--no-machines`, `update` prints for a person, so it refuses `--format json`; use `doctor` and `sync --check` with `--format json` instead. Why it works this way: [Updating](/how-it-works/updating/). ### The hint that a newer packages release is out After `sync`, `doctor`, `machines list` and `workspaces list`, a line on stderr says when a packages release newer than your pin is out: ``` packages v33 is out (you pin v32): run devmachine update ``` It appears at most once a day, and again on the first run of a new CLI version. It never appears with `--format json`, when stdout or stderr is not a terminal, or when nothing is pinned. It reads the same daily answer as `packages outdated`, and asks GitHub at most once a day itself. `DEVMACHINE_NO_UPDATE_HINT=1` turns it off. ## version, help ``` devmachine version devmachine help [command] [--json] ``` ## logs ``` devmachine logs path [--format json] ``` Prints where the CLI writes its log: `/logs/devmachine.log`, as an absolute path. With `--format json`: `{"path": "…"}`. The path does not change: the macOS app relies on it. A command that changes a machine (`setup`, `machines add`, `sync`, `update`, `doctor`, `packages add`, `run`, `login`, `credentials push` and the like) writes its whole output there, with secrets taken out, and when it fails its last line on stderr is `log: `. Any other command writes one line there when it fails, and nothing when it works. See [the CLI's log](/how-it-works/the-cli-log/). ## The command log `run`, `upload`, `download` and `sync` each append one line to `/history.log`, mode `0600`: ``` 2026-09-18T12:00:00Z workspace acme ok "docker ps" 2026-09-18T12:01:00Z machine main failed "sync --tags caddy" ``` UTC time, target, success or failure, then the quoted command. See [configuration](/concepts/configuration/#the-command-log). `run --no-log` adds nothing: it is for a program that polls, such as a widget, whose runs would bury everything else. **`setup`, `machines add` and `login` are not logged** — the first two handle a root password, and `login` runs a command you watch yourself. --- # https://mydevmachine.sh/reference/package-format/ A package is an Ansible role plus one extra file, `package.yml`. Nothing is translated on the way to the machine: what you write is what runs, so a failure points at the exact line you wrote. This page and the validator agree. When they disagree, trust the validator — ask it with `devmachine packages schema --json`. ## The layout ``` / package.yml tasks/main.yml defaults/main.yml handlers/, files/, templates/, vars/ (optional, as in any role) ``` The directory name **is** the package name. `devmachine packages new ` writes a starting skeleton that already passes `devmachine packages validate`. ## The fields ### `format` (required) The shape of the file. This CLI reads format `1`. A validator that meets a format it cannot read says so and stops, instead of misreading fields it does not understand. ### `name` (required) Lower case letters, digits, dashes and underscores, matching the directory name — a package is found by its directory. ### `scope` (required) `machine` or `workspace`, nothing else. A fact about the software, not a preference: Docker installs once and serves everyone, so it is `machine`; a tool with a login per person is `workspace`, running once per workspace that asks for it. ### `summary` (required) One line saying what the package installs. `packages list` prints it. ### `category` A word or two grouping the package with others like it, such as `Security`, `Coding agents` or `DNS`. The [packages page](https://mydevmachine.sh/packages/) filters by it. The CLI does not read it, so any value is accepted, and a package without one is listed as `Other`. ### `platforms` The operating systems the package runs on, as a list of `linux` and `macos`: ```yaml platforms: [macos] ``` Left out, the package runs anywhere. A machine runs Linux or macOS, and macOS can also be your own computer, added as a [self machine](/how-it-works/your-computer-as-a-machine/). So a package written for Homebrew says `[macos]`, and an app stops offering it for a Linux server — `packages list --format json` reports it as `platforms`. The same holds for a `workspace` package: a workspace lives on whatever its machine runs, so `[linux]`, `[macos]` and `[linux, macos]` are all accepted. How to write one package for several systems, and the traps on each, is in [one package on many systems](/how-it-works/packages-on-many-systems/). ### `requires.cli` Which version of the CLI can run this package: `">= 0.2.0"`, `"> 0.2.0"` or `"= 0.2.0"`. Different from `format`: `format` says whether the CLI can *read* the file, `requires.cli` says whether it can *run* what it describes — the binary and the packages release on their own schedules, so the two can disagree. A CLI built from source calls itself `dev`, and every constraint allows it. ### `needs` Packages that must run before this one: ```yaml needs: [base, firewall] ``` The only thing that decides run order — the order packages are listed in your own configuration means nothing. A circular dependency is refused, naming the packages involved. ### `provides` Places other packages may write into, as a name and an absolute path on the machine: ```yaml provides: sites.d: /etc/caddy/sites.d ``` ### `extends` Adds a file to a place another package opened: ```yaml extends: caddy.sites.d: files/sharing.caddy ``` The key is `.`, and the value is a path inside this package. It can only add a file there, never change what is already there or reach anywhere else. Extending a place nobody provides is refused while devmachine plans, before anything runs. The file lands as `-`, so two packages adding a same-named file never collide. ### `variables` Values the package reads, each with a summary and a default: ```yaml variables: port: summary: The port the container listens on. default: 53842 ``` The package's Ansible role reads `devmachine__`, so a package called `tunnel` that declares `port` uses `devmachine_tunnel_port` — the package name is part of it since Ansible has one shared namespace, and two packages might both want a `port`. That is the same name used for a target's [settings](/concepts/configuration/#settings): a setting is just a default someone overrode, and the package does not know or care where the value came from. A dash works in a package name but never in a variable name, so `-` becomes `_`, as does the `.` a package name may contain. Names that collide this way are refused, rather than one silently winning. #### Types A variable may also say what shape its value has, with `type`: one of `string`, `boolean`, `number`, `list` or `map`. A list whose entries are mappings describes them with `items.fields`: ```yaml variables: repos: summary: Repositories cloned into ~/dev/. type: list default: [] items: fields: name: {summary: The folder under ~/dev., required: true} url: {summary: Where it is cloned from., required: true} branch: {summary: The branch to check out.} ``` A field is a `string` unless it says `type: boolean` or `type: number`. One level of structure is all a field gets: a list of things needs it, and anything deeper would be a second configuration language. The type is checked on your computer, never on the machine. `workspaces edit` and `machines edit` refuse a `--set` that does not fit, `sync` refuses a setting that does not fit before it reaches the machine, and `packages validate` refuses a default that does not fit its own type. That is the whole reason for a type: without one, a mistyped field such as `nmae:` is carried to the machine and fails in Ansible halfway through a sync, or worse, is quietly ignored by the role. ```console $ devmachine workspaces edit alice --set 'workspace.repos=[{name: app}]' error: workspace.repos[0]: "url" is required ``` A variable without a `type` takes any value, as every variable did before types existed. Older CLIs ignore `type` and `items`, so a package that relies on the check should also raise `requires.cli` to the release that brought it. ### `credentials` What the package's tool needs to authenticate, **and how to get it** — how belongs here because the package is the only thing that knows. Each entry has a `name`, a `kind`, and a `scope` (`machine` or `workspace`), plus what its kind needs: | `kind` | also needs | what it means | | --- | --- | --- | | `manual` | `command`, `stored_at` | A person runs `command`; the tool leaves its session at `stored_at`. | | `secret` | `env` or `path` | A value handed over once, delivered there. | | `file` | `path` | A file placed on the machine at that path. | ```yaml credentials: - name: claude kind: manual scope: workspace command: claude /login stored_at: ~/.claude/.credentials.json ``` `stored_at` is a claim, not a guarantee — it is what lets `doctor` check whether the login worked. A `manual` credential can also say `shareable: true`: a copy of `stored_at` works on another account, the way one GitHub login can serve every workspace. This is a fact about the tool, found by testing it — a session file copies fine, a token tied to one device or browser does not. Leave it out and it defaults to `false`. A credential recommending `scope: machine` must say `shareable: true`, since `scope: machine` means "one login, copied into every workspace" — recommending both without it asks for something the package itself says cannot work. A login that is shared needs a `stored_at` that starts with `~/`: each copy lands in a workspace's own home, and `sync` refuses any other path. See [Sharing a login](/how-it-works/sharing-a-login/). Only `manual` can be `shareable`. A `secret` or `file` is delivered fresh to each place that needs it, never copied, so `shareable` on either is refused. `scope` here is only a recommendation — whether a shareable credential is actually shared is the operator's own choice, per workspace — see [Configuration](/concepts/configuration/). ### `requires_files` Files that must already be on the machine before the package runs. ### `skills.path` A package can ship complete Agent Skill directories: ```yaml skills: path: skills ``` The path is relative to the package root, and cannot contain `..`, be absolute, or escape through a symlink. Each direct child must be a lower-case, dash-separated skill directory with a `SKILL.md`, whose frontmatter `name` matches the directory and `description` is not empty. This does not replace the Ansible role — a package with skills still has `tasks/main.yml`, and may also have defaults, handlers, files and templates. ### `widgets` A package can ship widgets for the app: ```yaml requires: {cli: ">= 0.9.0"} widgets: widgets ``` The path is relative to the package root and cannot leave it. Each folder directly inside it that holds a `widget.yml` is one widget, named `/`. See [the widget format](/reference/widget-format/). A CLI before 0.9.0 ignores `widgets:`, so a package that uses it needs a `requires.cli` that refuses those CLIs, such as `">= 0.9.0"`. A package with only widgets is still an Ansible role: its `tasks/main.yml` can be an empty list. ### `kind`, `entrypoint`, `commands` A package can ship an executable the CLI calls on the machine: ```yaml kind: dns entrypoint: bin/provider commands: [zones, list, upsert, append, delete, help] ``` - `entrypoint` is a path inside the package. It must exist, be executable, and start with `#!/usr/bin/env python3` — Ansible already needs Python on any machine this CLI sets up. - `commands` lists what it accepts: names, or `["*"]` for anything. Mixing `"*"` with named commands is refused. - `kind` is a contract. The only one so far is `dns`, which must accept `zones`, `list`, `upsert`, `delete` and `help`; `append` is what lets `dns add --append` work through it. See [the DNS provider contract](/reference/dns-provider-contract/). `devmachine run --package -- ` calls the entrypoint on a machine, and refuses a command that is not in `commands`. A widget reads the commands listed under `providers`. ### `providers` A package can let widgets read some of its commands. Each one prints one JSON object: ```yaml entrypoint: bin/devmachine-app commands: [context, stats] providers: stats: returns: disk: object load: object errors: list note: string? min_every: 10s ``` - Each key is a command, and must be one of `commands` (any name, when `commands` is `["*"]`). A widget names it `/`, here `devmachine-app/stats`. - `returns` lists the fields of the JSON object: `string`, `number`, `bool`, `list` or `object`, with `?` after the type when the field may be missing. It is required. Written on one line between `{` and `}`, a type with `?` needs quotes: `{note: "string?"}`. - `min_every` is how often a widget may run the command at most, at least `5s`. It is required. - A package with `providers` needs an `entrypoint`. The app runs the command through `devmachine run --package --machine --no-log -- -- …`, one `-- ` pair per key of the widget's `with`, keys sorted. A value that starts with `-` still arrives as the value after its `--`; the command reads its own arguments. See [the widget format](/reference/widget-format/#package-providers). ### `network` A machine package can answer for a private network's host entries: ```yaml network: prefix: tailscale # hosts entries written tailscale: belong here resolve: bin/resolve # runs on your computer: name in, IP addresses out join: bin/join # runs on the machine, for `devmachine login ` self_name: bin/self-name # runs on the machine: prints its name on the network ``` - `prefix` is lower case letters, digits and dashes, starting with a letter. It is what a `hosts` entry is written with: `:`. - `resolve` is required. `join` and `self_name` come together or not at all: a login that joins has to learn the name it joined under. - Each script is a path inside the package, executable, and starts with `#!/usr/bin/env python3`, like an entrypoint. - Only a `scope: machine` package can declare it: a network joins the machine, not one account on it. What each script receives and must print is in [the network package contract](/reference/network-package-contract/). ### `bootstrap` A machine package can carry the script that prepares a machine for Ansible, where the CLI has no package manager it can drive by itself — a Mac, through `mac-brew` or `mac-ports`: ```yaml name: mac-brew platforms: [macos] requires: cli: ">= 0.8.0" bootstrap: bin/bootstrap ``` - It is a path inside the package, and executable. - It is POSIX `sh`, not Python: it runs before Ansible, and before the Python that Ansible brings. So it is not held to the Python shebang an entrypoint is. - Only a `scope: machine` package can declare it: it prepares the machine, not one account on it. - Set `requires.cli` to the first CLI release that runs it. An older CLI ignores a field it does not know, so `requires.cli` is what stops it from syncing that machine half-way. ## The rules, and what each one says | Rule | The message | | --- | --- | | `format` missing | ``every package needs `format`, and this CLI reads 1`` | | `format` unreadable | `format 99, and this CLI reads 1. Upgrade with brew upgrade devmachine` | | `name` missing | ``every package needs a `name` `` | | `name` malformed | `name "X": use lower case letters, digits, dashes and underscores` | | `name` is not the directory | `name is "X" but the directory is "Y": a package is found by its directory` | | `scope` unknown | `scope must be "machine" or "workspace", got "X"` | | `summary` missing | ``every package needs a one-line `summary` `` | | `requires.cli` unreadable | `requires.cli "X": write it as ">= 0.2.0", "> 0.2.0" or "= 0.2.0"` | | `platforms` has an unknown value | `platform "X": the platforms are "linux" and "macos"` | | `platforms` lists one twice | `platform "X" is listed twice` | | `extends` key has no dot | `an extension point is written .` | | `extends` file is not there | `extends "X" points at Y, which is not in the package` | | `provides` path is relative | `an extension point is an absolute path on the machine` | | no `tasks/main.yml` | `a package is an Ansible role, so it needs tasks/main.yml` | | the `apt` module is used | ``the apt module is not allowed; use `package` so this works beyond Debian`` | | a credential says too little | one line per credential, naming it and what it is missing | | a `machine` login is not `shareable` | ``credential "X" recommends `scope: machine`, so it needs `shareable: true` `` | | a `secret` or a `file` is `shareable` | ``credential "X" is a secret, so it cannot be `shareable` `` | | an entrypoint is not executable | `entrypoint "X" is not executable: chmod +x it` | | an entrypoint is not Python 3 | `entrypoint "X" starts with "Y": it is Python 3 and starts with #!/usr/bin/env python3` | | `network` on a workspace package | ``network` belongs to a machine package`` | | `network.prefix` missing or malformed | `network.prefix "X": use lower case letters, digits and dashes, starting with a letter` | | `network.resolve` missing | `network.resolve is required` | | `join` without `self_name`, or the reverse | `network.self_name is required beside network.join` | | a network script outside the package | `network.resolve "X" must stay inside the package` | | a network script missing, not executable or not Python 3 | the same messages as an entrypoint, naming the field | | `bootstrap` on a workspace package | ``bootstrap` belongs to a machine package`` | | `bootstrap` outside the package | `bootstrap "X" must stay inside the package` | | `bootstrap` missing or not executable | `bootstrap "X" is not in the package`, `bootstrap "X" is not executable: chmod +x it` | | `kind` or `commands` with no entrypoint | ``kind` and `commands` describe an `entrypoint`, and this package declares none`` | | `widgets` with a `requires.cli` an older CLI meets | `a package with widgets needs requires.cli above 0.8.1, the last CLI that ignores them` | | `widgets` outside the package | `widgets "X" must stay inside the package` | | `widgets` folder missing or empty | `the widgets folder is not there`, `the widgets folder holds no folder with a widget.yml` | | `providers` without an `entrypoint` | `` `providers` are commands of an `entrypoint`, and this package declares none `` | | a provider that is not a command | `provider stats is not one of commands: add it to commands, or remove the provider` | | a `returns` type it does not know | `provider stats returns.errors is "array": the types are string, number, bool, list, object, each with ? when optional` | | `returns` missing or empty | `provider stats says what it returns: returns: {: }` | | `min_every` missing, unreadable or below 5s | `provider stats min_every 2s is below the 5s floor` | | a widget is wrong | the widget's own message, at `widgets//widget.yml` and its line; see [the widget format](/reference/widget-format/#the-rules-and-what-each-one-says) | `devmachine packages validate` reports every problem at once, not just the first. ## Why `apt` is refused A package that calls `apt` only works on Debian. `package:` picks the machine's own package manager instead, turning a rule people have to remember into an error the validator catches. --- # https://mydevmachine.sh/reference/dns-provider-contract/ What a DNS provider's entrypoint is called with, and what it must answer back. Follow this page and the CLI works with your provider on the first try; guess, and it does not. `devmachine packages new --scope machine --kind dns` writes an entrypoint that already follows this contract, with placeholders to replace rather than writing one from nothing. ## How it is called ``` list|upsert|append|delete ``` `` is the package's `entrypoint`, for example `bin/provider`. The command is `argv[1]`, the zone is `argv[2]`. `zones` and `help` take no zone: ``` zones help ``` `zones` answers which zones the credential can see, so the CLI can work out which registrar holds a name. A provider that cannot answer it can never be chosen. ```json {"zones": ["example.com", "example.net"]} ``` `help` answers what the entrypoint accepts, and is what `devmachine packages help ` prints. Leave `args` out for a command that takes none. ```json {"commands": [ {"name": "zones", "summary": "The zones this token can see."}, {"name": "list", "summary": "Every record in a zone.", "args": ""}, {"name": "upsert", "summary": "Make a name hold exactly one value.", "args": ""}, {"name": "append", "summary": "Add one value next to the ones a name holds.", "args": ""}, {"name": "delete", "summary": "Remove one value from a name.", "args": ""}, {"name": "help", "summary": "This list."} ]} ``` Both `zones` and `help` are required. A manifest listing a command its entrypoint actually refuses is a lie no validator can catch. ## What it receives `list` takes nothing beyond the zone. `upsert`, `append` and `delete` take one record as JSON **on stdin**: ```json {"name": "www", "type": "A", "value": "198.51.100.10", "ttl": 300} ``` - `name` is a **label**, never a full name: `www`, or `@` for the apex (the root domain of your server). The provider adds the zone itself. - `ttl` of `0` means "choose": use whatever the registrar defaults to. - `type` is one of `A`, `AAAA`, `CNAME`, `TXT`, `MX`, `SRV`, `NS`, `CAA`. - `value` is written the way a zone file writes it, and the CLI has already checked and normalised it: | Type | Value | Example | | --- | --- | --- | | `MX` | ` ` | `10 mail.example.com` | | `SRV` | ` ` | `10 5 5060 sip.example.com` | | `CAA` | ` ""` | `0 issue "ca.example.net"` | | the rest | the content itself | `198.51.100.10` | Host names arrive in lower case with no trailing dot. A registrar that keeps a priority, a port or a CAA tag in a field of its own splits the value on the way in and joins it on the way out, so `list` prints the same spelling `upsert` was given. Comparing a value the registrar stores (`10 mail.example.com.`) with one the CLI sends is the provider's job too. An SRV `name` is the whole owner label, `_sip._tcp` or `_sip._tcp.voice`. A registrar that stores the service and protocol apart from the name splits it. ## What it must print On success, one JSON document on stdout: - `list` → `{"records": [{"name": "...", "type": "...", "value": "...", "ttl": 300}, ...]}` - `upsert`, `append` and `delete` → `{}` ## What a failure looks like Exit non-zero, and print one JSON document on stdout: ```json {"error": {"kind": "zone_not_found", "message": "no zone answers for example.com"}} ``` `kind` must be one of exactly these: | `kind` | When | | --- | --- | | `zone_not_found` | The zone does not exist, or the token cannot see it. | | `unauthenticated` | The token was rejected. | | `forbidden` | The token can see the zone but cannot change it. | | `invalid_record` | The record was rejected — a bad type, a bad value, a name the registrar refuses. | | `rate_limited` | The registrar's API is throttling this token. | | `ambiguous` | The name holds several values and the request does not say which one. | A `kind` outside this list is treated as a bug in the provider, not a new kind the CLI learns. ## What the environment holds Whatever `/etc/devmachine//env` sets for this provider's credential, exported, **and nothing else the CLI adds**. A provider reading a variable its own credential does not declare will work by accident on one machine and break everywhere else. ## Where and as whom it runs On the machine, as root, from `/opt/devmachine/roles//`. Its working directory is not guaranteed — use absolute paths, never a path relative to the entrypoint's location. ## The rules that matter most - `upsert` makes the name hold **exactly** that one value — adding to what is already there is wrong, even if the registrar's API makes that the easy path. - `append` adds that one value next to whatever the name and type already hold, and never removes or changes the others. A value that is already there is left alone, so the call is safe to repeat. With a `ttl`, the set's TTL becomes that value where the registrar keeps one TTL per set; without one, the set keeps its own. - `delete` removes exactly that one value, leaving every other value at that name untouched. - A package that predates `append` leaves it out of `commands`. The CLI then refuses `dns add --append` for that provider before running anything, and says to update the package. - An empty `value` on either call means the whole set, not a value that happens to be an empty string. ## Python 3, standard library only Ansible already needs Python on any machine this CLI sets up, so an entrypoint with no extra dependencies always works. No `requests`, no `pip install`, no shelling out to `jq` — a provider needing a package the machine lacks fails during `sync`, far from where that dependency was declared. `format: 1` in `package.yml` lets an older CLI refuse a package it cannot read cleanly. Leave the number the skeleton already put there. ## Never retry a rate limit A provider that hits a rate limit reports `rate_limited` and stops. Retrying inside the entrypoint hides how throttled the registrar really is, and can turn one slow request into a hang with no visible cause. --- # https://mydevmachine.sh/reference/network-package-contract/ A network package makes a private network reachable through devmachine without the CLI knowing the product. It declares a [`network:` block](/reference/package-format/#network) and ships up to three scripts. This page says what each one gets and what it must give back. Every script is Python 3 with no dependencies beyond the standard library, and must run on Python 3.9: that is what macOS ships, and `resolve` runs on your computer. Every script gets the machine's settings for its package as one JSON object in the `DEVMACHINE_SETTINGS` variable: each variable the package declares, with its default, and any `.` setting of the machine on top. ```json {"exit_node": false, "login_server": "https://net.example.com"} ``` ## `resolve` Runs **on your computer**, every time something needs the machine's addresses: a connection, `devmachine resolve`, an SSH alias. - **Argument:** the name, as written after the prefix. `tailscale:main` gives `main`. It is an argument, never part of a shell line. - **Output:** the machine's IP addresses on standard output, one per line, in the order to try them. Anything that is not an IP address is refused. - **Exit 0:** the addresses are good. - **Exit 3:** the network is not reachable from here — the app is not installed, not running, or not signed in. Print why on standard error in a few words (`tailscale is not running`). The entry is skipped, not reported as a failure. - **Any other exit:** something is wrong with the script or the network. The entry is skipped too, and standard error is shown as the reason. - **Time:** 5 seconds, then it is stopped and skipped. It runs from the package's own folder on your computer: the pinned release a sync downloaded, or `/packages//`. ## `join` Runs **on the machine**, as its admin account, for `devmachine login `, in a real terminal (`ssh -t`). It does whatever signing in to the network takes: printing a URL to open, reading an auth key, calling the network's own command. Exit 0 when the machine joined. It runs from where `sync` put the package: `/opt/devmachine/roles//` for a published package, or `/opt/devmachine/roles.local//` for one from your own `packages/`. So the package has to be synced before `login`. ## `self_name` Runs **on the machine**, as its admin, right after `join` succeeds. It prints the name the machine answers to on the network, on one line: letters, digits, dots, dashes and underscores. devmachine adds `:` as the first entry of the machine's `hosts` in `config.yml`, unless it is already there. The public address stays as a fallback. If it fails, or prints something that cannot be a host entry, the login still counts, and devmachine prints the `hosts:` block to paste by hand. ## An example The `tailscale` package in the packages repository is the reference: `resolve` reads `tailscale status --json` on your computer, `join` runs `tailscale up` with `--login-server` when `tailscale.login_server` is set, and `self_name` reads the machine's own `tailscale status --json`. --- # https://mydevmachine.sh/reference/widget-format/ A widget is a folder in a package with one file in it, `widget.yml`. It says where the data comes from and how the app draws it. There is no code in a widget. See [Widgets](/concepts/widgets/) for what a widget is, and [why widgets come from packages](/how-it-works/widgets-come-from-packages/). ## The layout ``` my-package/ package.yml widgets: widgets tasks/main.yml widgets/ usage/ widget.yml ``` `package.yml` names the folder with [`widgets:`](/reference/package-format/#widgets). Each folder directly inside it that holds a `widget.yml` is one widget. Its full name is `/`, for example `claude-code/usage`. ## `widget.yml` ```yaml format: 1 name: usage summary: Coding-agent usage windows. requires: {engine: ">= 1.0"} fits: [canvas, stack, slot] context: {} inputs: harness: {type: string, default: claude, summary: Which coding agent.} source: kind: provider name: app/harness-usage with: {harness: "{{inputs.harness}}"} every: 60s view: {kind: app.harness-usage} sizes: [small, medium, wide] default_size: medium places: [home] ``` | Field | Required | What it is | | --- | --- | --- | | `format` | yes | The shape of this file. This CLI reads format 1. | | `name` | yes | The folder's name: lower case letters, digits and dashes. | | `summary` | yes | One line. It is what `widgets list` prints. | | `requires.engine` | yes | The engine versions the widget works with, as `">= 1.0"`, `"> 1.0"` or `"= 1.0"`. | | `fits` | yes | The layouts it can be drawn in: `canvas`, `stack`, `slot` (the menu bar), `tabs` (the menu bar popover). | | `context` | no | The context keys it reads, each `required` or `optional`. A widget sees only the keys it declares. | | `inputs` | no | Values a person sets on each copy: `type` (`string`, `number`, `boolean` or `choice`), `default`, `summary`. A choice also takes `from` and `many`: see [Choice inputs](#choice-inputs). | | `source` | yes | Where the data comes from: `kind` and the fields of that kind. See [Sources](#sources). | | `view` | yes | How it is drawn: `kind` and that view's fields. See [Views](#views). | | `sizes` | yes | The presets it takes. | | `default_size` | yes | The preset a new copy gets. One of `sizes`. | | `places` | no | Areas the app adds it to once, the first time it is available. Each must be an area the widget fits. Removing it from there is final. | | `single` | no | `true`: a board holds it at most once. The app's workspace list is one. | A value in `source.with` can hold `{{inputs.}}` or `{{context.}}`. The input or key it names has to be declared. ### Choice inputs A `choice` input is picked from a list the app fills from live data, so the app can offer a checklist or a picker on any widget without knowing the widget: ```yaml inputs: machines: {type: choice, from: machines, many: true, summary: Which machines; none shows all.} ``` - `from` says where the options come from: `machines` (the machines in `config.yml`), `workspaces` (the workspaces in `config.yml`) or `harnesses` (the coding agents that report usage: `claude`, `codex`). - `many: true` makes the value a list of names; left out, or `[]`, it means all of them. Without `many` the value is one name; left out, it means the first option. - A template sees a list joined with commas (`main,backup`), and so does `$DM_INPUT_` in a shell line. An `app/…` provider gets the list itself. - A widget with a choice input needs `requires.engine: ">= 1.5"`: an older app cannot show the choices. ## Sources `source.kind` picks one of five kinds. A key that belongs to another kind is a mistake, for example `source.url is not a field of a command source`. ### `provider` Data the app already has: the clock, your sessions, your machines, coding agent usage. `name`, `with` (the provider's arguments) and `every` (at least the provider's minimum). It works without adding its package. An app provider (`app/…`) takes no `target` and no `timeout`: it is the app's own data. A provider can also be a package's own command, written `/` — see [package providers](#package-providers) below. #### Package providers A package can let its widgets read one of its own commands, declared under `providers` in its `package.yml` (see [the package format](/reference/package-format/#providers)): ```yaml requires: {engine: ">= 1.3"} inputs: machine: {type: string, summary: Which machine.} source: kind: provider name: devmachine-app/stats with: {path: /} target: {machine: "{{inputs.machine}}"} every: 60s view: {kind: gauge, value: "{{json.disk.used_percent}}", unit: "%"} ``` - `name` is `/`. A widget in a package reads only that package's own providers. A widget written in a board reads any package's. - `target` is required, `{machine: }` or `{workspace: }`. A package's command runs on a machine, never on your computer, so `local` is refused. - `every` is at least the provider's `min_every`, or `manual`. - `with` becomes arguments after the command, one `-- ` pair per key, keys sorted: the widget above runs `stats --path /`. A key is lower case letters, digits, dashes and underscores; a value is any text, and may hold `{{inputs.x}}` or `{{context.x}}`. - `timeout` stops a run that takes longer, default `30s`, at most `10m`. - The answer is one JSON object, read like `parse: json`: draw it with a view that takes `json`, and pick the value with `view.value`. - `requires.engine` must refuse engine 1.2, which cannot run it. - The package has to be added to that machine or workspace and synced; until then `widgets list` names the command to add it. ### `command` ```yaml source: kind: command run: df args: [-h, /] target: {machine: "{{inputs.machine}}"} every: 60s parse: text ``` - `run` is one program, or `script` is a file: one of the two. In a package widget `script` is relative to `package.yml` and must stay in the package, and every account must be able to run it (`chmod 755`): on a workspace it runs as that workspace's account. In a widget written in a board it is an absolute path on the target. - `args` are passed to the program one by one; no shell reads them, so a space or a `;` in one is just a character. A `run` with spaces is refused: put the arguments in `args`, or set `shell: true`, and `run` becomes a shell line. - `run` never holds a template: a value must not pick the program, and a value written into a shell line would run as code. Without a shell, put templates in `args`. For a program that takes options, put `--` before a templated argument (`args: [--, "{{inputs.path}}"]`), so a value that starts with `-` is not read as an option. - A shell line takes no `args`. It reads each value from an environment variable the app sets: `DM_INPUT_` or `DM_CONTEXT_` followed by the name in upper case, with any character other than A–Z and 0–9 turned into `_`. So `inputs.max_lines` is `$DM_INPUT_MAX_LINES`, and `context.workspace` is `$DM_CONTEXT_WORKSPACE`. An input name holds only lower case letters, digits and `_`, so no two inputs share a variable. Write it in double quotes: `run: 'tail -n "$DM_INPUT_MAX_LINES" /var/log/syslog'`. The shell never reads the value as code, unless you hand it to a program that does: `eval`, `sh -c`, `ssh …`, `awk`, `xargs`, `perl -e`, `python -c` — or bash arithmetic: `$(( ))`, `(( ))`, `let`, `[[ … -gt … ]]` and `declare -i` run a value such as `a[$(id)]` as a command. That is your own line's code, so keep values out of those. `/bin/sh` on a Mac is bash, so the arithmetic rule applies there too: check that a value is a number with `case` or `[ … ]` first, as in `case $DM_INPUT_MAX_LINES in ''|*[!0-9]*) exit 1;; esac`. - A context key's variable holds text: a `machine`, `workspace` or `session` key holds its name, a `repo` key holds `owner/name`, and a `path` or `string` key holds the value itself. - Without a shell, `run` cannot start with `-` or hold `=`: it would read as an option or a variable to set, not a program. - `target` is `local` (the computer the app runs on, the default), `{machine: }` or `{workspace: }`. A machine or a workspace is reached through `devmachine run --no-log`; the app never opens its own SSH. Widget runs always use `--no-log`: their values would otherwise land in [the command log](/reference/commands/#the-command-log). - `every` is how often: a duration of at least `5s`, or `manual` for a ▶ button. `timeout` is `30s` unless you say otherwise, at most `10m`. - `parse` says how the output is read: `text`, `lines`, `number`, `json` or `ansi` (text with colours). A non-zero exit or output that does not parse is an error; the widget keeps its last good value and shows why. - `mode: stream` runs a command that keeps printing, such as `tail -f`, while the widget is on screen. It takes no `every` and no `timeout`, parses `text`, `lines` or `ansi`, and keeps the last `keep` lines (200 by default, at most 2000). ### `url` ```yaml source: {kind: url, url: "https://example.com/health", every: 30s, parse: status} ``` A GET request. `parse` is `status` (the HTTP code and how long it took, the default), `text` or `json`. `every` at least `5s`; `timeout` as for a command. A url widget works without adding its package: it installs nothing and runs nothing on a machine. ### `prompt` ```yaml source: kind: prompt harness: claude prompt: Summarise what changed in the repository today. target: {workspace: alice} ``` Asks a coding agent, `claude` or `codex`, without a conversation, on the target, and shows the answer as Markdown. `every` is `manual` unless you set one, at least `5m`: every run costs tokens. `timeout` is `5m` by default. Only one run of a widget happens at a time. `permission_mode` sets what the coding agent may do while it answers, such as search the web or change files, in the coding agent's own words. Leave it out and the coding agent runs as it does by default. ```yaml source: kind: prompt harness: claude permission_mode: auto prompt: Search the web for this week's Go release notes and summarise them. ``` | Coding agent | `permission_mode` | The app runs it as | | --- | --- | --- | | `claude` | `manual`, `dontAsk`, `plan`, `acceptEdits`, `auto`, `bypassPermissions` | `claude -p --permission-mode -- ` | | `codex` | `read-only`, `workspace-write`, `danger-full-access` | `codex exec … --sandbox -- ` | | `codex` | `approve-for-me`, `dangerously-bypass-approvals-and-sandbox` | `codex exec … -- -- ` | `bypassPermissions`, `danger-full-access` and `dangerously-bypass-approvals-and-sandbox` run without any check. A widget with one of them runs only when you press refresh: its `every` must be `manual`, which is the default for a prompt, and so must a board entry's `every`. A widget with `permission_mode` needs `requires.engine: ">= 1.6"`. See [a prompt widget's permission mode](/how-it-works/a-prompt-widgets-permission-mode/). ### `session` ```yaml source: {kind: session, target: {workspace: alice}, session: main, every: 2s} ``` A read-only copy of what a session's screen shows, read every `every` (at least `2s`). Draw it with the `terminal` view; a click opens the session in the app. ### Templates `{{inputs.}}` and `{{context.}}` can go in `args`, target names, `url`, `prompt` and `session`, never in `run` (a shell line reads them from `$DM_INPUT_…` and `$DM_CONTEXT_…` instead). The input or key has to be declared. `{{item}}` works only inside a list view's `item`. ## Views A view draws what a source gives. `devmachine widgets schema` lists which outputs each view takes; a view that cannot draw the source is refused. | View | Draws | Fields | | --- | --- | --- | | `text` | `text`, `lines`, `ansi` | `wrap` (true unless `false`), `tail` (last N lines, 1–2000) | | `number` | `number`, `json`, `app/open-pull-requests` | `value`, `unit`, `format`: `plain`, `percent`, `bytes`, `duration`; `hide_zero` (draw nothing at 0) | | `gauge` | `number`, `json` | `value`, `min` (0), `max` (100), `unit`, `warn`, `crit` | | `status` | `status`, `number`, `json`, `text` | `value`, `ok`, `warn` rules | | `list` | `lines`, `json` (an array) | `item: {title, subtitle, status, link}` | | `sparkline` | `number`, `json` | `value`, `unit`, `max`; the app keeps the last 120 points | | `markdown` | `text` (a prompt's answer, or any text) | none | | `web` | any `url` source; it loads the page itself | `zoom` (0.5–2, default 1) | | `terminal` | `ansi`, `text`, a `session` | `tail` | **Picking a value out of JSON.** With `parse: json`, `number`, `gauge`, `status` and `sparkline` need `value`, a template naming a field: `value: "{{json.disk.used}}"`. Without `parse: json`, `value` is refused. **Status rules.** `ok` and `warn` compare the value: `"< 300"`, `">= 99.5"`, `'== "up"'`, `'!= "down"'`. Text compares only with `==` and `!=`, so a source that gives text cannot use `<`, `<=`, `>` or `>=`. The first rule that holds picks the colour; none holding means failing. **List items.** Each line, or each element of a JSON array, is one item. `{{item}}` is the whole item; `{{item.name}}` reads a field of a JSON item. `title` is `{{item}}` unless you set it. **Web.** The page is loaded in a private browser store that keeps no cookies between launches, and reloaded on `every`. `source.parse` does nothing here and is refused. ## A board Where the widgets sit is a board: `/boards/.yml`. The app, the CLI and an agent all read and write it. ```yaml format: 1 surface: home widgets: - id: clock type: devmachine-app/clock frame: {x: 24, y: 24, w: 320, h: 160} size: medium minimized: false z: 1 ``` | Field | What it is | | --- | --- | | `id` | Unique on the board: lower case letters, digits and dashes. | | `type` | The widget, `/`. | | `with` | Values for the widget's inputs. Left out when there are none. A choice of many takes a list: `with: {machines: [main, backup]}`; `[]` means all. | | `title` | Optional, on an entry with a `type`: the title this copy shows instead of the widget's own. Never empty; take the key off to go back. | | `every` | Optional, on an entry with a `type`: how often this copy runs, as a duration (`2m`) or, for any source but a provider, `manual`. Never below what the widget's source allows (`devmachine widgets schema` lists each minimum), and not on a stream. | | `frame` | Position and size in points. `x` and `y` are 0 or more. `w` is at least the width of the smallest preset the widget takes. `h` is the same for a view that does not grow; a view that grows has no least height, only above zero. With `size: auto` the frame is `{x, y, w}` and `h` is left out (an `h` there is ignored and dropped on the next write). Without `auto`, `h` is required. | | `size` | A preset, `custom` after a free resize, or `auto`. Left out, it is `custom`. `auto` makes the widget as tall as what it shows, and only a view that grows takes it (`app.summary`, `app.machines`, `app.harness-usage`, `text`, `number`, `status`, `list`, `markdown`). On a view that grows, `custom` or a preset with an `h` is a cap: the widget is never taller than its content. See [why a widget is as tall as what it shows](/how-it-works/why-a-widget-is-as-tall-as-what-it-shows/). | | `minimized` | `true` draws a pill with the title instead. | | `z` | Higher is in front. | A `type` no package provides is not an error: the app keeps the entry and shows a placeholder, so a missing package never loses a layout. A widget can also be written in place, with no `type` and no package: see below. A widget has either a `type` or a `source` and a `view`, never both. A widget written in the board owns its `title`, and sets how often it runs in `source.every`; an `every` next to its `source` is refused. A key the board does not know, at the top, in a widget or in a `frame`, is a mistake, for example `unknown key "minimised" in a widget`. A typo is caught instead of being dropped on the next write. When the app or the CLI rewrites a board, comments in it are lost. ### A widget written in the board ```yaml - id: disk title: Disk on alice source: {kind: command, run: df, args: [-h, /], target: {workspace: alice}, every: 60s} view: {kind: text} sizes: [medium, wide] frame: {x: 24, y: 400, w: 320, h: 160} size: medium minimized: false z: 9 ``` It needs a `title`, a `source` and a `view`, and takes `sizes` (all the presets when left out) and `fits`. It has no `type`, no `with` and no inputs, so a template can only name a context key the board's area gives. A `script` is an absolute path on the target. Every source and view rule above applies. The app runs a `command`, `prompt` or `session` written in a board only after you press **Allow** on it, and asks again whenever it changes. See [why a widget an agent wrote waits for you](/how-it-works/why-an-agent-written-widget-waits/). ### A board in a sidebar The sidebar (`sidebar.yml`) and the Context tab (`context-sidebar.yml`) are stacks: a list, drawn top to bottom in the order it is written. A widget there has no `frame`, no `minimized` and no `z`. ```yaml format: 1 surface: context-sidebar widgets: - id: todo type: devmachine-app/todo size: auto - id: usage type: claude-code/usage size: medium collapsed: true ``` | Field | What it is | | --- | --- | | `id`, `type`, `with` | As on Home. A widget written in place (`title`, `source`, `view`) works here too. | | `size` | A preset the widget takes, or `auto`. In a sidebar a widget is as wide as the panel and each preset row is 40pt high (`medium` is 80pt, `large` 160pt). `auto` makes it as tall as what it shows, and only a view that grows takes it (the app's sidebar views). Left out, it is `auto` for a view that grows and the widget's `default_size` otherwise. A widget written in place has no `default_size`: the CLI accepts a missing `size` there and writes none, and the app draws it at the first preset in its `sizes`, or `medium` when it lists none. | | `collapsed` | `true` shows only its header, and nothing runs. Left out when false. | A widget fits a sidebar when `stack` is in its `fits`; a widget written in place fits every layout. A widget marked `single: true` appears once per board. When the file is missing, the app writes, and the CLI reads, these: ```yaml format: 1 surface: sidebar widgets: - id: workspaces type: devmachine-app/workspaces size: auto ``` and a `context-sidebar.yml` with, in this order, `shortcuts`, `publish-port`, `monitors`, `shells`, `sub-agents`, `todo`, `pull-requests`, `links` and `ask`, each `type: devmachine-app/` and `size: auto`. `ask` (engine 1.8) asks a question about the session without writing to it, through [`devmachine chat ask`](/reference/commands/#chat). It reads the area's `session`, `machine`, `workspace` and `harness`, and its provider `app/session-ask` returns the session's latest ask: `chat`, the record, and `messages`. A `context-sidebar.yml` written before engine 1.8 lists its widgets itself, so it does not gain `ask`: add it with `devmachine widgets add devmachine-app/ask --board context-sidebar`. A board that was never written uses the default and has it. ### A board in the menu bar The menu bar item is two boards, both lists drawn in the order they are written. `menubar.yml` is the title in the menu bar: at most 3 widgets, left to right, each one line. An entry there has only `id`, `type`, `title`, `with` and `every` (or `title`, `source` and `view` when written in place): no `frame`, `size`, `minimized`, `collapsed` or `z`. Only four views draw there: `text` (its first line, cut at 24 characters with "…"), `number` (`hide_zero: true` draws nothing at 0), `status` (a dot and its label) and `app.brand` ("❯_"). A widget fits it when `slot` is in its `fits` and its view is one of those. Its widgets run while the app runs, with or without a window, and never more often than every 30s: a shorter `every` is raised to 30s. ```yaml format: 1 surface: menubar widgets: - id: brand type: devmachine-app/brand - id: open-pull-requests type: devmachine-app/open-pull-requests ``` `menubar-panel.yml` is the popover that opens when you click it: each widget is one tab, titled with the widget's title. A tab fills the popover, so a `size` there is kept but ignored, and `widgets validate` warns about it; `frame`, `minimized`, `collapsed` and `z` are refused. A widget fits it when `tabs` is in its `fits`. Its widgets run only while the popover is open. The footer (Open, Stats, Published apps, the color picker, Quit) is not a widget. ```yaml format: 1 surface: menubar-panel widgets: - id: pull-requests-panel type: devmachine-app/pull-requests-panel - id: usage-panel type: devmachine-app/usage-panel ``` A widget in the menu bar that waits for your approval shows "!" in its place; its Allow card is in the popover, under an Approvals tab. When either file is missing, the app writes, and the CLI reads, the two boards above: they draw the menu bar as it always looked, "❯_" and the open pull request count, and the Pull Requests and Usage tabs. ## What the engine offers `devmachine widgets schema --json` prints all of this as JSON. Engine **1.8**. Widget format 1, board format 1. ### Sizes One unit is 80pt; positions and free resizes snap to 8pt. One preset row in a sidebar is 40pt high, and a widget there is as wide as the panel. `size: auto` makes a view that grows as tall as what it shows. On Home it does the same, and the frame has no `h`. The menu bar holds at most 3 widgets, left to right, each one line drawn by one of the views `text`, `number`, `status`, `app.brand`. Text shows its first line, cut at 24 characters. A widget there runs at most every 30s. A tab in the menu bar popover fills it, so a `size` there is ignored. | Preset | Units | Points | | --- | --- | --- | | `small` | 2×2 | 160×160 | | `medium` | 4×2 | 320×160 | | `tall` | 2×4 | 160×320 | | `large` | 4×4 | 320×320 | | `wide` | 8×2 | 640×160 | ### Areas | Area | Layout | Status | Context it gives | | --- | --- | --- | --- | | `context-sidebar` | stack | available | `branch` (string, optional), `harness` (string, optional), `machine` (machine, always), `path` (path, optional), `repo` (repo, optional), `session` (session, always), `workspace` (workspace, optional) | | `home` | canvas | available | none | | `menubar` | slot | available | none | | `menubar-panel` | tabs | available | none | | `sidebar` | stack | available | `selected` (workspace, optional) | ### Context types | Type | Fields | | --- | --- | | `machine` | `name` string | | `path` | none | | `repo` | `name` string, `owner` string | | `session` | `harness` string?, `kind` string, `name` string | | `string` | none | | `workspace` | `machine` machine, `name` string, `path` path, `user` string | ### Inputs | Type | Fields besides `type`, `default` and `summary` | A board's `with` value | | --- | --- | --- | | `boolean` | none | bool | | `choice` | `from` enum, required, harnesses/machines/workspaces; `many` bool, default `false` | string, or a list of strings when many | | `number` | none | number | | `string` | none | string | A choice takes its options from `harnesses` (claude, codex), `machines` (the machines in config.yml), `workspaces` (the workspaces in config.yml). An entry with a `type` may also set `every` every; `title` string on a board: they change only that copy. ### Providers | Provider | Arguments | Context it needs | Minimum `every` | Returns | | --- | --- | --- | --- | --- | | `app/brand` | none | none | 5s | `mark` string | | `app/clock` | none | none | 5s | `date` string, `host` string, `time` string | | `app/harness-usage` | `harness` string, required | none | 5s | `error` string?, `harness` string, `windows` list | | `app/machines` | `machines` list, optional | none | 5s | `list` machine_stats | | `app/open-pull-requests` | none | none | 5s | `count` number | | `app/publish-port` | none | none | 5s | `available` bool | | `app/pull-requests-panel` | none | none | 5s | `error` string?, `owners` list, `pull_requests` list | | `app/session-ask` | none | `session` required | 5s | `chat` object?, `messages` list | | `app/session-context` | none | `session` required | 5s | `agents` list, `cwd` path, `harness` string?, `links` list, `monitors` list, `plan` plan?, `prs` list, `shells` list | | `app/shortcuts` | none | `session` required | 5s | `shortcuts` list | | `app/summary` | none | none | 5s | `harness_sessions` int, `sessions` int, `workspaces` int | | `app/usage-panel` | none | none | 5s | `harnesses` list | | `app/workspaces` | none | none | 5s | `workspaces` workspace_sessions | ### Package providers A package declares providers in its `package.yml`; a widget names one `/`. `app/…` is the app's own. It runs on a machine or a workspace, never on your computer, and its answer is one JSON object, read like `parse: json`. Each `with` key becomes `-- ` after the command, keys sorted. Its `min_every` is at least 5s, and `returns` types are string, number, bool, list, object, with `?` for an optional field. Its widgets wait for approval when the package is third-party. ### Source kinds | Kind | Minimum `every` | Waits for approval in a board | Fields besides `kind` | | --- | --- | --- | --- | | `provider` | the provider's | no | `every` every, required; `name` provider, required; `target` target; `timeout` duration, default `30s`, max 10m; `with` args | | `command` | 5s | yes | `args` list; `every` every; `keep` int, default `200`, min 1, max 2000; `mode` enum, poll/stream, default `poll`; `parse` enum, text/lines/number/json/ansi, default `text`; `run` string; `script` path; `shell` bool, default `false`; `target` target, default `local`; `timeout` duration, default `30s`, max 10m | | `url` | 5s | no | `every` every, required; `parse` enum, status/text/json, default `status`; `timeout` duration, default `30s`, max 10m; `url` url, required | | `prompt` | 5m | yes | `every` every, default `manual`; `harness` enum, required, claude/codex; `permission_mode` enum-by-harness, claude: manual/dontAsk/plan/acceptEdits/auto/bypassPermissions, codex: read-only/workspace-write/danger-full-access/approve-for-me/dangerously-bypass-approvals-and-sandbox, dangerous: bypassPermissions/danger-full-access/dangerously-bypass-approvals-and-sandbox; `prompt` string, required; `target` target, default `local`; `timeout` duration, default `5m`, max 10m | | `session` | 2s | yes | `every` every, required; `session` string, required; `target` target, default `local` | ### Views | View | Draws | Drawn in | Fields besides `kind` | | --- | --- | --- | --- | | `app.ask` | `app/session-ask` | stack; grows with its content | none | | `app.brand` | `app/brand` | slot | none | | `app.clock` | `app/clock` | canvas, stack, tabs | none | | `app.harness-usage` | `app/harness-usage` | canvas, stack, tabs; grows with its content | none | | `app.links` | `app/session-context` | stack; grows with its content | none | | `app.machines` | `app/machines` | canvas, stack, tabs; grows with its content | none | | `app.monitors` | `app/session-context` | stack; grows with its content | none | | `app.publish-port` | `app/publish-port` | stack; grows with its content | none | | `app.pull-requests` | `app/session-context` | stack; grows with its content | none | | `app.pull-requests-panel` | `app/pull-requests-panel` | canvas, stack, tabs | none | | `app.shells` | `app/session-context` | stack; grows with its content | none | | `app.shortcuts` | `app/shortcuts` | stack; grows with its content | none | | `app.sub-agents` | `app/session-context` | stack; grows with its content | none | | `app.summary` | `app/summary` | canvas, stack, tabs; grows with its content | none | | `app.todo` | `app/session-context` | stack; grows with its content | none | | `app.usage-panel` | `app/usage-panel` | tabs | none | | `app.workspaces` | `app/workspaces` | stack; grows with its content | none | | `gauge` | `number`, `json` | canvas, stack, tabs | `crit` number; `max` number, default `100`; `min` number, default `0`; `unit` string; `value` template; `warn` number | | `list` | `lines`, `json` | canvas, stack, tabs; grows with its content | `item` object (`link` template; `status` template; `subtitle` template; `title` template, default `{{item}}`) | | `markdown` | `text` | canvas, stack, tabs; grows with its content | none | | `number` | `number`, `json`, `app/open-pull-requests` | any layout; grows with its content | `format` enum, plain/percent/bytes/duration, default `plain`; `hide_zero` bool, default `false`; `unit` string; `value` template | | `sparkline` | `number`, `json` | canvas, stack, tabs | `max` number; `unit` string; `value` template | | `status` | `status`, `number`, `json`, `text` | any layout; grows with its content | `ok` rule; `value` template; `warn` rule | | `terminal` | `ansi`, `text`, `kind:session` | canvas, stack, tabs | `tail` int, min 1, max 2000 | | `text` | `text`, `lines`, `ansi` | any layout; grows with its content | `tail` int, min 1, max 2000; `wrap` bool, default `true` | | `web` | `kind:url` | canvas, stack, tabs | `zoom` number, default `1`, min 0.5, max 2 | ## The rules, and what each one says | Rule | The message | | --- | --- | | `format` is not 1 | `format 2, and this CLI reads widget format 1` | | `requires.engine` missing | `every widget needs requires.engine, for example ">= 1.0"` | | `requires.engine` unreadable | `requires.engine "X": write it as ">= 1.0", "> 1.0" or "= 1.0"` | | a newer engine is required | ``requires engine >= 1.9, and this CLI implements engine 1.8: update with `devmachine update` `` | | an unknown top-level field | `unknown field "X"` | | `name` malformed or not the folder | `name is "X" but the folder is "Y": a widget is found by its folder` | | `summary` missing | `every widget needs a one-line summary` | | `fits` empty or unknown | `fits "X": the layouts are canvas, stack, slot, tabs` | | `sizes` empty or unknown | `size "X": the presets are small, medium, tall, large, wide` | | `default_size` not in `sizes` | `default_size "X" is not one of sizes` | | `places` unknown | `places "X": the surfaces are context-sidebar, home, menubar, menubar-panel, sidebar` | | `places` names an area it does not fit | `places "sidebar": the widget does not fit that area, so the app would never place it there` | | `fits` names a layout its view is not drawn in | `fits canvas, and the app.todo view is drawn only in stack` | | a provider's context not declared | `source.name app/session-context needs context.session: declare context: {session: required}` | | `context` key no surface gives | `context key "X" is not given by any surface` | | `context` value other than required/optional | `context key "X" is "Y": write required or optional` | | input type unknown, or default of the wrong type | `input "X" has type "Y": the types are string, number, boolean, choice`, `input "X" is a string, and its default 3 is not` | | a choice without `from`, or an unknown one | `input "X" is a choice, and needs from: one of harnesses, machines, workspaces`, `input "X" takes its options from "Y", which is not a source: the sources are harnesses, machines, workspaces` | | `many` neither true nor false | `input "X": many is maybe: write true or false` | | a choice's default of the wrong shape | `input "X" is a list of choices, and its default main is not: write [a, b], or [] for all`, `input "X" is one choice, and its default [main] is not a name` | | `from` or `many` on another type | `input "X" is a string: from and many belong to a choice` | | a choice input on an engine below 1.5 | `a widget with a choice input needs requires.engine ">= 1.5": an app on engine 1.4 cannot show its choices` | | a board's `with` of the wrong shape for a choice | `machines: input "machines" takes a list of names, written [a, b], and main is not one`, `usage: input "harness" takes one name, and [claude, codex] is not one` | | an empty `title` on an entry | `usage: title is empty: write one, or take the key off to show the widget's own` | | an `every` on an entry that its source does not take | `usage: every 1s is below claude-code/usage's minimum of 5s`, `usage: every "often" is not a duration: …`, `usage: every manual: claude-code/usage reads a provider, which runs on a schedule: …`, `tail: a stream runs while the widget is on screen, so it takes no every`, `ask: permission_mode bypassPermissions runs without any check, so it runs only when you press refresh: write every: manual` | | an `every` on a widget written in the board | `disk: a widget written in the board sets how often in source.every, not every` | | template names something undeclared | `template {{inputs.X}} in source.with.Y needs inputs.X` | | `source.kind` unknown | `source.kind "X": engine 1.8 knows provider, command, url, prompt, session` | | a key of another kind | `source.url is not a field of a command source: it takes …` | | no `run`/`script`, or both | `a command source needs run or script`, `a command source has run or script, not both` | | `run` with spaces and no `shell: true` | `source.run "df -h /" has spaces: put each argument in source.args, or set shell: true …` | | a template in a `shell: true` line | `source.run is a shell line, so it cannot hold {{inputs.x}}: read it as "$DM_INPUT_X" instead` | | `args` with `shell: true` | `a shell line takes no source.args: write the words in source.run, and read values as $DM_INPUT_` | | a template in `run` without a shell | `source.run cannot hold {{inputs.x}}: a value must not pick the program — name the program in run, and put the value in source.args` | | `run` starting with `-` or holding `=`, no `shell: true` | `source.run "-df" starts with -: …`, `source.run "LANG=C" has =: …` | | `script` outside the package, or not runnable | `source.script "X": a package widget names a file inside its package …`, `… is not executable: run chmod +x on it` | | `every` missing, unreadable or too short | `a command source needs source.every …`, `source.every 1s is below the command minimum of 5s` | | `timeout` above 10m | `source.timeout 11m is above the 10m maximum` | | stream with `every`, `timeout` or a whole-output parse | `a stream runs while the widget is on screen: remove source.every` | | `keep` without a stream, or out of 1–2000 | `source.keep only applies to mode: stream` | | `target` malformed | `source.target "X": write local, {machine: } or {workspace: }` | | `parse`, `mode` or `harness` unknown | `source.parse "yaml": a command source takes text, lines, number, json, ansi` | | a `permission_mode` its coding agent does not have | `source.permission_mode "yolo": a claude prompt takes manual, dontAsk, plan, acceptEdits, auto, bypassPermissions` | | a mode with no checks on a timer | `permission_mode bypassPermissions runs without any check, so it runs only when you press refresh: write every: manual` | | `permission_mode` with an engine that allows 1.5 | `a widget with source.permission_mode needs requires.engine ">= 1.6": an app on engine 1.5 cannot run its prompt in that mode` | | `url` not a full address | `source.url "X": write a full address starting with https:// or http://` | | view does not draw the source | `view.kind "gauge" takes number, json, and this command source gives text` | | `source.name` unknown | `source.name "X" is not a provider engine 1.8 knows` | | `source.with` wrong | `source.with.X is not an argument of P`, `source.with.X is required by P` | | an app provider with target or timeout | `source.target: app/clock is the app's own data, so it takes no target` | | `source.every` missing, unreadable or too short | `source.every 1s is below the P minimum of 5s` | | a package widget reading another package's provider | `source.name claude-code/usage: a package widget reads only its own package's providers, written devmachine-app/` | | a provider the package does not declare | `source.name devmachine-app/context: devmachine-app has no provider context; its providers: stats` | | a package provider with no target, or `local` | `source.name devmachine-app/stats: a package provider runs on a machine or workspace: write source.target: {machine: } or {workspace: }` | | `every` below the provider's `min_every` | `source.every 5s is below the devmachine-app/stats minimum of 10s` | | a `with` key that is not lower case | `source.with.Path: devmachine-app/stats gets it as --Path, so write the key in lower case …` | | a package provider with an engine that allows 1.2 | `a widget reading a package provider needs requires.engine ">= 1.3": an app on engine 1.2 cannot run it` | | a widget outside any package reading a package provider | `source.name devmachine-app/stats: only a widget in a package, or one written in a board, reads a package provider` | | `view.kind` unknown, or draws another provider | `view.kind "app.clock" draws app/clock, not P` | | a view key that view does not take | `view.colour is not a field of the gauge view: it takes kind, …` | | JSON without `value`, or `value` without JSON | `view.value picks what to show out of the JSON …`, `view.value only applies when source.parse is json` | | a number field that is not a number or out of range | `view.warn is high, and it has to be a number`, `view.zoom 3 is above 2` | | `gauge` `max` not above `min` | `view.max 0 must be above view.min 0` | | `tail` out of 1–2000 | `view.tail 5000 is outside 1 to 2000 lines` | | `format` unknown | `view.format "hex": the number view takes plain, percent, bytes, duration` | | a status rule that does not read | `view.ok fine is not a rule: write it like "< 300" or '== "ok"'` | | a status rule comparing text by size | `view.ok "< 300" compares by size, and this url source gives text: use == or !=` | | `{{item.x}}` on lines, or an unknown item key | `template {{item.name}} in view.item.title reads a field, and only JSON items have fields` | | `web` with `source.parse` | `the web view loads the page itself: remove source.parse` | | a board widget with no `title`, `source` or `view` | `disk: a widget written in the board needs a title` | | a 4th widget in the menu bar | `the menubar holds 3 widgets: take one off` | | `frame`, `size`, `minimized`, `collapsed` or `z` in the menu bar | `brand: a widget in the menu bar has no size: it is one line of text` | | a view the menu bar does not draw | `usage: the app.harness-usage view cannot be drawn in the menu bar` | | `frame`, `z`, `minimized` or `collapsed` on a tab | `usage-panel: a tab in the menu bar popover has no frame; its place is its position in the list` | | `size` on a tab (a warning, not a problem) | `usage-panel: size is ignored in the menu bar popover: a tab fills it` | | a board widget with `with` or `{{inputs.x}}` | `disk: a widget written in the board has no inputs, so it takes no with` | | a board widget's `script` not absolute | `disk: source.script "bin/df": a widget written in a board names an absolute path on the target` | | a board widget's target is not in `config.yml` (checked by `widgets validate` only) | `disk: source.target names machine "X", which config.yml does not have` | | a sidebar widget with `frame` or `z` | `todo: a widget in a sidebar has no frame; its place is its position in the list` | | a sidebar widget with `minimized` | `usage: a widget in a sidebar folds with collapsed: true, not minimized` | | a Home widget with `collapsed` | `clock: a widget on a canvas folds with minimized: true, not collapsed` | | `size: auto` on a view that does not grow, in a sidebar or on Home | `clock: size auto follows the content, and the app.clock view does not grow: use small, medium` | | a Home `size` that is not a preset, `custom` or `auto` | `clock: size "huge" is a preset (small, medium, tall, large, wide), custom or auto` | | a Home `frame` with no `h` and a `size` other than `auto` | `clock: frame needs h unless size is auto` | | a Home `frame` narrower than the smallest preset width of a view that grows | `usage: frame width 100 is narrower than claude-code/usage's minimum of 160` (a widget written in the board: `disk: frame width 100 is narrower than its minimum of 320`) | | a Home `h` of zero on a view that grows | `usage: frame h must be above zero` | | a Home `frame` smaller than the smallest preset of a view that does not grow | `clock: frame 100x160 is smaller than devmachine-app/clock's minimum of 160x160` | | a sidebar size that is neither auto nor a preset it takes | `todo: size "custom" in a sidebar is auto or one of medium, large` | | `size: auto` on a widget written in a sidebar board with no view | `notes: size auto follows the content, and a widget with no view does not grow: use small, medium, tall, large, wide` | | a board widget whose `fits` lacks the area's layout | `todo: devmachine-app/clock does not fit the context-sidebar area: its fits has no stack` | | a board widget that requires context the area lacks | `todo: devmachine-app/todo needs context.session, which the sidebar area does not give` | | a `single` widget twice on one board | `workspaces-2: devmachine-app/workspaces goes on a board once, and workspaces already has it` | | a widget written in a board whose provider needs context the area lacks | `keys: source.name app/shortcuts needs context.session, which this board's area does not give` | | a widget written in a board whose view is drawn only in a stack, on Home | `port: the app.publish-port view is drawn only in stack, and this board's area is laid out as canvas` | A choice that names a machine or workspace your `config.yml` does not have, or a coding agent the engine does not know, is a warning (`warning: …`), never a problem: see [choosing and editing a widget](/how-it-works/choosing-and-editing-a-widget/). `devmachine widgets validate` and `devmachine packages validate` report every problem at once, with the file and line. --- # https://mydevmachine.sh/reference/settings/ Every variable the published packages accept, and what each one defaults to. A setting is written `.` under a machine's or a workspace's `settings:`, and it reaches the recipe as the variable it already reads. **A setting is a default somebody overrode, not a new mechanism** — the recipe cannot tell the difference and does not have to. ```yaml machines: - name: main packages: [base, caddy] settings: base.timezone: Europe/Lisbon caddy.email: someone@example.com ``` Or without opening the file: ``` devmachine workspaces edit alice --set zsh.tmux_config=false devmachine machines edit main --set caddy.email=someone@example.com ``` A setting for a package the target does not install is refused. A typo in a package name would otherwise be silent: the value would reach nothing, the recipe would keep its default, and the machine would not be what the configuration says it is. **This page is generated** by `make settings`. Do not edit it by hand. | Setting | What it does | Default | | --- | --- | --- | | `antigravity.home` | Where the account's home is. | `` | | `base.hostname` | The machine's hostname. Empty leaves the one it already has. | *(empty)* | | `base.swap` | Size of a swapfile at /swapfile, such as 8G. Empty leaves the machine alone. Nothing on macOS, which manages its own swap. | *(empty)* | | `base.timezone` | The machine's timezone, as tzdata spells it. Empty leaves whatever the machine came with. | *(empty)* | | `base.upgrade` | Upgrade every package already installed. Off, because that is the owner's decision and not a side effect of installing base tools. On Arch Linux it is also the only thing that refreshes the package lists. Nothing on macOS. | `false` | | `caddy.email` | The address the certificate authority writes to about an expiring certificate. Empty means an anonymous account. | *(empty)* | | `caddy.local_certs` | Sign certificates locally instead of asking Let's Encrypt. For a machine no name resolves to — a test VM, a private network — where the ACME challenge can never succeed. Off, because a certificate nobody else trusts is not what a public site wants. | `false` | | `caddy.site` | Serve a one-page site straight from Caddy, no container behind it. It answers 200, which proves the name, the certificate and the proxy in one request. Off leaves the machine serving only what other packages add. | `true` | | `caddy.site_domain` | The name the one-page site answers to, with its own certificate. Empty serves it on port 80 at the machine's address, over plain HTTP, because no public authority signs a certificate for a bare address. It creates no DNS record: pointing the name is `devmachine dns add`. | *(empty)* | | `caddy.source` | Where Caddy is installed from. `auto` uses Caddy's apt repository and, when apt cannot check that repository's signature, installs the pinned GitHub release instead. `apt` uses only the repository and fails when it cannot be checked. `github` always installs the pinned GitHub release and removes the repository. Debian and Ubuntu only: elsewhere Caddy comes from the system's own repository, and on macOS from Homebrew or MacPorts. | `auto` | | `caddy.version` | The Caddy release installed from GitHub, by `source: github` or by the `auto` fallback. The `.deb` is checked against the release's own sha512 checksums before it is installed. The apt repository, and every system other than Debian and Ubuntu, ignores it. | `2.11.4` | | `claude-code.diff_sidebar` | Open the /diff panel. Unset leaves whatever Claude Code has. It is a preference Claude Code keeps in its own state file, so it is amended only where that file, and that preference, already exist. | *(none)* | | `claude-code.env` | Environment variables every Claude Code session runs with, as a map. It is how a model-specific or terminal-specific workaround is turned on without this package having an opinion about it. | `map[]` | | `claude-code.expanded_todos` | Show the task list under the footer. Unset leaves whatever Claude Code has, and the same condition applies. | *(none)* | | `claude-code.home` | Where the account's home is. | `` | | `claude-code.remote_control_at_startup` | Connect every session to Remote Control as it opens, instead of waiting for somebody to type /rc. | `false` | | `claude-code.session_name_prefix` | What each Remote Control session is called in the phone app. Empty means the workspace's name, which is what tells two workspaces' sessions apart. | *(empty)* | | `claude-code.status_line` | The command Claude Code runs to draw its status line. Empty leaves the status line alone. It runs outside a login shell, so give it an absolute path. | *(empty)* | | `claude-plugins.claude` | Where the Claude Code CLI is. It is installed into the account's own ~/.local/bin, so only a workspace that put it somewhere else says so. | `/.local/bin/claude` | | `claude-plugins.home` | Where the account's home is. | `` | | `claude-plugins.marketplace` | Where the plugins come from: a GitHub repository written owner/name, a git URL, or a path on the machine. Empty installs nothing. | *(empty)* | | `claude-plugins.plugins` | Which plugins to install, each written @. The marketplace half is the name the marketplace gives itself, which is what Claude Code installs and reports against. | `[]` | | `claude-plugins.update` | Re-fetch the marketplace and update every plugin on each run. It is off by default because it cannot tell whether anything moved, so a run with it on always reports a change. | `false` | | `claude-remote-control.home` | Where the account's home is. | `` | | `claude-remote-control.restart_seconds` | How long to wait before reconnecting. The server gives up on its own after about ten minutes with no network, so the unit restarts for good. On macOS it is launchd's ThrottleInterval. | `30` | | `claude-remote-control.session_name` | What this session is called in the phone app. Empty means the workspace's name, which is what tells two workspaces' sessions apart. | *(empty)* | | `claude-remote-control.working_directory` | The directory a remote session starts in. | `/dev` | | `cline.home` | Where the account's home is. | `` | | `codex.home` | Where the account's home is. | `` | | `dev.gh_version` | Which GitHub CLI release to install. It is a release asset rather than a distribution package because most distributions do not carry gh at all. | `2.63.2` | | `dev.home` | Where the account's home is. | `` | | `dev.node_version` | Which Node mise installs globally. | `lts` | | `devmachine-app.github_hosts` | GitHub Enterprise hosts the context panel resolves pull requests on, each as `{host, proxy}` with `proxy` optional. github.com always works; this adds more. | `[]` | | `docker.vm_cpus` | macOS only. The CPUs each workspace's VM gets. | `2` | | `docker.vm_memory` | macOS only. The memory each workspace's VM gets, in GiB. | `2` | | `docker.workspaces` | macOS only: the workspaces that get a Docker VM of their own. Empty means every workspace on the machine. | `[]` | | `fail2ban.bantime` | How long a ban lasts, in seconds. | `3600` | | `fail2ban.ignoreip` | The addresses that are never banned, space separated. Loopback only by default: a wider range exempts everyone who shares it. | `127.0.0.1/8 ::1` | | `fail2ban.maxretry` | How many failures from one address before it is banned. | `5` | | `firewall.http` | Open 80 and 443. A machine that hosts nothing can turn this off. | `true` | | `firewall.mosh_interface` | The one interface mosh's UDP range is opened on. Empty means it is not opened at all, which keeps the range off a public edge. | *(empty)* | | `firewall.mosh_ports` | The UDP range mosh is given on that interface. | `60000:61000` | | `git-key.home` | Where the account's home is. | `` | | `glab.home` | Where the account's home is. | `` | | `glab.version` | Which GitLab CLI release to install. It is a release asset rather than a distribution package because no distribution carries glab. | `1.111.0` | | `hostinger.zones` | DNS zones this provider may manage. Set this when the token has DNS permission without Domains portfolio permission; an empty list asks the account portfolio instead. | `[]` | | `kimi-code.home` | Where the account's home is. | `` | | `mac-brew.casks` | Homebrew casks to install. | `[]` | | `mac-brew.formulae` | Homebrew formulae to install. | `[]` | | `mac-brew.prefix` | Where Homebrew lives. Left unset, /opt/homebrew on Apple Silicon and /usr/local on an Intel Mac. | `/opt/homebrew` | | `mac-brew.taps` | Homebrew taps to add. | `[]` | | `mac-brew.trusted_casks` | Casks to trust, as full names `/`. Recent Homebrew refuses to load a cask from an unofficial tap until it is trusted, per item on purpose rather than per tap. | `[]` | | `mac-brew.trusted_formulae` | Formulae to trust, as full names `/`, for the same reason as trusted_casks. | `[]` | | `mac-mise.bin` | Where the mise binary is. | `~/.local/bin/mise` | | `mac-mise.tools` | Tools to install globally, as `mise use -g` takes them, e.g. `node@lts`. | `[]` | | `mac-ports.ports` | MacPorts ports to install, e.g. `git` or `ripgrep`. | `[]` | | `mise.home` | Where the account's home is. | `` | | `opencode.home` | Where the account's home is. | `` | | `pi.home` | Where the account's home is. | `` | | `scheduled.home` | Where the account's home is. | `` | | `scheduled.version` | The devmachine release the workspace runs its tasks with. Empty means the release of the CLI that syncs, so both sides speak the same version; a CLI built from source falls back to 0.14.0. | *(empty)* | | `sentry.home` | Where the account's home is. | `` | | `session-share.home` | Where the account's home is. | `` | | `session-share.port` | The local port this account's share server listens on. Every workspace on a machine needs its own. | `7690` | | `session-share.version` | The session-share release to install. A sync replaces an installed binary of another version. | `0.1.7` | | `ssh_hardening.service` | What systemd calls sshd. Empty means the name this distribution family uses, which is `ssh` on Debian and Ubuntu and `sshd` elsewhere. macOS ignores it: launchd starts sshd for each connection, so there is nothing to reload. | *(empty)* | | `tailscale.exit_node` | Advertise this machine as an exit node. Off unless asked for. | `false` | | `tailscale.login_server` | The control server `devmachine login tailscale` joins. Empty means Tailscale's own; a URL means your own, such as Headscale. | *(empty)* | | `workspace.admin_home` | The home of the account the CLI provisions with. Whatever reaches that account over SSH is what reaches this workspace. It is read from the system: root's home, or the admin login's own when that is not root. | `` | | `workspace.git_email` | The address on this workspace's commits. | *(empty)* | | `workspace.git_name` | The name on this workspace's commits. | *(empty)* | | `workspace.groups` | Extra groups the account joins. The docker group is one of them and it is effectively root, so nobody joins it by accident. | `[]` | | `workspace.home` | Where the account's home is. It is read from the account; a new account gets /home/ unless this says otherwise. On macOS a new account always gets /Users/. | `` | | `workspace.known_hosts` | The hosts whose SSH host key is trusted in advance, so the first clone does not stop to ask a question nobody is there to answer. | `[github.com]` | | `workspace.repos` | Repositories cloned into ~/dev/, once. A clone is never pulled, reset or removed afterwards, and a folder already at ~/dev/ is left as it is. A clone over SSH waits for the workspace's key, which a package such as git-key delivers after this one runs, so it happens on the second pass of the same sync. Each entry: `branch`: The branch checked out on the clone. Left out, the remote's default; `name` (required): The folder under ~/dev. Letters, digits, dot, dash and underscore; `url` (required): Where it is cloned from, over SSH or HTTPS. | `[]` | | `workspace.shell` | The login shell. Empty means the system's default for a new account (useradd's on Linux, /bin/bash on macOS), and the package that installs a shell is the one that sets it. | *(empty)* | | `workspace.sign_commits` | Sign every commit and rebase, once a package such as git-key sets up a key. | `true` | | `zsh.home` | Where the account's home is. | `` | | `zsh.tmux_auto_attach` | Open a tmux session on every SSH login, so a dropped connection loses nothing. A second connection while the first is live gets a session of its own instead of a second view of the same one. | `true` | | `zsh.tmux_config` | Write the account's ~/.tmux.conf. Turn it off to keep a config of your own. | `true` | --- # https://mydevmachine.sh/reference/app-keyboard-shortcuts/ Every shortcut in the macOS app, grouped by where you use it. Each mode and each command below is also in the command palette (⌘K) and in the app's menu bar menus. ⌘? shows the main ones inside the app. The app also works with the keyboard alone. With **Full Keyboard Access** on (System Settings → Keyboard), Tab reaches every control, including the mode title at the top of the sidebar and the pickers in the chat composer. Their menus are standard Mac menus: arrows move, Return picks, Esc closes. VoiceOver reads each control's name and current value. ## Anywhere on the Mac | Keys | What it does | | --- | --- | | ⌃⌥Space | Opens the quick chat panel over any app. You can change it in Settings → Chats. | ## Modes | Keys | What it does | | --- | --- | | ⌘1 | Code: workspaces, sessions and their terminals. | | ⌘2 | Chats: conversations with Claude or Codex. | | ⌘3 | Schedule: tasks that run on their own in a workspace. | The title at the top of the sidebar ("CODE WORKSPACES ▾", "CHAT WORKSPACES ▾", "SCHEDULE ▾") opens the same choice as a menu. ## Window and layout | Keys | What it does | | --- | --- | | ⌘K | Command palette: sessions, chats, pages and actions. | | ⌘P | Find a file in the session on screen. | | ⌘B | Show or hide the sidebar. The button beside the window buttons does the same. | | ⌘J | Show or hide the Context panel. | | ⌘0 | Home. | | ⌘, | Settings. | | ⌘? | The list of shortcuts. | | ⌘Q | Quit. | ## Sessions (Code) | Keys | What it does | | --- | --- | | ⌘N | New session in the current folder. In Chats, a new chat; in Schedule, a new task. | | ⌘W | End the session on screen. It asks first. | | ⌘⇧↑ / ⌘⇧↓ | Previous / next session. | | ⌘⇧← / ⌘⇧→ | Back / forward. | | ⌘⇧↩ | Maximize the focused grid cell or preview, and back. | | ⌘-click | Add a session to the selection, or take it out. | | ⇧-click | Select a range of sessions. | In a terminal, the find bar takes ⇧↩ for the previous match and Esc to close. ## Schedule | Keys | What it does | | --- | --- | | ↑ / ↓ | In the task list, moves to the previous or next task. | ## Chats | Keys | What it does | | --- | --- | | Return | Sends the message. | | ⇧Return | Starts a new line. | | Esc | Stops the answer that is coming. | | ↑ / ↓ | In the chat list, moves to the previous or next chat. | ## Quick chat panel | Keys | What it does | | --- | --- | | Return | Sends, then follows up in the same chat. | | ⌘↩ | Opens the chat in the app. | | Esc | Closes the panel. The answer keeps coming and stays in Chats. | ## Ask (Context panel) | Keys | What it does | | --- | --- | | Return | Asks about the session. The session itself is not interrupted. | | Esc | Stops the answer that is coming. | ## Command palette and file search | Keys | What it does | | --- | --- | | ↑ / ↓ | Moves through the results. | | Return | Runs or opens the selected result. | | Esc | Closes. | --- # https://mydevmachine.sh/guides/ Real setups, done in a few steps. Each guide says what you need and how long it takes, then shows the commands two ways: by hand, and as one request to your coding agent. The why lives in the concept pages it links to. **New here? Start with [your first devmachine](/guides/your-first-devmachine/).** **Whatever you start keeps running.** Every login to a workspace opens inside a tmux session. Start an app or an agent, close the terminal, and it keeps running on the server. `devmachine ssh acme` puts you back in the same session. Only a reboot stops it. ## Get started - [Your first devmachine, explained](/guides/your-first-devmachine/) — the first commands done slowly, with what each one asks and does. - [Try it on your own computer first](/guides/a-local-vm-with-lima/) — a local virtual machine with Lima, used exactly like a VPS. - [An old Mac as a machine](/guides/an-old-mac-as-a-machine/) — an old Mac mini or MacBook, Intel or Apple Silicon, set up for your workspaces. ## Workspaces - [Keep your sessions running](/guides/keep-sessions-running/) — close the laptop, and Claude Code keeps working on the server. - [Share a session](/guides/share-a-session/) — let someone watch, or type into, one of your tmux sessions for an hour, then they are out. - [One consultant, three startups](/guides/one-consultant-three-startups/) — a sandbox per client, each with its own stack and its own logins. - [Contribute to a Ruby on Rails project](/guides/ruby-on-rails/) — a Rails workspace for an open source gem, from fork to running tests. - [One set of skills for every workspace](/guides/shared-skills-for-every-workspace/) — write an agent skill once, and every workspace gets it on the next sync. ## Agents - [Scheduled tasks: work that runs on its own](/guides/scheduled-tasks/) — a monthly briefing, your standup or release notes, written by Claude or Codex in your workspace on a schedule. - [Claude Code, controlled from your phone](/guides/claude-code-remote-control/) — start a session on your server, drive it from the Claude app. - [Start Claude from your phone](/guides/start-claude-from-your-phone/) — a session that stays up on the server, so you never have to SSH in first. - [OpenClaw, in its own sandbox](/guides/openclaw-in-its-own-sandbox/) — an autonomous agent, always on, in a sandbox of its own. - [A Claude that never sleeps](/guides/claude-that-never-sleeps/) — `/rc` by hand, then drive the session from your phone or Claude Desktop. - [Hermes Agent, in its own sandbox](/guides/hermes-agent-in-its-own-sandbox/) — Nous Research's agent, always on, in a sandbox of its own. - [Agno AgentOS with a control plane](/guides/agno-agentos-with-control-plane/) — an agent API and its dashboard, each on its own subdomain. - [Pi as your coding agent](/guides/pi-coding-agent/) — install Pi in a workspace and use it for everyday work. - [opencode as your coding agent](/guides/opencode/) — try it on its free models, then connect your own provider. - [Antigravity CLI as your coding agent](/guides/antigravity-cli/) — Google's agent, signed in once from your own terminal. - [Kimi Code as your coding agent](/guides/kimi-code/) — Moonshot AI's agent, signed in with a device code. - [Cline as your coding agent](/guides/cline/) — the Cline agent in the terminal, with your Cline account or your own key. - [Claude 24/7 in Telegram](/guides/claude-24-7-in-telegram/) — message Claude Code from Telegram, while it runs on your server around the clock. - [Send work to a Claude session from a POST/Telegram/WhatsApp using Channels](/guides/claude-channels/) — a webhook, a chat message or a cron job sends work to a running Claude session, and it answers back. - [A simple agent with LangChain and OpenAI](/guides/langchain-agent-with-openai/) — a small Python agent with two tools, its key delivered by devmachine. ## Web apps - [Express site with TLS](/guides/express-site-with-tls/) — an Express app, live at your own domain with HTTPS. - [Docker site on 8080](/guides/docker-site-on-8080/) — a container, live at your own domain with HTTPS. - [Next.js app at your own domain](/guides/nextjs-site-with-tls/) — a production build under pm2, at your own domain with HTTPS; a Nest.js API works the same way. - [FastAPI app at your own domain](/guides/fastapi-with-tls/) — uvicorn as a service that survives a reboot, with Swagger UI at your domain. - [LibreChat, your own AI chat ecosystem](/guides/librechat/) — one self-hosted chat for many AI providers, agents, MCP and your files. - [Open WebUI on your own server](/guides/open-webui/) — a self-hosted AI chat in one container, with you as its only admin. - [Expose a home server without port forwarding](/guides/expose-home-server-without-port-forwarding/) — an old laptop or homelab box at your own domain with HTTPS, through your VPS, even behind CGNAT. - [Share an app on your computer with friends](/guides/share-a-local-app-with-friends/) — an app in a local VM, opened from a friend's phone through your VPS or Tailscale Funnel. - [wuzapi as your own package](/guides/wuzapi-as-your-own-package/) — a WhatsApp API written once as a package, running on two machines. ## Networking - [SSH or mosh?](/guides/ssh-or-mosh/) — which one to use, and what to install where. - [Point your domain with Cloudflare](/guides/cloudflare-dns/) — a scoped API token, and devmachine points your names for you. - [Point your domain with GoDaddy](/guides/godaddy-dns/) — a Personal Access Token, and devmachine points your names for you. - [Your own Tailscale with Headscale](/guides/headscale/) — a private network with a control server you host yourself. ## Security - [Log in with your 1Password SSH key](/guides/log-in-with-1password/) — keep the key in your vault, and approve each use with Touch ID. - [Logins and secrets](/guides/logins-and-secrets/) — see what is missing, sign in, and hand over tokens with `credentials`, `login` and `secrets`. --- # https://mydevmachine.sh/guides/your-first-devmachine/ The first commands, one at a time: what each asks and what it does. At the end you have a workspace called `acme` on your server. **You need:** a VPS running Debian, Ubuntu or Arch Linux that you reach over SSH as root, or as an admin login with passwordless sudo, and a Mac or Linux computer. A Mac can be the machine too: see [what a machine needs](/how-it-works/what-a-machine-needs/). ## By hand ### 1. Install the CLI ``` curl -fsSL https://mydevmachine.sh/install.sh | sh ``` ### 2. Connect the server ``` devmachine setup ``` It asks for the server's address and login, then shows its **fingerprint**. Check it against your provider's dashboard before you say yes: that is how you know it is your server. Then it installs a key, proves the key works, turns password logins off, and picks the `essentials` package for the machine (`--no-essentials` skips it). See [how setup locks the server](/how-it-works/trust-bootstrap/). Once the machine answers, it asks whether to write SSH host entries to `~/.ssh/config` — say yes, and `ssh acme-devmachine` works from any terminal or editor from here on, kept up to date automatically. It also asks about Tailscale, a private address that keeps working when the public one does not; see [reaching your server](/concepts/reaching-your-server/). ### 3. Teach your agent the CLI ``` devmachine skills add ``` Any new Claude Code or Codex session can now run devmachine for you. ### 4. Create the workspace ``` devmachine workspaces new acme devmachine sync ``` `workspaces new` adds `acme` to your configuration. `sync` builds it on the server, together with the essentials `setup` chose for the machine (base tools, git, a firewall, Caddy and what the macOS app reads): `acme` is its own account, with git, the GitHub CLI, Node, bun and zsh. It shows the plan and asks before changing anything. ### 5. Open it ``` devmachine ssh acme ``` You land inside tmux, so what you start keeps running after you close the terminal. See [keep your sessions running](/guides/keep-sessions-running/). Said yes to SSH aliases? `ssh acme-devmachine` reaches the same workspace, from any terminal, editor or app that dials `ssh` directly. ## With your agent Install the CLI (step 1), then say to Claude Code or Codex on your computer: ```text Set up devmachine for me with a workspace called acme: read https://mydevmachine.sh/agent-setup.md and follow it. ``` It asks for what it needs, one question at a time. You still check the fingerprint in `devmachine setup`, and you approve the `sync`. **Check it:** `devmachine doctor` passes, and `devmachine ssh acme` opens a shell on the server. --- # https://mydevmachine.sh/guides/a-local-vm-with-lima/ Run a virtual machine on your computer and use it exactly like a VPS: set it up, make workspaces, add packages, open them. Nothing to buy, and you can throw it away when you are done. **You need:** a Mac or Linux computer and [Lima](https://lima-vm.io), which runs the virtual machine: `brew install lima`. The VM runs Ubuntu 24.04 with 2 CPUs, 4 GiB of memory and a 20 GiB disk; the first one downloads the image, which takes a few minutes. Need a bigger one? Give the size when you create it: ``` devmachine machines create-local lab --cpus 4 --memory 8 --disk 40 --add ``` Memory and disk are in GiB. The CPUs cannot be more than your computer has, and the memory must be less than it has. devmachine sets the size only when it creates the VM: to change it, delete the VM and create it again. Want Arch Linux instead of Ubuntu? Add `--distro arch`. It runs as x86_64 under qemu, so on an Apple Silicon Mac it is emulated and slow — fine to try things, not to work in all day. ## Before you start: machine, skills, workspace A local VM is not a bought server, so it is made and added differently, but everything after that is the same. ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine machines create-local sandbox --add devmachine skills add devmachine workspaces new acme --machine sandbox devmachine sync ``` `--add` creates the machine and adds it in one go: it logs in with the public root password, installs a key, proves it, turns password login off and writes the machine to your configuration — a new one if you had none. Without `--add`, `create-local` only creates the machine, and prints its address, its port and the root password: ``` sandbox 127.0.0.1 port 60022 admin: root It has no key on it yet, and the root password is "devmachine". ``` The machine arrives the way a bought server does: reachable as root with a password, and no key yet. The password is public on purpose — this machine holds nothing real. Run `devmachine setup` if this is your first machine; if you already have one configured, run `devmachine machines add` instead, next to it. Either way, answer with what `create-local` printed: address `127.0.0.1`, login `root`, the port it showed, and the password when asked. Everything else is the same as on a real server — see [getting started](/getting-started/) for what each command does. ## By hand ### 1. Use it like a VPS ``` devmachine packages add claude-code --workspace acme devmachine sync --machine sandbox devmachine ssh acme ``` `--machine sandbox` is needed only when you have more than one machine. ### 2. What does not work on a local machine The internet cannot reach a virtual machine on your computer, so `dns`, HTTPS certificates and `expose` do not work there — see [publishing](/concepts/publishing/). Everything else does. To see an app you run in the VM, use a tunnel instead of a URL: ``` devmachine tunnel acme 3000 ``` ### 3. Stop it, start it, throw it away ``` devmachine machines stop sandbox devmachine machines start sandbox devmachine machines delete-local sandbox ``` `delete-local` destroys the VM and everything in it. Then take it out of your configuration: first its workspaces with `devmachine workspaces rm acme`, then the machine with `devmachine machines rm sandbox` — it refuses while a workspace still points at it. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Create a local devmachine VM called sandbox and set it up as a machine, then create a workspace acme on it with claude-code. ``` The agent runs `machines create-local sandbox --add`, which asks nothing: the VM was made a moment ago and answers only on your computer, so there is no fingerprint for you to check. It asks you where the machine is first and passes `--location`, `local` unless you name another place. After that, it creates the workspace, adds the package, and asks before running `sync`. The steps it follows are in [set up devmachine with a coding agent](/agent-setup/). **Check it:** `devmachine doctor --machine sandbox` passes every line after setup. Source: [Lima](https://lima-vm.io/docs/) --- # https://mydevmachine.sh/guides/an-old-mac-as-a-machine/ An old Mac mini on a shelf, or a MacBook you replaced, is a good machine to code on: it is already paid for, it is fast enough for a few workspaces, and it sits on your own network. devmachine sets it up the same way it sets up a VPS. Intel and Apple Silicon both work; the CLI reads which one it is and finds Homebrew or MacPorts in the right place. **You need:** a Mac you can reach over SSH, an admin account on it, and a Mac or Linux computer to run the CLI. Tested on macOS 15 on Intel and macOS 27 on Apple Silicon. Older versions are not tested. What a Mac does not get: `caddy`, `docker`, `firewall`, `tailscale` and the other Linux-only packages. A site with HTTPS at your own domain, or Docker, needs a Linux machine. See [what works on each](/supported-systems/#what-works-on-each). ## Before you start: on the Mac Do these once, sitting at the Mac. 1. **Turn on Remote Login.** System Settings > General > Sharing > Remote Login. With "Only these users", leave your admin account in the list; `sync` adds each workspace account to it later. 2. **Give the admin account passwordless sudo.** A Mac has no root login, so the CLI works through `sudo -n`. In Terminal, with your own account name in place of `alice`: ``` echo 'alice ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/devmachine-alice ``` 3. **Keep it awake.** A Mac that sleeps drops every session. On a Mac mini, System Settings > Energy: turn on "Prevent automatic sleeping when the display is off" and "Start up automatically after a power failure". On a MacBook, keep it on power; with the lid closed it sleeps unless an external display is connected, so leave the lid open. 4. **Find its address.** System Settings > General > Sharing shows a name such as `studio.local` under Local hostname. That works from any computer on the same network. **An old Intel Mac stuck on an old macOS?** Pick MacPorts in the next step. Homebrew supports only recent macOS versions and builds everything from source on older ones; MacPorts supports much older releases. ## By hand ### 1. Add the Mac From your own computer. On your first machine, run `devmachine setup`; next to a machine you already have, run: ``` devmachine machines add ``` Give it the address (`studio.local`), the admin login (`alice`) and its password, once. Check the fingerprint it shows against the Mac's. Then it: - installs a key and proves it; - asks which accounts keep SSH password login. On a Mac that is every account on it, so name the people who still SSH in with a password. The login window, `sudo` and Screen Sharing keep their passwords either way. See [password login, account by account](/how-it-works/password-login/); - asks Homebrew or MacPorts, then asks before it installs the Xcode Command Line Tools (5 to 10 minutes), the package manager and Ansible; - starts the machine with `base` and `devmachine-app` in place of `essentials`, which runs only on Linux. Name it `studio` when it asks. Why each step needs its own yes is in [what a machine needs](/how-it-works/what-a-machine-needs/). ### 2. Make a workspace ``` devmachine workspaces new acme --machine studio devmachine packages add claude-code --workspace acme devmachine sync --machine studio devmachine ssh acme ``` Each workspace is its own macOS account on the Mac, with its own tools and logins. `--machine studio` is needed only when you have more than one machine. ### 3. Reach it away from home `studio.local` works only on your own network. To reach the Mac from anywhere, put it on Tailscale. The `tailscale` package is Linux only, so on a Mac you install Tailscale yourself: - On a Mac someone logs in to, the [Tailscale app](https://tailscale.com/download/mac) is enough. - On a Mac that sits at the login window, the app does not start. Use the open-source `tailscaled`, which starts at boot: `brew install tailscale`, then `sudo brew services start tailscale` and `sudo tailscale up`. See [Tailscale's macOS variants](https://tailscale.com/kb/1065/macos-variants). Then put its Tailscale name first in its addresses. Open `config.yml` (`devmachine config path` prints where it is): ```yaml machines: - name: studio hosts: - tailscale:studio - studio.local ``` `` after `tailscale:` is what `tailscale status` lists for the Mac. Your computer needs Tailscale too, on the same account. devmachine tries the addresses in order; see [reaching your server](/concepts/reaching-your-server/). ### 4. After a restart With FileVault on, a Mac that restarts waits at its screen for a password before Remote Login starts. For a restart you plan, run `sudo fdesetup authrestart` on the Mac: it unlocks the disk once, by itself. After a power cut, somebody has to type the password at the Mac. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Add my Mac at studio.local as a devmachine machine called studio. Log in as alice; it has Remote Login on and passwordless sudo. Use MacPorts. Then create a workspace acme on it with claude-code. ``` The agent shows you the fingerprint to check and asks before it installs the Command Line Tools. It never answers that question for you: `--yes` does not install prerequisites. The steps it follows are in [set up devmachine with a coding agent](/agent-setup/). **Check it:** `devmachine doctor --machine studio` passes every line, and `devmachine machines show studio` says `Darwin` with the Mac's architecture. --- # https://mydevmachine.sh/guides/express-site-with-tls/ Run an Express app in a workspace and put it on the internet at a real domain, with HTTPS that renews itself. This is the plain Node case: one process, one port, no container. **You need:** a Linux VPS (tested on Debian and Ubuntu), and a domain such as `app.example.com` pointed at it (or a DNS provider package installed, so `expose add` points it for you — see [DNS](/concepts/dns/)). ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand Caddy came with `setup` (it's in the `essentials` package), and it will answer this site and get its own certificate. If your machine was set up with `--no-essentials`, or before CLI v0.7.14, add it first: `devmachine packages add caddy` then `devmachine sync`. ### 1. Write and start the app ``` devmachine ssh acme mkdir app && cd app npm init -y && npm install express cat > server.js <<'EOF' const express = require('express'); const app = express(); app.get('/', (req, res) => res.send('Hello from acme')); app.listen(3000); EOF node server.js ``` Leave this running and close the terminal: the login is inside tmux, so the app keeps going. To make it survive a reboot too, run it under a process manager such as [pm2](https://pm2.keymetrics.io/docs/usage/quick-start/). ### 2. Expose the port Back on your own computer: ``` devmachine expose add acme 3000 --host app.example.com --publish ``` `expose add` writes the Caddy route on the machine and reloads Caddy, which gets the certificate for the host — no `sync` needed. If no DNS provider package is installed, `expose add` prints the record to create by hand at your registrar instead of writing it for you. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Set up an Express "hello world" app in my devmachine workspace acme, listening on port 3000, and expose it at app.example.com. ``` The agent runs the same commands: writes `server.js` over SSH, starts it, then runs `expose add` (adding `caddy` and syncing first only if it's missing from the machine). You still approve a `sync` when it asks, and if `setup` has not run yet, you check the fingerprint yourself — the agent cannot do that part. **Check it:** `curl https://app.example.com` returns "Hello from acme", with a valid certificate. Source: [Express — Hello world](https://expressjs.com/en/starter/hello-world.html) --- # https://mydevmachine.sh/guides/docker-site-on-8080/ Run a site in a Docker container and put it on the internet at a real domain, with HTTPS that renews itself. This is the container case: the app only listens on `localhost`, and Caddy is the only thing the internet talks to. **You need:** a Linux VPS (tested on Debian and Ubuntu), and a domain such as `site.example.com` pointed at it (or a DNS provider package installed, so `expose add` points it for you — see [DNS](/concepts/dns/)). ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Add Docker to the machine ``` devmachine packages add docker devmachine sync ``` `setup` already installed Caddy as part of the `essentials` package. If your machine was set up with `--no-essentials`, or before CLI v0.7.14, add it by hand: `devmachine packages add caddy`. Docker is never in essentials, so you always add it yourself. `devmachine packages list` shows each package with your machine's name next to it. ### 2. Put the workspace in the docker group ``` devmachine workspaces edit acme --set 'workspace.groups=[docker]' devmachine sync ``` A workspace in the `docker` group can do almost anything on the server, so this is a deliberate step, not the default — [workspaces](/reference/commands/#workspaces) says why. ### 3. Run the container ``` devmachine ssh acme docker run -d --name site -p 127.0.0.1:8080:80 nginx:alpine ``` Publishing on `127.0.0.1` is enough: Caddy reaches the container locally, and the port itself is never open to the internet. ### 4. Expose it Back on your own computer: ``` devmachine expose add acme 8080 --host site.example.com --publish ``` It is on Caddy in seconds; no `sync` needed for the route. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Run nginx in a Docker container on my devmachine workspace acme, publishing on 127.0.0.1:8080, and expose it at site.example.com. ``` If your machine is missing from the config, or you have more than one, the agent asks which one to use. It adds `docker` (and `caddy` too, if `setup` ran with `--no-essentials`), puts `acme` in the `docker` group, starts the container over SSH, then runs `expose add`. You still approve the `sync` for the packages when it asks, and putting a workspace in the `docker` group is worth reading before you say yes — it is a lot of trust for one container. **Check it:** `curl https://site.example.com` serves the nginx welcome page, with a valid certificate. Source: [Docker — `docker run`](https://docs.docker.com/engine/reference/run/), [nginx image](https://hub.docker.com/_/nginx) --- # https://mydevmachine.sh/guides/nextjs-site-with-tls/ Create a Next.js app in a workspace, build it for production, and put it on the internet at `app.example.com`, with HTTPS that renews itself. At the end it also comes back on its own after the server restarts. The same steps work for a Nest.js API; see [Nest.js instead](#nestjs-instead) at the end. **You need:** a Linux VPS (tested on Debian and Ubuntu), and a domain such as `app.example.com` pointed at it (or a DNS provider package installed, so `expose add` points it for you — see [DNS](/concepts/dns/)). ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand Node is already there: every new workspace gets the `dev` package, which installs the Node LTS (with `npm` and `npx`) through mise. If you made the workspace with your own `--packages` list and left `dev` out, add it first on your computer: `devmachine packages add dev --workspace acme`, then `devmachine sync`. Caddy came with `setup` (it's in the `essentials` package), and it will answer this site and get its own certificate. If your machine was set up with `--no-essentials`, add it first: `devmachine packages add caddy`, then `devmachine sync`. ### 1. Create the app Inside the workspace: ``` devmachine ssh acme cd ~/dev npx create-next-app@latest web --yes --use-npm ``` The first time, `npx` asks to install `create-next-app`: answer `y`. `--yes` takes the defaults for every other question (TypeScript, Tailwind, ESLint, the App Router), and `--use-npm` installs the packages with npm. ### 2. Build it and start it Still inside the workspace: ``` cd ~/dev/web npm run build npm start ``` `npm run build` makes the optimized production build, and `npm start` serves it on port 3000. Do not serve the site with `npm run dev`: the dev server is slower, rebuilds pages on each request, and shows its error overlay to visitors. ### 3. Expose the port On your computer: ``` devmachine expose add acme 3000 --host app.example.com --publish ``` `expose add` writes the Caddy route on the machine and reloads Caddy, which gets the certificate for the host — no `sync` needed. If no DNS provider package is installed, `expose add` prints the record to create by hand at your registrar instead of writing it for you. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text In my devmachine workspace acme, create a Next.js app in ~/dev/web with create-next-app, build it with npm run build, and run it with npm start on port 3000 under pm2, so it comes back after a reboot. Then expose port 3000 at app.example.com. ``` The agent runs the same commands over SSH: `create-next-app`, the build, pm2 and the cron line from [Keep it running](#keep-it-running), then `expose add` on your computer. You still point `app.example.com` at the server yourself if no DNS provider package is installed — the agent shows you the record. And if `setup` has not run yet, you check the fingerprint yourself; the agent cannot do that part. **Check it:** on your computer, `curl -s https://app.example.com | grep -o '[^<]*'` prints `Create Next App`, with a valid certificate. ## Keep it running `devmachine ssh acme` opens inside tmux, so `npm start` keeps going after you close the terminal — see [keep your sessions running](/guides/keep-sessions-running/). A reboot stops it. To bring it back on its own, run it under [pm2](https://pm2.keymetrics.io/docs/usage/quick-start/) instead. First stop the `npm start` from step 2 with `Ctrl-C`. Then, inside the workspace: ``` npm install -g pm2 cd ~/dev/web pm2 start "npm start" --name web pm2 save (crontab -l 2>/dev/null; echo "@reboot $HOME/.local/share/mise/shims/pm2 resurrect") | crontab - ``` `pm2 save` writes down the apps pm2 runs now, and the cron line starts them again at every boot. pm2's own `pm2 startup` does not work here: it only prints a `sudo` command, and a workspace account has no `sudo`. The cron line does the same job without it. It uses the mise shim, the full path to `pm2`, because cron runs with almost nothing on its `PATH`. Once the code lives in a git repository you push to, ship a new version with: ``` cd ~/dev/web git pull && npm run build && pm2 restart web ``` `pm2 logs web` shows the app's output, and `pm2 ls` shows whether it is `online`. ## Nest.js instead A Nest.js API follows the same flow. Inside the workspace: ``` cd ~/dev npx @nestjs/cli@latest new api --package-manager npm --no-observe cd api npm run build node dist/main ``` `--package-manager npm` and `--no-observe` answer the two questions `nest new` would ask. The API listens on port 3000 by default, and `curl localhost:3000` prints `Hello World!`. Expose it the same way, on your computer: ``` devmachine expose add acme 3000 --host app.example.com --publish ``` To keep it running, stop `node dist/main` with `Ctrl-C` and run it under pm2 instead, then save and add the same cron line as above: ``` cd ~/dev/api pm2 start dist/main.js --name api pm2 save ``` Port 3000 holds one app at a time. To run the Next.js site and the API side by side, start the API on another port — the generated `src/main.ts` reads it from `PORT`: `PORT=3001 pm2 start dist/main.js --name api` — and expose that port at another host, such as `api.example.com`. ## Troubleshooting **`pm2 start npm --name web -- start` fails with `SyntaxError: Unexpected identifier 'pipefail'`.** The `npm` that mise installs is a shell script, and that form makes pm2 run it as JavaScript. `pm2 ls` shows the app as `errored`. Delete it with `pm2 delete web` and start it as a command string, as above: `pm2 start "npm start" --name web`. ## Remove it On your computer, take the site off Caddy: ``` devmachine expose rm app.example.com ``` Then, inside the workspace, stop the app and drop the cron line: ``` pm2 delete web pm2 save --force crontab -l | grep -v 'pm2 resurrect' | crontab - ``` Source: [Next.js — Deploying](https://nextjs.org/docs/app/getting-started/deploying), [create-next-app](https://nextjs.org/docs/app/api-reference/cli/create-next-app), [NestJS — First steps](https://docs.nestjs.com/first-steps), [PM2 — Quick start](https://pm2.keymetrics.io/docs/usage/quick-start/) --- # https://mydevmachine.sh/guides/fastapi-with-tls/ Write a small FastAPI app in a workspace, run it with uvicorn, and put it on the internet at `api.example.com`, with HTTPS that renews itself. Its interactive API docs come along at `https://api.example.com/docs`, and at the end the app comes back on its own after the server restarts. **You need:** a Linux VPS (tested on Debian and Ubuntu), and a domain such as `api.example.com` pointed at it (or a DNS provider package installed, so `expose add` points it for you — see [DNS](/concepts/dns/)). ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand Caddy came with `setup` (it's in the `essentials` package), and it will answer this site and get its own certificate. If your machine was set up with `--no-essentials`, add it first: `devmachine packages add caddy`, then `devmachine sync`. ### 1. Install uv Inside the workspace: ``` devmachine ssh acme mise use -g uv@latest uv --version ``` The machine already has Python 3 (Ubuntu ships it), but no package installs [uv](https://docs.astral.sh/uv/), the tool that makes the project, its virtual environment and its dependencies. mise is in every workspace (the `mise` package), so it installs uv into your own account, with no `sudo`. ### 2. Write the app Still inside the workspace: ``` mkdir -p ~/dev/items && cd ~/dev/items uv init --bare uv add "fastapi[standard]" cat > main.py <<'EOF' from fastapi import FastAPI app = FastAPI() @app.get("/") def read_root(): return {"hello": "acme"} @app.get("/items/{item_id}") def read_item(item_id: int, q: str | None = None): return {"item_id": item_id, "q": q} EOF ``` `uv init --bare` writes only `pyproject.toml`; `uv add` creates the virtual environment in `.venv` and installs FastAPI with uvicorn. ### 3. Start it Still inside the workspace: ``` uv run uvicorn main:app --host 127.0.0.1 --port 8000 ``` It listens on `127.0.0.1` because Caddy runs on the same machine and reaches the app there; nothing else needs the port, so it stays off the network. ### 4. Expose the port On your computer: ``` devmachine expose add acme 8000 --host api.example.com --publish ``` `expose add` writes the Caddy route on the machine and reloads Caddy, which gets the certificate for the host — no `sync` needed. If no DNS provider package is installed, `expose add` prints the record to create by hand at your registrar instead of writing it for you. Open `https://api.example.com/docs` in your browser: FastAPI's Swagger UI lists both routes, and "Try it out" calls them through the domain. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text In my devmachine workspace acme, install uv with mise, create a FastAPI app in ~/dev/items with the routes / and /items/{item_id}, run it with uvicorn on 127.0.0.1 port 8000 as a systemd user service that survives a reboot, and expose port 8000 at api.example.com. ``` The agent runs the same commands over SSH: `mise use -g uv@latest`, the project, `main.py`, the service from [Keep it running](#keep-it-running), then `expose add` on your computer. You still point `api.example.com` at the server yourself if no DNS provider package is installed — the agent shows you the record. And if `setup` has not run yet, you check the fingerprint yourself; the agent cannot do that part. **Check it:** on your computer, `curl 'https://api.example.com/items/5?q=hi'` prints `{"item_id":5,"q":"hi"}`, with a valid certificate. ## Keep it running `devmachine ssh acme` opens inside tmux, so uvicorn keeps going after you close the terminal — see [keep your sessions running](/guides/keep-sessions-running/). A reboot stops it. To bring it back on its own, run it as a systemd user service: your own account's services, no `sudo` needed. First stop the uvicorn from step 3 with `Ctrl-C`. Then, inside the workspace: ``` mkdir -p ~/.config/systemd/user cat > ~/.config/systemd/user/items.service <<'EOF' [Unit] Description=FastAPI app on port 8000 [Service] WorkingDirectory=%h/dev/items ExecStart=%h/dev/items/.venv/bin/uvicorn main:app --host 127.0.0.1 --port 8000 Restart=always [Install] WantedBy=default.target EOF systemctl --user daemon-reload systemctl --user enable --now items loginctl enable-linger ``` `enable --now` starts the service and marks it to start with your account. `loginctl enable-linger` starts your account's services at boot, with nobody logged in; without it they wait for your next login. The unit calls uvicorn from `.venv` by its full path, so it does not need uv or mise on the `PATH`. `Restart=always` also brings the app back if it crashes. Once the code lives in a git repository you push to, ship a new version with: ``` cd ~/dev/items git pull && uv sync && systemctl --user restart items ``` `journalctl --user -u items -f` shows the app's output, and `systemctl --user status items` shows whether it is running. ## Remove it On your computer, take the site off Caddy: ``` devmachine expose rm api.example.com ``` Then, inside the workspace, stop the service: ``` systemctl --user disable --now items rm ~/.config/systemd/user/items.service ``` Source: [FastAPI — Run a server manually](https://fastapi.tiangolo.com/deployment/manually/), [uv — Working on projects](https://docs.astral.sh/uv/guides/projects/), [systemd — user services](https://wiki.archlinux.org/title/Systemd/User) --- # https://mydevmachine.sh/guides/librechat/ [LibreChat](https://www.librechat.ai) is a chat app you host yourself. One screen talks to OpenAI, Anthropic, Google and many more; it can run agents, call MCP servers and search the files you upload. At the end of this guide it runs in a workspace with Docker Compose, answers at `https://chat.example.com`, you are its admin, and nobody else can sign up. The stack is six containers: the app, MongoDB, Meilisearch, a RAG service, its vector database, and an admin panel. In our test they used about 750 MiB of memory together, and the images took about 10 GB of disk. **You need:** a Linux VPS (tested on Debian and Ubuntu), a domain such as `chat.example.com` pointed at it (or a DNS provider package installed, so `expose add` points it for you — see [DNS](/concepts/dns/)), and an API key from at least one AI provider. Or none: each user can paste their own key (step 6). ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Add Docker, and put the workspace in the docker group On your computer: ``` devmachine packages add docker devmachine packages add workspace --workspace acme devmachine workspaces edit acme --set 'workspace.groups=[docker]' devmachine sync ``` The `workspace` package owns the `groups` setting, so `edit` refuses it until the workspace lists that package; if it is there already, `packages add` says so and changes nothing. Keep the quotes: without them, zsh reads `[docker]` as a file pattern and stops with `no matches found`. A workspace in the `docker` group can do almost anything on the server — see [Docker site on 8080](/guides/docker-site-on-8080/) for why that is a deliberate step. ### 2. Get LibreChat Inside the workspace (`devmachine ssh acme`): ``` git clone https://github.com/LibreChat-AI/LibreChat.git cd LibreChat cp .env.example .env ``` `.env` holds every setting. Git ignores it, so `git pull` never touches your copy. ### 3. Set the address and the secrets Inside the workspace, in `LibreChat`: ``` sed -i \ -e "s|^DOMAIN_CLIENT=.*|DOMAIN_CLIENT=https://chat.example.com|" \ -e "s|^DOMAIN_SERVER=.*|DOMAIN_SERVER=https://chat.example.com|" \ -e "s|^CREDS_KEY=.*|CREDS_KEY=$(openssl rand -hex 32)|" \ -e "s|^CREDS_IV=.*|CREDS_IV=$(openssl rand -hex 16)|" \ -e "s|^JWT_SECRET=.*|JWT_SECRET=$(openssl rand -hex 32)|" \ -e "s|^JWT_REFRESH_SECRET=.*|JWT_REFRESH_SECRET=$(openssl rand -hex 32)|" \ -e "s|^MEILI_MASTER_KEY=.*|MEILI_MASTER_KEY=$(openssl rand -hex 32)|" \ -e "s|^ADMIN_PANEL_SESSION_SECRET=.*|ADMIN_PANEL_SESSION_SECRET=$(openssl rand -hex 32)|" \ .env ``` These values are empty in `.env.example`. Left empty, LibreChat makes temporary ones, and upstream says to set your own before real use. `CREDS_KEY` and `CREDS_IV` encrypt the keys users store, so keep them: new values make the stored keys unreadable. The admin panel container does not start without `ADMIN_PANEL_SESSION_SECRET`. ### 4. Keep the ports on localhost, and start it Inside the workspace, in `LibreChat`: ``` cat > docker-compose.override.yml <<'EOF' services: api: ports: !override - "127.0.0.1:3080:3080" admin-panel: ports: !override - "127.0.0.1:3000:3000" EOF docker compose up -d ``` The upstream `docker-compose.yml` publishes port 3080 (and the admin panel's 3000) on every address of the server. Docker writes its own firewall rules, and they go [around ufw](https://docs.docker.com/engine/network/packet-filtering-firewalls/#docker-and-ufw), so the `firewall` package does not block those ports. This override binds both to `127.0.0.1`: Caddy reaches LibreChat, the internet does not reach the port. `!override` replaces the upstream port list instead of adding to it. The first start downloads about 10 GB of images, so give it a few minutes. The admin panel stays private; open it with `devmachine tunnel acme 3000` when you need it. ### 5. Expose it, and make the first account On your computer: ``` devmachine expose add acme 3080 --host chat.example.com --publish ``` Open `https://chat.example.com` and sign up. The first account becomes the admin. Do this right away: until step 6, anyone who finds the address can sign up too. ### 6. Close sign-up Inside the workspace, in `LibreChat`: ``` sed -i "s/^ALLOW_REGISTRATION=.*/ALLOW_REGISTRATION=false/" .env docker compose down && docker compose up -d ``` LibreChat reads `.env` only when it starts, so every change to it needs this restart. Your account still signs in; a new sign-up gets `Registration is not allowed.` ### 7. Give it provider keys `.env.example` already sets `OPENAI_API_KEY`, `ANTHROPIC_API_KEY` and `GOOGLE_KEY` to `user_provided`: each user pastes their own key in the chat screen, and LibreChat stores it encrypted with `CREDS_KEY`. Nothing more to do for that. To pay for everyone with one key of yours, put the real key in `.env`. Do it with devmachine, so the key never sits in your shell history or in a file on your computer. On your computer: ``` devmachine secrets set ANTHROPIC_API_KEY --workspace acme --env-file LibreChat/.env devmachine credentials push ``` `secrets set` asks for the value without showing it. `credentials push` replaces the `ANTHROPIC_API_KEY=` line in `LibreChat/.env` and leaves every other line as it was; the first time, it keeps a copy at `LibreChat/.env.devmachine.bak`. Do the same with `OPENAI_API_KEY` or `GOOGLE_KEY`. Then restart, inside the workspace in `LibreChat`: ``` docker compose down && docker compose up -d ``` See [your app's own secrets](/concepts/credentials/#your-apps-own-secrets) for how the file is edited. To change a key later, run `secrets set` again, then `credentials push` and the restart. ## The ecosystem - **Many providers in one place.** OpenAI, Anthropic and Google are built in; others that speak an OpenAI-style API go in `librechat.yaml` as [custom endpoints](https://www.librechat.ai/docs/configuration/librechat_yaml/ai_endpoints). - **Agents.** Build an assistant without code, on any provider, with file search, a code interpreter, MCP tools and actions from an OpenAPI spec — [Agents](https://www.librechat.ai/docs/features/agents). - **MCP servers.** List them under `mcpServers:` in `librechat.yaml` — [MCP servers](https://www.librechat.ai/docs/configuration/librechat_yaml/object_structure/mcp_servers). LibreChat reads `librechat.yaml` only when you mount it: add a `volumes:` entry under `api:` in `docker-compose.override.yml`, as the [Docker guide](https://www.librechat.ai/docs/local/docker) shows, then restart. - **Your files (RAG).** The `rag_api` service and its `vectordb` already run in the stack. They turn uploaded files into something agents can search, and they need an embeddings key on the server — `RAG_OPENAI_API_KEY` or a real `OPENAI_API_KEY` in `.env`; a key a user pastes is not used for this — [RAG API](https://www.librechat.ai/docs/configuration/rag_api). ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Install LibreChat with Docker Compose from its GitHub repository in my devmachine workspace acme. Fill the empty secrets in .env, bind its ports to 127.0.0.1 with a docker-compose.override.yml, and expose port 3080 at chat.example.com. Stop after it is exposed so I can make the first account. ``` The agent adds `docker` and the `docker` group, clones the repository over SSH, fills `.env`, writes the override, starts the stack and runs `expose add`. You approve the `sync`, and the `docker` group is worth reading about before you say yes. You make the first account yourself in the browser — then tell the agent to close sign-up. For a provider key, the agent runs `devmachine secrets set ... --env-file LibreChat/.env`, and you paste the key into the prompt it opens yourself — never into the chat with the agent. **Check it:** `curl -s https://chat.example.com | grep -o '.*'` prints `LibreChat`, with a valid certificate. ## Keep it running Every service has `restart: always`, so the stack comes back after a reboot. To update, inside the workspace in `LibreChat`: ``` git pull && docker compose pull && docker compose up -d ``` `.env`, `docker-compose.override.yml` and the data folders are ignored by git, so the pull never conflicts with them. ## Troubleshooting **`chat-mongodb` or `chat-meilisearch` keeps restarting, and the logs say `Permission denied`.** You set `UID` and `GID` in `.env`. Docker creates the data folders (`data-node`, `meili_data_*`, `logs`, `uploads`) as root the first time, and a container running as your workspace's user cannot write to them. Leave `UID` and `GID` commented out, as `.env.example` has them. **The page shows the old setting after you edit `.env`.** LibreChat read `.env` when it started. Run `docker compose down && docker compose up -d`. **`docker compose logs api`** shows why the app stopped. ## Remove it Inside the workspace, in `LibreChat`, `docker compose down -v` stops the stack and deletes its volumes. The data folders inside `LibreChat` belong to root, so delete them as the admin: `devmachine run 'rm -rf /home/acme/LibreChat'`. On your computer, `devmachine expose rm chat.example.com` takes the site off Caddy. Source: [LibreChat — Docker](https://www.librechat.ai/docs/local/docker), [.env configuration](https://www.librechat.ai/docs/configuration/dotenv), [librechat.yaml](https://www.librechat.ai/docs/configuration/librechat_yaml) --- # https://mydevmachine.sh/guides/open-webui/ [Open WebUI](https://openwebui.com) is a chat app you host yourself. It talks to any provider with an OpenAI-compatible API, and to local models through Ollama. At the end of this guide it runs in one Docker container in a workspace, answers at `https://ai.example.com`, and you are its admin. In our test the container used about 650 MiB of memory, and the image took about 6 GB of disk. **You need:** a Linux VPS (tested on Debian and Ubuntu), a domain such as `ai.example.com` pointed at it (or a DNS provider package installed, so `expose add` points it for you — see [DNS](/concepts/dns/)), and an API key from a provider with an OpenAI-compatible API. ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Add Docker, and put the workspace in the docker group On your computer: ``` devmachine packages add docker devmachine packages add workspace --workspace acme devmachine workspaces edit acme --set 'workspace.groups=[docker]' devmachine sync ``` The `workspace` package owns the `groups` setting, so `edit` refuses it until the workspace lists that package; if it is there already, `packages add` says so and changes nothing. Keep the quotes: without them, zsh reads `[docker]` as a file pattern and stops with `no matches found`. A workspace in the `docker` group can do almost anything on the server — see [Docker site on 8080](/guides/docker-site-on-8080/) for why that is a deliberate step. ### 2. Write the settings and the compose file Inside the workspace (`devmachine ssh acme`): ``` mkdir open-webui && cd open-webui cat > open-webui.env < compose.yaml <<'EOF' services: open-webui: image: ghcr.io/open-webui/open-webui:main container_name: open-webui restart: always ports: - "127.0.0.1:3000:8080" volumes: - open-webui:/app/backend/data env_file: open-webui.env volumes: open-webui: EOF ``` `WEBUI_SECRET_KEY` signs the sign-in sessions. It lives in the file, not in a command, so an update keeps the same key and nobody is signed out. The port is bound to `127.0.0.1`: Docker's own firewall rules go [around ufw](https://docs.docker.com/engine/network/packet-filtering-firewalls/#docker-and-ufw), so a port published on every address would be open to the internet, while this one only Caddy reaches. Your chats and settings live in the `open-webui` volume. This is a small compose file and not the one-line `docker run` from the Open WebUI docs for one reason: `devmachine secrets` writes values in quotes, and `docker compose` removes them, while `docker run --env-file` keeps them as part of the value. ### 3. Give it your provider key, before the first start On your computer: ``` devmachine secrets set OPENAI_API_KEY --workspace acme --env-file open-webui/open-webui.env devmachine credentials push ``` `secrets set` asks for the value without showing it, so the key never reaches your shell history. `credentials push` adds the line to `open-webui/open-webui.env` and leaves the other lines as they were. For a provider other than OpenAI, add its address the same way, by hand, to `open-webui.env`: `OPENAI_API_BASE_URL=`. Do this before step 4. Open WebUI reads most settings from the environment only the first time it starts, then keeps them in its own database, and from then on ignores the environment. Skip this step if you prefer: you can add the key later in the browser (step 6). ### 4. Start it Inside the workspace, in `open-webui`: ``` docker compose up -d ``` The first start downloads the image and then takes a minute or two more to set itself up. `docker ps` shows `(healthy)` when it is ready. ### 5. Expose it, and make the first account On your computer: ``` devmachine expose add acme 3000 --host ai.example.com --publish ``` Open `https://ai.example.com` and choose **Create Admin Account**. That first account is the admin. Do this right away: until then, the first person to find the address gets that role. Once the admin exists, Open WebUI closes sign-up by itself; a new sign-up gets `You do not have permission to access this resource.` To let people in later, turn sign-up on in **Settings → Admin → Authentication**. New accounts start as `pending` until you approve them there. Setting `ENABLE_SIGNUP` in `open-webui.env` does nothing after the first start, for the reason in step 3. ### 6. Add or change a provider In the browser, as the admin: **Settings → Admin → Connections**. Enter a URL and an API key for any OpenAI-compatible provider, and its models show up in the chat. This is also where you change the key from step 3 — a new value in `open-webui.env` is ignored after the first start. **Ollama, for local models.** Open WebUI can also talk to [Ollama](https://ollama.com), which runs models on your own server, with no API key. The cost is memory: the whole model sits in RAM while it answers, so even a small model needs several GB of free memory on top of Open WebUI, and a bigger model needs much more. On a small VPS, a provider API is the better choice. Without a graphics card, answers are also slow. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Run Open WebUI with a small docker compose file in my devmachine workspace acme: image ghcr.io/open-webui/open-webui:main, port 127.0.0.1:3000:8080, a volume for its data, and WEBUI_SECRET_KEY and WEBUI_URL in an env file. Let me store my OpenAI key into that env file with devmachine secrets before the first start, then expose it at ai.example.com. ``` The agent adds `docker` and the `docker` group, writes the two files over SSH, starts the container and runs `expose add`. You approve the `sync`, and the `docker` group is worth reading about before you say yes. When the agent runs `devmachine secrets set OPENAI_API_KEY ...`, you paste the key into the prompt it opens yourself — never into the chat with the agent. You make the admin account yourself in the browser. **Check it:** `curl -s https://ai.example.com | grep -o '.*'` prints `Open WebUI`, with a valid certificate. ## Keep it running `restart: always` brings the container back after a reboot. To update, inside the workspace in `open-webui`: ``` docker compose pull && docker compose up -d ``` `up -d` replaces the container with one from the new image. Your data and your settings stay in the volume. ## Remove it Inside the workspace, in `open-webui`, `docker compose down -v` deletes the container and the volume with every chat in it. On your computer, `devmachine expose rm ai.example.com` takes the site off Caddy. Source: [Open WebUI — Quick start](https://docs.openwebui.com/getting-started/quick-start/), [environment variables](https://docs.openwebui.com/reference/env-configuration/) --- # https://mydevmachine.sh/guides/expose-home-server-without-port-forwarding/ That old laptop in a drawer, the mini PC under the TV, the Raspberry Pi running your homelab: each one can serve a site at a real domain, with HTTPS, without opening a single port on your router. It works behind CGNAT, behind a landlord's Wi-Fi, behind anything that lets the machine connect out. Your VPS does the public part. Its Caddy answers `media.example.com`, gets the certificate, and passes each request to the machine at home over your private network. The machine at home needs no public address and no Caddy. ``` visitor ──HTTPS──▶ VPS (Caddy, public IP) ──private network──▶ old laptop :8096 ``` **You need:** a devmachine VPS with Caddy (`setup` installs it), a domain, a computer at home running Linux (tested on Debian and Ubuntu), and a private network both machines join — [Tailscale](/concepts/private-networks/), your own [Headscale](/guides/headscale/), plain WireGuard, or a LAN the VPS can reach. With a [DNS provider package](/concepts/dns/) installed, the DNS record is created for you too. ## Why you can't reach your home server from the internet Most homes cannot take a visitor in. The provider shares one public address among many customers (CGNAT), or changes it every few days, or blocks ports 80 and 443. Port forwarding fixes some of that and opens a door in your router you then have to watch. The usual answers move the problem to a third party: Cloudflare Tunnel, ngrok, Tailscale Funnel. Here the one machine that faces the internet is a VPS you already run, and the domain is yours. ## Before you start: machine, skills, workspace You already have a VPS called `vps` in devmachine. On the computer at home, install Debian or Ubuntu Server, enable SSH, and join it to your private network. With Tailscale: ``` curl -fsSL https://tailscale.com/install.sh | sh sudo tailscale up ``` On a laptop, keep it awake with the lid closed: set `HandleLidSwitch=ignore` in `/etc/systemd/logind.conf` and run `sudo systemctl restart systemd-logind`. The VPS has to be on the same private network. With Tailscale: ``` devmachine packages add tailscale --machine vps devmachine sync --machine vps devmachine login tailscale --machine vps ``` ## By hand ### 1. Add the computer at home as a machine ``` devmachine machines add ``` When it asks for the address, give its private one — the name Tailscale gave it, as `tailscale:homelab`, or an address such as `100.64.0.7`. Add the network package to it too, so it stays on the network after a rebuild: ``` devmachine packages add tailscale --machine homelab devmachine sync --machine homelab ``` A `tailscale:` name is resolved on your own computer, so your computer has to be on the private network as well. `devmachine resolve --machine homelab` shows the address the VPS will proxy to. ### 2. Make a workspace and start the service ``` devmachine workspaces new media --machine homelab devmachine sync --machine homelab devmachine ssh media ``` Start whatever you want to publish, listening on every address or on the private one — not only on `127.0.0.1`, which the VPS cannot reach. Jellyfin in Docker, for example: ``` docker run -d --name jellyfin -p 8096:8096 -v ~/media:/media jellyfin/jellyfin ``` ### 3. Publish it through the VPS Back on your own computer: ``` devmachine expose add media 8096 --host media.example.com --via vps --publish ``` In seconds, the VPS's Caddy serves `media.example.com` and proxies it to `homelab:8096`. The DNS record points at the VPS's public address, and Caddy gets the Let's Encrypt certificate on the first visit. If the VPS cannot reach the port, the command says what to check instead of leaving visitors a 502. Without `--via`, `expose add` on a machine with no Caddy refuses and lists the machines that have it: devmachine never picks one for you. **In the macOS app:** right-click the workspace → **Publish a port…**. "Published by" already shows the VPS, with a line saying why. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Publish port 8096 of my workspace media, on homelab, at media.example.com through my VPS. ``` The agent checks that `homelab` has no Caddy, picks `--via vps` because it is the machine that has it, and runs `expose add`. You approve the publish when it asks. **Check it:** `curl -I https://media.example.com` answers from Jellyfin, with a valid certificate, from any network. ## What people use it for ### An old computer as a staging server An old desktop has more RAM and disk than a cheap VPS. Make it a devmachine machine, give it a `staging` workspace, and publish `staging.example.com` through the VPS. Your team sees every branch before it ships, and the VPS bill stays the same. ### Jellyfin or Plex remote access, managed with Claude Code Put the media server in a workspace on the box at home, publish it with `--via`, and run Claude Code in that same workspace. From anywhere — `devmachine ssh media`, the macOS app, or your phone — ask it to add a library, fix a transcoding setting or update the container. Remote access to Jellyfin, without port forwarding and without a tunnel service. ### A local dev server with a stable custom domain A webhook, an OAuth callback, a client demo: they want a real HTTPS address that does not change between sessions. `dev.example.com` through your VPS stays the same address for as long as you keep the route. ### The rest of the homelab Home Assistant, a wiki, a photo library: one `expose add --via` each, all behind one Caddy, all listed by `devmachine expose list --machine vps`. ## Compared with Cloudflare Tunnel, ngrok and Tailscale Funnel | | This | Cloudflare Tunnel | ngrok | Tailscale Funnel | | --- | --- | --- | --- | --- | | Your own domain | yes | yes | paid plans | no: `*.ts.net` only | | Who terminates HTTPS | your VPS | Cloudflare | ngrok | your machine, via Tailscale's relays | | Any port behind it | yes | yes | yes | 443, 8443, 10000 | | Runs on | a VPS you already have | Cloudflare's network | ngrok's network | your tailnet | Two things worth knowing before you choose. Cloudflare's terms restrict serving video through its free CDN, which matters for a media server. Tailscale Funnel is in beta and has no custom domains. Neither applies here: the traffic goes through your VPS, under your domain. ## Limits - **Every byte goes through the VPS.** It counts against the VPS's bandwidth and adds one hop of delay. Pick a VPS close to home for video. - **The VPS still faces the internet** on ports 80 and 443. Only your home network needs no open port. - **The site is public.** Whatever you publish needs its own login. Keep admin panels private: reach them over the private network with [`devmachine tunnel`](/reference/commands/#tunnel) instead. - **The machine at home has to be on.** When it sleeps or loses its network, visitors get a 502 until it is back. - **Limit what the VPS can reach.** On Tailscale, an ACL that lets the VPS open only the published port on `homelab` means a VPS someone broke into reaches nothing else at home. ## When it does not work - `expose add` warns that the VPS cannot reach the port: see "`expose add --via` warns …" in [troubleshooting](/troubleshooting/). - `sync` says a site is left as it is because an address is not known: turn the private network on, on your computer, and sync again. - The name does not resolve: create the record `expose add` printed, or install a [DNS provider package](/concepts/dns/). How it works underneath, and why the address is never stored: [publishing through another machine](/how-it-works/published-sites/#publishing-through-another-machine). --- # https://mydevmachine.sh/guides/share-a-local-app-with-friends/ You built something in a VM on your laptop, and a friend wants to open it on their phone. The internet cannot reach that VM, and Lima forwards its ports only to your own computer's `127.0.0.1`. Two ways out. With a VPS and a domain, your VPS serves `https://demo.example.com` and passes each visit to the VM over your private network. With no VPS, Tailscale Funnel gives the VM a public `ts.net` address. **You need:** a [local VM](/guides/a-local-vm-with-lima/) called `laptop`, a [Tailscale](/concepts/private-networks/) account (or your own [Headscale](/guides/headscale/)), and Tailscale on your own computer. For your own domain: a devmachine VPS called `vps`, with Caddy, on the same network. ## Before you start: machine, skills, workspace ``` devmachine machines create-local laptop --add devmachine skills add devmachine workspaces new acme --machine laptop devmachine sync --machine laptop ``` The [Lima guide](/guides/a-local-vm-with-lima/) explains each line. `--machine laptop` picks the VM, since you also have `vps`. ## By hand ### 1. Put the VM on your private network On your computer. Your VPS must already be on the same network. #### Tailscale ``` devmachine packages add tailscale --machine laptop devmachine sync --machine laptop devmachine login tailscale --machine laptop ``` `login` runs `tailscale up` on the VM: open the URL it prints and sign in. #### Headscale ``` devmachine packages add tailscale --machine laptop devmachine machines edit laptop --set tailscale.login_server=https://net.example.com devmachine sync --machine laptop devmachine login tailscale --machine laptop ``` When `login` asks, paste a pre-auth key made on your Headscale server with `headscale preauthkeys create --user `. See [your own Tailscale with Headscale](/guides/headscale/). Once the VM has joined, devmachine adds `tailscale:` to the top of `laptop`'s `hosts` in `config.yml`. A Lima VM's name is `lima-laptop`. ### 2. Start the app Inside the workspace (`devmachine ssh acme`): ``` mkdir -p ~/demo && cd ~/demo echo '

Hello from acme

' > index.html python3 -m http.server 3000 --bind 0.0.0.0 ``` Listen on `0.0.0.0`, not `127.0.0.1`: the VPS comes in over the VM's Tailscale address, and `127.0.0.1` answers only the VM itself. Close the terminal; the app keeps running in tmux. ### 3. Publish it through your VPS On your computer: ``` devmachine expose add acme 3000 --host demo.example.com --via vps --publish ``` The VPS's Caddy answers `demo.example.com`, gets the certificate, and proxies to the VM. Your friend opens `https://demo.example.com`. How `--via` works, and what to do when it warns: [expose a home server](/guides/expose-home-server-without-port-forwarding/). ### 4. Take it down On your computer: ``` devmachine expose rm demo.example.com ``` ## No VPS? Use Tailscale Funnel Funnel lets Tailscale's relays carry public traffic to the VM. It is Tailscale's own service: Headscale does not offer it. First allow it in your tailnet: MagicDNS, HTTPS and the `funnel` node attribute (the [Funnel docs](https://tailscale.com/kb/1223/funnel) show how). After steps 1 and 2, run it as the VM's admin, since the workspace account has no `sudo`: ``` devmachine ssh --machine laptop sudo tailscale funnel 3000 ``` It prints `https://..ts.net`; send that to your friend. Ctrl-C stops it. Funnel is in beta, gives no custom domain, and listens only on ports 443, 8443 and 10000. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Add tailscale to my local machine laptop, start a static page on port 3000 in workspace acme, and publish it at demo.example.com through my VPS. ``` The agent adds the package, asks before `sync`, starts the app and runs `expose add --via vps`. You still finish `devmachine login tailscale` yourself: open its URL, or paste the Headscale key. **Check it:** from your phone, on mobile data, `https://demo.example.com` shows "Hello from acme". ## Limits - **Your computer has to be awake**, and the VM running. When it sleeps, your friend gets a 502 (or nothing, with Funnel). - **Your computer has to be on the private network** when you run `expose add`, since it looks up the VM's address. If not, it stops with `no address of laptop another machine can reach: no address but a loopback one`. - **It is public.** Anybody with the link gets in, so share no admin panels. `expose rm` (or Ctrl-C on Funnel) closes it. Source: [Tailscale Funnel](https://tailscale.com/kb/1223/funnel), [tailscale funnel command](https://tailscale.com/kb/1311/tailscale-funnel) --- # https://mydevmachine.sh/guides/claude-code-remote-control/ Run Claude Code in a workspace and open the session from the Claude iPhone or Android app, while it is running. You still start the session yourself over SSH — for a session waiting for you with no SSH step at all, see [start Claude from your phone](/guides/start-claude-from-your-phone/). **You need:** a VPS (tested on Debian and Ubuntu). ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Add Claude Code, with Remote Control on by default ``` devmachine packages add claude-code --workspace acme devmachine workspaces edit acme --set claude-code.remote_control_at_startup=true devmachine sync ``` `remote_control_at_startup` connects every session to Remote Control as it opens, instead of waiting for somebody to type `/rc`. ### 2. Log in as acme, once ``` devmachine login claude --workspace acme ``` This opens a real terminal, so a person is there to finish the sign-in — see [credentials](/concepts/credentials/). ### 3. Start a session ``` devmachine ssh acme claude ``` With `remote_control_at_startup` on, Claude Code prints a session URL and a QR code as the session opens. The login is inside tmux, so you can close the terminal and Claude keeps running. Without `remote_control_at_startup`, run `/rc` inside the session to get the same thing. ### 4. Open it from the phone Install the Claude app ([iOS](https://apps.apple.com/us/app/claude-by-anthropic/id6473753684), [Android](https://play.google.com/store/apps/details?id=com.anthropic.claude)), scan the QR code, or find the session by name under **Code** in the app. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Install Claude Code on my devmachine workspace acme with Remote Control on by default. ``` The agent adds the package and sets `remote_control_at_startup`, then runs `sync`. Two steps stay yours: `devmachine login claude --workspace acme` opens a real terminal for you to finish the sign-in, and scanning the QR code on the phone. **Check it:** a message sent from the phone appears in the terminal, and a reply typed in the terminal appears on the phone. Source: [Claude Code — Remote Control](https://code.claude.com/docs/en/remote-control) --- # https://mydevmachine.sh/guides/start-claude-from-your-phone/ Keep a Claude Code Remote Control session up on a workspace, so you can open it from the phone at any time — no SSH session to start first, no terminal left open on your computer. **You need:** [Claude Code, controlled from your phone](/guides/claude-code-remote-control/) done first: a workspace with `claude-code` installed and `acme` already signed in with `devmachine login claude --workspace acme`. ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## What `claude-remote-control` does It runs `claude remote-control` in the background on the server, and starts it again on its own after a crash, a network drop, or a reboot — so a session is always waiting for you, even with nobody logged in. It only starts once the account has signed in to `claude`; with no sign-in yet, `sync` tells you that instead of trying anyway. ## By hand ### 1. Add the package ``` devmachine packages add claude-remote-control --workspace acme devmachine sync ``` ### 2. Point it at a project, if you want one specific directory ``` devmachine workspaces edit acme --set claude-remote-control.working_directory=/home/acme/app devmachine sync ``` Empty keeps the default, `~/dev`. ### 3. Open it from the phone In the Claude app, tap **Code**, and find the session named `acme` (or the `session_name` you set) in the list — no SSH needed. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Add claude-remote-control to my devmachine workspace acme, working directory /home/acme/app. ``` The agent adds the package, sets `working_directory`, and runs `sync`. If `acme` has not signed in to `claude` yet, `sync` says so — that sign-in step (`devmachine login claude --workspace acme`) is yours to do, since it opens a real terminal for you. **Check it:** the session shows a green status dot, online, and a message typed there reaches the machine. Source: [Claude Code — Remote Control](https://code.claude.com/docs/en/remote-control) --- # https://mydevmachine.sh/guides/openclaw-in-its-own-sandbox/ Give [OpenClaw](https://openclaw.ai/) a machine to act on, not your laptop. It runs around the clock in a sandbox of its own: a workspace, which is a separate account on your server with its own files and logins, no `sudo`, and no way into your other workspaces. Whatever the agent installs, or breaks, stays inside it. **You need:** a VPS (tested on Debian and Ubuntu). ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new agent devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Install OpenClaw ``` devmachine ssh agent curl -fsSL https://openclaw.ai/install.sh | bash ``` The installer sets up Node itself if the account has none. A workspace is its own account, so this never touches `acme` or any other workspace — see [machines and workspaces](/concepts/machines-and-workspaces/). ### 2. Keep it running ``` openclaw onboard ``` `openclaw onboard` walks through first-time setup, then runs the Gateway in the foreground. You do not need to start tmux: the login is already in tmux, and it stays alive after you log out. Detach with `Ctrl-b d`, or just close the terminal. To make it survive a reboot too, see OpenClaw's own docs on running it as a background service (`openclaw onboard --install-daemon`). ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Create a devmachine workspace called agent and install OpenClaw in it. ``` The agent creates the workspace, runs `sync`, then installs OpenClaw over SSH and starts `openclaw onboard`. You still approve `sync` when it asks, and OpenClaw's own onboarding — any account or key it asks for — is yours to answer. **Check it:** `devmachine ssh agent` again. You land back in the same session, and the Gateway is still running. Source: [OpenClaw — Install](https://docs.openclaw.ai/install) --- # https://mydevmachine.sh/guides/keep-sessions-running/ Every SSH login to a devmachine workspace lands inside a tmux session. Start Claude Code there, close your laptop or lose Wi-Fi, and it is still working when you reconnect. This guide shows it with Claude Code, but it works the same for any long task. **You need:** nothing beyond [Getting started](/getting-started/). ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Add Claude Code and sign in ``` devmachine packages add claude-code --workspace acme devmachine sync devmachine login claude --workspace acme ``` `login` opens a real terminal so you can finish the sign-in yourself — see [credentials](/concepts/credentials/). ### 2. Start a session ``` devmachine ssh acme claude ``` `ssh` puts you inside the workspace's tmux session, named `main`. `claude` now runs inside that tmux session, not just inside your SSH connection. ### 3. Give it a long task Ask it to do something that takes a few minutes — a refactor, a test run, anything that keeps it working after you stop watching. ### 4. Close the terminal Close the terminal window, or just let your laptop sleep. The SSH connection drops, but tmux, and Claude Code inside it, keep running on the server. ### 5. Come back ``` devmachine ssh acme ``` You land back in the same tmux session, with Claude Code still running and the task further along, or done. On a flaky connection, use `devmachine mosh acme` instead — mosh survives a dropped or roaming connection where SSH just breaks. ## tmux basics that matter here - **Detach without stopping anything:** `Ctrl-b d`. This is what closing the terminal does for you automatically, but you can also do it on purpose and keep the connection open. - **List sessions:** `tmux ls`. - **Reattach by hand:** `tmux attach -t main`, if you ever end up outside the session `devmachine ssh` would normally put you in. - **A second connection gets its own session.** Open a second `devmachine ssh acme` while the first is still attached, and you get a new tmux session, not a shared view of the first one — so two terminals never fight over the same screen. A reboot stops everything, tmux included. Turn this behavior off with the [`zsh.tmux_auto_attach`](/reference/settings/) setting if you would rather land in a plain shell. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Add Claude Code to my devmachine workspace acme, sign me in, and start a session there. ``` The agent runs `packages add claude-code --workspace acme` and `sync`, hands you `devmachine login claude --workspace acme` to sign in yourself, then opens `devmachine ssh acme` and starts `claude`. From there, you close the terminal and come back the same way as above. **Check it:** close your terminal mid-task, wait a minute, then `devmachine ssh acme` — the same tmux session is there, and the task has kept moving. Source: [Claude Code](https://code.claude.com), [tmux](https://github.com/tmux/tmux/wiki) --- # https://mydevmachine.sh/guides/share-a-session/ Someone wants to watch Claude Code work, or help you in a shell. The [`session-share`](https://github.com/mydevmachine/session-share) package lets them join one of the workspace's tmux sessions, in a browser or over SSH, read only or typing along. When the time you chose runs out, they are disconnected and your session keeps running. **You need:** a workspace, and a tmux session in it. Every [`devmachine ssh`](/guides/keep-sessions-running/) login already gives you one. ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. ## From the app With the `session-share` package on the workspace (step 1 below), right-click the session in the sidebar and choose **Share…**. Pick how long, and whether they only watch or can type. The first share of a workspace publishes its share server at `share-.`, so the link works for anyone. Copy the link and the password: the password shows only there. While it is shared, the session has a mark beside its name. Right-click it for **Open chat**, **Add 30 minutes** and **Stop sharing**. The chat opens in the context panel: guests write from the shared page, you answer there. Settings → Shares lists every share this Mac started. ## By hand ### 1. Add the package ``` devmachine packages pin devmachine packages add session-share --workspace acme devmachine sync ``` `packages pin` moves you to the packages release that has `session-share`. ### 2. Find the session ``` devmachine run --argv --workspace acme -- tmux ls ``` The session `devmachine ssh acme` opens is called `main`. ### 3. Share it ``` devmachine run --package session-share --workspace acme -- start main --mode read --for 1h ``` ``` Sharing "main" (read only) until 16:40. Link: http://127.0.0.1:7690/s/k3j2abcdwxyz/ Only this machine can open it. Publish it with: session-share expose Password: v3bd-28s5-nave-dvcg Send it apart from the link. Stop: session-share stop k3j2abcdwxyz ``` Always pass `--workspace`. The share runs as the workspace's account, which owns its tmux sessions; without it the command would run as root. `--mode write` lets them type too. `--for` takes anything from `1m` to `24h`. ### 4. Give the link a public address The link above only works on the machine. Publish the share server once, at a name of your own: ``` devmachine expose add acme 7690 --host share.example.com devmachine run --package session-share --workspace acme -- expose proxy --url https://share.example.com ``` From then on every share's link starts with `https://share.example.com`. A machine with no public address can use Tailscale Funnel instead, at a `ts.net` name: `-- expose funnel`. Send the link and the password through different channels. They open the link, type the password and see the session. ### 5. Or let them in over SSH ``` devmachine run --package session-share --workspace acme -- start main --ssh-github bob --no-web --for 1h ``` Their GitHub keys can log in to the workspace's account for that hour, and land straight in the shared session: no shell, no tunnels, no other command. They connect with `ssh -t` to the account and the machine's address. ### 6. Talk to them The shared page has a chat beside the session. Up to five people can be there at once; `--max-viewers` changes it. Answer from your terminal: ``` devmachine run --package session-share --workspace acme -- chat k3j2abcdwxyz --message "I'll push the fix now" devmachine run --package session-share --workspace acme -- chat k3j2abcdwxyz --follow ``` The chat is text only. Nothing written there reaches the session. ### 7. Stop, or give them more time ``` devmachine run --package session-share --workspace acme -- list devmachine run --package session-share --workspace acme -- extend k3j2abcdwxyz --for 30m devmachine run --package session-share --workspace acme -- stop k3j2abcdwxyz ``` `stop` disconnects them within a second. ## What they can do | | read | write | |---|---|---| | See the shared session, live | yes | yes | | See your other sessions | no | no | | Run a tmux command: kill the session, open a window, detach you | no | no | | Type into the program in the session | no | yes | **Write means trust.** Someone who can type into a shell, or approve a tool in Claude Code, runs commands as the workspace's account. Keep write shares short, and for people you would hand your keyboard to. ## With your agent ```text Share the main tmux session of my devmachine workspace acme with bob for an hour, read only. ``` The agent adds the package if it is missing, runs `start`, and hands you the link and the password to pass on. **Check it:** open the link in a private window, sign in, and watch your session move as you type in it. `-- list` shows one viewer. Source: [session-share](https://github.com/mydevmachine/session-share), [tmux](https://github.com/tmux/tmux/wiki) --- # https://mydevmachine.sh/guides/claude-that-never-sleeps/ Start Claude Code on a workspace, turn on Remote Control with one command typed inside the session, and open the same conversation from the Claude app on your phone or from Claude Desktop — while it keeps running on the server, inside tmux, even after you close your laptop. This guide uses nothing but the `claude-code` package and the `/rc` command Claude Code already ships with. For a version that reconnects itself after a crash or a reboot with no command to type, see the note at the bottom. **You need:** workspace `acme` with `claude-code` installed — see [Getting started](/getting-started/). A Claude Pro, Max, Team, or Enterprise plan; Remote Control does not work with an API key. ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Add Claude Code ``` devmachine packages add claude-code --workspace acme devmachine sync ``` ### 2. Sign in, once ``` devmachine login claude --workspace acme ``` This opens a real terminal so you can finish the sign-in yourself — see [credentials](/concepts/credentials/). Remote Control needs a real claude.ai sign-in, not an API key. ### 3. Start a session ``` devmachine ssh acme claude ``` `ssh` lands you inside the workspace's tmux session before Claude Code even starts. ### 4. Turn on Remote Control Inside the running session, type: ``` /rc ``` Claude Code shows a one-time confirmation the first time you do this; accept it. It then prints a session URL and a QR code, and the terminal shows an `/rc active` indicator. ### 5. Open it from another device Scan the QR code with the Claude app, or open [claude.ai/code](https://claude.ai/code) and find the session by name — a connected session shows a computer icon with a green status dot. From there you can read the conversation, send messages, and see what Claude is doing, from your phone or from Claude Desktop. ## Why closing the laptop does not stop it Remote Control itself only keeps a session alive while the local `claude` process keeps running — closing the terminal that started it normally takes the session offline with it. The official docs say the fix is to run it inside `tmux` or `screen` on the remote machine. On devmachine, every workspace login already opens inside tmux (see [keep your sessions running](/guides/keep-sessions-running/)), so this is already true for you: close your laptop, and the `claude` process, and the Remote Control session with it, keep running on the server. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Add Claude Code to my devmachine workspace acme, sign me in, and start a session there so I can turn on Remote Control. ``` The agent runs `packages add claude-code --workspace acme` and `sync`, hands you `devmachine login claude --workspace acme` to sign in yourself, then opens `devmachine ssh acme` and starts `claude`. Typing `/rc` and accepting the confirmation is yours to do — that decision is not one an agent should make for you. **Check it:** send a message from the Claude app on your phone; it shows up in the terminal on the server, and a reply typed there shows up on the phone. ## Want this without typing `/rc` yourself? The `claude-remote-control` package does the same thing automatically — starting the session on its own, and starting it again after a crash, network drop, or reboot, with nobody logged in. See [start Claude from your phone](/guides/start-claude-from-your-phone/). Source: [Claude Code — Remote Control](https://code.claude.com/docs/en/remote-control) --- # https://mydevmachine.sh/guides/scheduled-tasks/ Write a prompt once, say when, and a coding agent does the work in your workspace on that schedule: on the 1st of every month it briefs you on last month, every weekday morning it writes your standup, every Friday it drafts the release notes. A plain shell command works too. Each run keeps its status and its output, and your computer can be off the whole time. **You need:** a workspace, `acme` here, on a machine devmachine reaches over SSH — see [Getting started](/getting-started/). For a prompt, `claude-code` or `codex` in that workspace, signed in once. ## Why run it in your own workspace A scheduled task runs where you chose, with what is already there. - **Your setup, as it is.** The task runs as the workspace's account, in the folder you pick, through its login shell. The repository, its tools from `mise` or Homebrew, its `.env`, its database: all where the task expects them. Nothing to rebuild in a cloud runner. - **Your agent's connectors and skills.** A prompt starts with that account's Claude or Codex login, its skills and its MCP servers. If Linear, Gmail or Slack is connected there, "email me the summary" just works. No token is copied anywhere else. - **The machine you pick.** Put it on an always-on VPS and it runs with your laptop closed. Put it on the machine next to the data, or the one with the GPU. Each workspace keeps and runs its own tasks. - **Kept apart.** A task in `acme` sees only `acme`'s account: its files, its logins. A client's task never reaches another client's workspace — see [one consultant, three startups](/guides/one-consultant-three-startups/). - **Any agent, your choice of model.** Claude or Codex today, with the model and the permission mode you pick per task; or no agent at all, just a command. - **Nothing new to pay for or trust.** It is a timer on your machine and the devmachine you already run. The record of every run stays in the workspace. ## From the app 1. Open **Scheduled**, the clock at the bottom of the sidebar. 2. **New task**: name it, pick the workspace and the folder. 3. Choose **Prompt**, write it, and pick the agent, its permission mode and the model. Or choose **Command** and write the command. 4. Pick when: once, hourly, daily, weekdays, weekly or monthly, and the time. 5. **Create**. The first task in a workspace sets it up for you: it adds the `scheduled` package and syncs the machine, which takes a minute or two. 6. Press **Run now** in the task's menu to try it. Click the task to see its runs; click a run to read what it printed. ## By hand ``` devmachine scheduled add --workspace acme --name "Monthly briefing" \ --folder ~/acme-web --harness claude --model opus --permission-mode auto \ --prompt "Brief me on last month in acme: what shipped, the pull requests still open, Sentry's new errors and the deploys. Keep it to one page and email it to me." \ --every monthly --day 1 --at 09:00 --yes ``` `--yes` sets up the `scheduled` package on `acme` if it has none. Then: ``` devmachine scheduled list devmachine scheduled run --workspace acme # try it now devmachine scheduled runs --workspace acme # when it ran, how it ended devmachine scheduled log --workspace acme ``` Every flag is in [the command reference](/reference/commands/#scheduled). ## Ask your agent instead With [devmachine's skills](/concepts/agent-skills/) in any Claude Code or Codex session: ``` Schedule a monthly briefing on acme: on the 1st at 9:00, Claude reads last month's merged pull requests, open issues and Sentry errors in ~/acme-web and emails me a one-page summary. ``` ## Ideas to start from | When | What it runs | | --- | --- | | 1st of the month, 09:00 | Brief me on last month in acme: what shipped, the pull requests still open, Sentry's new errors and the deploys. Email it to me. | | Weekdays, 08:30 | Read yesterday's commits and Linear updates and write my standup in `standup.md`. | | Fridays, 16:00 | Draft release notes from this week's merged pull requests, grouped by area, and open them as a pull request. | | Daily, 07:00 | Read Sentry's new issues from the last day, open a Linear ticket for each one that is not a duplicate, and post the list in #eng. | | Mondays, 07:00 (command) | `npm outdated && npm audit --omit=dev` | | Daily, 02:00 (command) | `./scripts/backup.sh --to s3://beta-backups` | | Sundays, 20:00 | Delete the local and remote branches already merged into main, and tell me which. | | Once, a date you pick | Check that the certificate for shop.example.com renews and the site answers. | ## Good to know - **Pick `auto` for a prompt that uses a connector.** Nobody is there to approve a tool. `acceptEdits` approves file edits only, so a call to Linear or email is refused. A mode that never asks at all, such as `bypassPermissions`, needs your explicit yes. - **Times are in your timezone**, the one your computer had when you created the task, whatever the server's clock says. - **A run the machine was off for is recorded as missed, not run late.** If the next time comes while a run still goes, it is skipped. - **A run stops after 30 minutes** unless the task says longer (up to 6 h). How it works, and why it is built this way, is in [scheduled tasks](/how-it-works/scheduled-tasks/). An error you meet is explained in [troubleshooting](/troubleshooting/). --- # https://mydevmachine.sh/guides/one-consultant-three-startups/ A freelance developer works for three clients at once: Acme, a Django shop; Globex, a Next.js team; Initech, still on Rails. Three different stacks, three different GitHub orgs, three Claude Code accounts billed to three different people. One laptop, and until now, one tangled `~/dev` folder where a stray `.env` from Acme could leak into a Globex repo without anyone noticing. The fix is one VPS, three sandboxes: the workspaces `acme`, `globex` and `initech`. Each is an isolated environment, its own Linux account with its own files, its own language runtime and its own logins. Nothing crosses between them, because nothing is shared between them. **You need:** a Linux VPS (tested on Debian and Ubuntu) with 12 GB of RAM or more, and GitHub and Claude accounts for each client (invented here as `acme`, `globex`, `initech`). ## Before you start: machine and skills ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add ``` Already have a machine? Skip `setup`. See [getting started](/getting-started/) for what each command does. The three workspaces come next, one per client. ## By hand ### 1. A workspace per client ``` devmachine workspaces new acme devmachine workspaces new globex devmachine workspaces new initech devmachine sync ``` Each `workspaces new` only edits the configuration; `sync` builds all three Linux accounts on the server in one pass. See [machines and workspaces](/concepts/machines-and-workspaces/) for what a workspace actually isolates: files, shell history, environment variables, and any credential you sign in with inside it. ### 2. Docker, for each client's services Each startup runs its database and services in Docker: Postgres for Acme, Redis for Globex, MySQL for Initech. Install Docker once on the machine, and let each workspace use it: ``` devmachine packages add docker devmachine workspaces edit acme --set 'workspace.groups=[docker]' devmachine workspaces edit globex --set 'workspace.groups=[docker]' devmachine workspaces edit initech --set 'workspace.groups=[docker]' devmachine sync ``` Then each client's `docker compose up -d` runs inside its own workspace. One thing is not separated: the three workspaces share one Docker engine, and the `docker` group can do almost anything on the server, so a workspace in it can see and stop the other clients' containers. Name each project after its client (`docker compose -p acme up -d`) to keep them apart. > **Hint: plan for memory.** This setup needs real compute and RAM. Three > stacks with their own databases, plus a coding agent in each, add up fast: > plan for **12 GB of RAM or more** once you run several Docker services at > the same time. `devmachine stats` shows what the machine is spending. ### 3. Each stack, pinned inside its own workspace Every workspace already has `mise` from the default packages. Inside each one, pin the version the client's codebase needs: ``` devmachine ssh acme mise use -g python@3.12 ``` ``` devmachine ssh globex mise use -g node@22 ``` ``` devmachine ssh initech mise use -g ruby@3.3 ``` `mise use -g` writes the choice to that account's own global config, so Acme's Python version has no effect on Globex or Initech — each workspace keeps its own. ### 4. Sign in to GitHub, per client where it matters The GitHub login is shared by every workspace on the machine unless a workspace says otherwise. If a client's org needs its own GitHub account, tell that workspace to keep its own, then sign in inside it: ``` devmachine workspaces edit acme --share gh=own devmachine sync devmachine login gh --workspace acme ``` If two clients happen to share your personal GitHub account, sign in once and let every workspace share it instead — see [sharing a login](/how-it-works/sharing-a-login/). ### 5. Claude Code, one account per client ``` devmachine packages add claude-code --workspace acme devmachine packages add claude-code --workspace globex devmachine packages add claude-code --workspace initech devmachine sync devmachine login claude --workspace acme devmachine login claude --workspace globex devmachine login claude --workspace initech ``` Claude Code needs its own sign-in per workspace — it is not the kind of login you share. `login` opens a real terminal for each one, so you can pick the right account when it asks. ### 6. A preview URL, if a client wants one ``` devmachine expose add globex 3000 --host globex.example.com --publish ``` Caddy came with `setup` (it's in the `essentials` package) and serves every client's preview from its own domain — see [publishing](/concepts/publishing/). If your machine was set up with `--no-essentials`, or before CLI v0.7.14, add it first: `devmachine packages add caddy` and `devmachine sync`. ## Why this works **Nothing leaks between clients.** Files, shell history, environment variables, and every credential live inside one workspace's own account. Acme's `.env` cannot end up in a Globex `git status` by accident, because Acme's files are not on Globex's filesystem at all. **One broken setup stays broken in one place.** If Initech's Ruby version mismatch breaks `bundle install`, that breaks inside `initech` only. `acme` and `globex` never see it. **Switching clients is one command:** ``` devmachine ssh globex ``` No `cd`, no unsetting environment variables, no `nvm use` juggling — the workspace you land in already has the right runtime, the right logins, and nothing else. **Ending a contract is one command too:** ``` devmachine workspaces destroy initech ``` This deletes the Linux account, everything under its home directory, and its Caddy routes — it asks you to type the workspace name again first, since there is no undo. DNS records for anything you exposed are left as they are; take those down by hand if the domain should stop pointing here. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Set up a devmachine workspace called globex for a Next.js project: add Claude Code, give it Docker for its Redis, pin Node 22 with mise, and expose port 3000 at globex.example.com. ``` The agent creates the workspace, adds `claude-code` and `docker` (and `caddy` too, if `setup` ran with `--no-essentials`), puts `globex` in the `docker` group, runs `mise use -g node@22` over SSH, then `expose add` — showing you the plan of each `sync` first. Signing in to GitHub and Claude Code stays yours to do, since those are browser and device logins nobody else can finish for you. **Check it:** `devmachine ssh globex` drops you into a shell with `node -v` reporting 22, while `devmachine ssh acme` on the same machine still reports whatever Python version Acme's project needs — the two never mix. Source: [mise — `use`](https://mise.jdx.dev/cli/use.html) --- # https://mydevmachine.sh/guides/hermes-agent-in-its-own-sandbox/ Run [Hermes Agent](https://github.com/NousResearch/hermes-agent), Nous Research's open source agent, always on, in a sandbox of its own: a workspace `hermes`, which is a separate account on your server with its own files and model keys, no `sudo`, and no way into your other workspaces. **You need:** nothing beyond [Getting started](/getting-started/). ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new hermes devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Install Hermes Agent ``` devmachine ssh hermes curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash ``` The installer sets up Python, Node and the other tools Hermes needs itself, so the workspace does not need them added first. ### 2. Add a model ``` hermes setup --portal ``` This walks through picking a model. It supports the Nous Portal (one login covers a model plus its tool set), or your own OpenAI or OpenRouter key — `hermes model` switches later, and `hermes config set` stores a key by hand. Whichever you pick, the choice and the key stay in this workspace's own account, never in your configuration. ### 3. Start it, and keep it running ``` hermes ``` You do not need tmux yourself: every SSH login to a workspace already lands in a tmux session called `main` (the `zsh` package does this), and it stays up after you log out. Detach with `Ctrl-b d`, or just close the terminal — `devmachine ssh hermes` puts you back in the same session. For messaging apps (Telegram, Discord, Slack, WhatsApp, Signal) instead of the terminal, run `hermes gateway setup` then `hermes gateway start`. To make Hermes survive a reboot too, not just a closed terminal, see the project's own docs on daemon and background backends. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Create a devmachine workspace called hermes and install Hermes Agent in it, following the project's own install script. ``` The agent creates the workspace, SSHes in, and runs the installer. Picking a model and running `hermes setup --portal` (or handing over an API key) is yours to do — a login or a key is not something the agent can do for you. **Check it:** `devmachine ssh hermes` again, then `hermes` — it comes back to a working session with the model you configured. Source: [Hermes Agent](https://hermes-agent.nousresearch.com/), [Hermes Agent on GitHub](https://github.com/NousResearch/hermes-agent) --- # https://mydevmachine.sh/guides/agno-agentos-with-control-plane/ Run [Agno AgentOS](https://docs.agno.com/agent-platform/overview), the runtime that serves your agents over a REST API, in an isolated workspace `agents`, next to the [AgentOS control plane](https://github.com/djalmaaraujo/agentos-control-plane), a small open dashboard that talks to it. Both end up live at their own subdomain, with HTTPS. **You need:** a Linux VPS (tested on Debian and Ubuntu), and a domain such as `agents.example.com` pointed at it (or a DNS provider package installed, so `expose add` points it for you — see [DNS](/concepts/dns/)). ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new agents devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Add Docker and the docker group ``` devmachine packages add docker devmachine workspaces edit agents --set 'workspace.groups=[docker]' devmachine sync ``` Caddy came with `setup` (it's in the `essentials` package) and will answer both exposed sites. If your machine was set up with `--no-essentials`, or before CLI v0.7.14, add it too: `devmachine packages add caddy`. Docker runs the control plane's container; putting `agents` in the `docker` group is a lot of trust for one workspace — [workspaces](/reference/commands/#workspaces) says why. ### 2. Run AgentOS ``` devmachine ssh agents mise use -g python@3.12 curl -LsSf https://astral.sh/uv/install.sh | sh uv venv && source .venv/bin/activate uv pip install -U 'agno[os]' ``` Write the app AgentOS's own quickstart gives — one agent, a database, and the `AgentOS` object: ```python # my_os.py from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.os import AgentOS assistant = Agent( name="Assistant", model="openai:gpt-5.5", db=SqliteDb(db_file="agno.db"), ) agent_os = AgentOS(agents=[assistant], db=SqliteDb(db_file="agno.db")) app = agent_os.get_app() if __name__ == "__main__": agent_os.serve(app="my_os:app", reload=True) ``` Set a model key first (`export OPENAI_API_KEY=...`, per the provider you picked), then start it, bound to this workspace only: ``` export OS_SECURITY_KEY=$(openssl rand -hex 32) python my_os.py ``` `OS_SECURITY_KEY` turns on the shared-token check: every request needs `Authorization: Bearer `, or it gets a 401. AgentOS's own docs say to use its JWT-based authorization instead for a production deployment — this guide uses the security key because it is the simpler one, and the control plane only needs the one token anyway. Leave the terminal running: the SSH login is already inside tmux, so it keeps going after you log out — `devmachine ssh agents` puts you back. AgentOS listens on port `7777` by default. ### 3. Run the control plane Still in the workspace, in a new pane or window: ``` git clone https://github.com/djalmaaraujo/agentos-control-plane.git cd agentos-control-plane cp .env.example .env ``` Edit `.env`: set `AGENTOS_UPSTREAM` to reach AgentOS, and `OS_SECURITY_KEY` to the same value you started it with. The project's `compose.yaml` already maps `host.docker.internal` to the server, so the container reaches AgentOS on port `7777`: ``` AGENTOS_UPSTREAM=http://host.docker.internal:7777 OS_SECURITY_KEY= CP_AUTH_TOKEN=
``` ``` docker compose up -d --build ``` In `compose.yaml`, change the port line from `"8810:80"` to `"127.0.0.1:8810:80"`. Docker opens a published port past the firewall, so without this the dashboard would also answer at `http://:8810`, with no HTTPS. With it, the dashboard is reachable only through Caddy. Run `docker compose up -d --build` again after the change. The container listens on port `8810`. `CP_AUTH_TOKEN` is optional — set it and the dashboard asks for that password before showing anything; leave it empty and anyone who reaches the URL gets in. ### 4. Expose both, on their own subdomain Back on your own computer: ``` devmachine expose add agents 7777 --host api.agents.example.com --publish devmachine expose add agents 8810 --host console.agents.example.com --publish ``` AgentOS is the one with real access to your agents, so leaving `OS_SECURITY_KEY` (or JWT authorization) on before this step matters — once it is public, the token is the only thing standing between the internet and your agents. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text In my devmachine workspace agents, set up Agno AgentOS with uv, running on port 7777 with OS_SECURITY_KEY set, then run the agentos-control-plane Docker container pointed at it on port 8810. Expose AgentOS at api.agents.example.com and the control plane at console.agents.example.com. ``` The agent adds `docker` (and `caddy` too, if `setup` ran with `--no-essentials`), puts `agents` in the `docker` group, installs `uv` and Agno over SSH, writes the AgentOS app, starts both processes, then runs `expose add` twice. You still approve `sync` when it asks, pick and type in the model API key yourself, and choose the `OS_SECURITY_KEY` and `CP_AUTH_TOKEN` values — the agent should not be generating the tokens that guard your own agents. **Check it:** `curl -H "Authorization: Bearer " https://api.agents.example.com/config` returns AgentOS's own config, and `https://console.agents.example.com` loads the dashboard, both with a valid certificate. Source: [Agno AgentOS overview](https://docs.agno.com/agent-platform/overview), [AgentOS security overview](https://docs.agno.com/agent-os/security/overview), [agentos-control-plane README](https://github.com/djalmaaraujo/agentos-control-plane) --- # https://mydevmachine.sh/guides/wuzapi-as-your-own-package/ [wuzapi](https://github.com/asternic/wuzapi) is a WhatsApp REST API: one container, one admin token, and every number you connect gets its own session. Instead of installing it by hand on every machine that needs it, this guide writes it as a [package](/concepts/packages/) — one file kept in your own configuration, that any machine or workspace can add. **You need:** two Linux VPS, tested on Debian and Ubuntu (or one, if you skip the second workspace), and a domain such as `example.com`. ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new whatsapp devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Write the package ``` devmachine packages new wuzapi --scope workspace --into ~/.config/devmachine/packages ``` This writes a skeleton that already passes `packages validate` at `/packages/wuzapi/`. `--scope workspace` is right here: a WhatsApp number belongs to one workspace, not the whole machine, so wuzapi runs once per workspace that adds it, same as the `dev` or `zsh` package. Replace `package.yml` with: ```yaml format: 1 name: wuzapi scope: workspace category: Messaging summary: wuzapi, a WhatsApp REST API, running as a Docker container of its own. needs: [workspace, docker] requires: cli: ">= 0.4.0" credentials: - name: wuzapi_admin_token kind: secret scope: workspace env: WUZAPI_ADMIN_TOKEN variables: home: summary: Where the account's home is. default: /home/ port: summary: The port wuzapi listens on, on 127.0.0.1 only. default: 8080 image_tag: summary: Which asternic/wuzapi image tag to run. default: latest ``` `needs: [workspace, docker]` means the `docker` package runs on the machine first. The credential is `kind: secret`: devmachine keeps the value in your computer's keychain, and `credentials push` writes it into the workspace, at `~/.devmachine/wuzapi_admin_token/env`. The role reads it from there and hands it to the container without printing it (`no_log`), so it is never in a file you'd commit. The container is named after the workspace, so two workspaces on one machine can each run their own. wuzapi itself needs no database: it falls back to SQLite when none is set, which is what this package leans on to stay simple — see the [package format](/reference/package-format/). `defaults/main.yml`: ```yaml --- devmachine_wuzapi_home: "/home/{{ devmachine_workspace.user }}" devmachine_wuzapi_port: 8080 devmachine_wuzapi_image_tag: latest ``` `tasks/main.yml`: ```yaml --- - name: Install the Docker SDK for Python ansible.builtin.package: name: python3-docker state: present - name: Read the admin token credentials push delivered ansible.builtin.shell: | set -a . "{{ devmachine_wuzapi_home }}/.devmachine/wuzapi_admin_token/env" printf '%s' "$WUZAPI_ADMIN_TOKEN" register: devmachine_wuzapi_token changed_when: false no_log: true - name: Run wuzapi community.docker.docker_container: name: "wuzapi-{{ devmachine_workspace.user }}" image: "asternic/wuzapi:{{ devmachine_wuzapi_image_tag }}" state: started restart_policy: unless-stopped ports: - "127.0.0.1:{{ devmachine_wuzapi_port }}:8080" env: WUZAPI_ADMIN_TOKEN: "{{ devmachine_wuzapi_token.stdout }}" no_log: true ``` ### 2. Check it ``` devmachine packages validate ~/.config/devmachine/packages/wuzapi ``` This reports every problem at once, so fix everything it names before moving on. ### 3. Add it to the first workspace ``` devmachine packages add docker devmachine packages add wuzapi --workspace whatsapp devmachine workspaces edit whatsapp --set 'workspace.groups=[docker]' devmachine secrets set whatsapp/wuzapi_admin_token devmachine credentials push devmachine sync ``` Caddy came with `setup` (it's in the `essentials` package). If your machine was set up with `--no-essentials`, or before CLI v0.7.14, add it too: `devmachine packages add caddy`. `secrets set` asks for the token without echoing it, so it never reaches your shell history. `credentials push` delivers it to the machine; `sync` installs Docker and runs the wuzapi container. ### 4. Publish it ``` devmachine expose add whatsapp 8080 --host wa.example.com --publish ``` ### 5. A second machine, a second workspace ``` devmachine machines add devmachine workspaces new whatsapp-eu --machine backup devmachine packages add docker --machine backup devmachine packages add wuzapi --workspace whatsapp-eu --machine backup devmachine workspaces edit whatsapp-eu --machine backup --set 'workspace.groups=[docker]' devmachine secrets set whatsapp-eu/wuzapi_admin_token devmachine credentials push --machine backup devmachine sync --machine backup devmachine expose add whatsapp-eu 8080 --host wa-eu.example.com --publish --machine backup ``` This is what "shared between machines" means: `wuzapi` lives once, in `/packages/wuzapi/`. It never got written twice — `whatsapp-eu` on `backup` used the exact same file `whatsapp` on `main` did. Fix a bug in `tasks/main.yml` once, and the next `sync` on either machine picks it up. ### 6. Back it up ``` devmachine setup git ``` Your configuration, package included, is now a git repository devmachine can push somewhere private. See [versioning your configuration](/how-it-works/versioning-your-configuration/). ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Write a devmachine package called wuzapi that runs asternic/wuzapi as a Docker container, scope workspace, with a secret credential for WUZAPI_ADMIN_TOKEN. Add it to workspace whatsapp, sync, and expose it at wa.example.com. ``` The agent writes the package files, runs `packages validate` until it is clean, then `packages add`, `sync`, and `expose add`. You still type the admin token into `secrets set` yourself, and approve `sync` when it asks — running a container that answers to WhatsApp is worth reading before you say yes. **Check it:** open `https://wa.example.com/login` — wuzapi's own page for connecting a number — and scan the QR code it shows with the WhatsApp app on the phone you want connected. Source: [wuzapi](https://github.com/asternic/wuzapi) --- # https://mydevmachine.sh/guides/log-in-with-1password/ Keep the key devmachine logs in with inside 1Password, instead of a file on your disk. 1Password's SSH agent hands the key over when devmachine needs it, and asks you to approve with Touch ID or your password. If you do not already keep SSH keys in 1Password, you do not need this: the key `setup` makes for devmachine is simpler, and just as safe. **You need:** a VPS (tested on Debian and Ubuntu), 1Password 8 on your computer, and an SSH key saved in 1Password. ## Before you start: machine, skills, workspace Do steps 1 to 3 below first. `setup` needs the agent running to offer its keys. ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? See step 3 for moving it to the 1Password key. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Turn on the 1Password SSH agent In 1Password, open **Settings → Developer** and turn on **Use the SSH agent**. ### 2. Point your terminal at it Add one line to `~/.zshrc` (or `~/.bashrc`), then open a new terminal. On macOS: ``` export SSH_AUTH_SOCK=~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock ``` On Linux: ``` export SSH_AUTH_SOCK=~/.1password/agent.sock ``` `ssh-add -l` now lists the keys 1Password offers. ### 3. Choose the key in `setup` ``` devmachine setup ``` When it asks how the CLI should log in, pick the line that ends in `(from the SSH agent)` with your key's fingerprint. `setup` installs that key on the server, proves it works, and turns password logins off, as usual. It records the key's public half as `agent_key:` in `config.yml`, and that is what tells devmachine to ask the agent for that one key from then on — never every key in the vault. For a machine you already set up with another key: add the 1Password key's public half to the server's `/root/.ssh/authorized_keys`, then delete the machine's `key:` line from `config.yml` and replace it with `agent_key:`, set to that same public key line. ### 4. Optional: limit what the agent offers everywhere else Step 3 is enough for devmachine itself. Plain `ssh` and anything else on your computer still ask 1Password for every key in the vault, one after another, and a vault with many keys can hit the server's limit — the error says "Too many authentication failures". Tell 1Password which key to offer, in `~/.config/1Password/ssh/agent.toml`: ```toml [[ssh-keys]] item = "devmachine" vault = "Private" ``` `item` is the key's name in 1Password, `vault` the vault it is in. Add one `[[ssh-keys]]` block per key you still want the agent to offer, such as your GitHub key. Skip this if devmachine (`ssh`, `mosh`, `run`) is the only thing you use this key for — it already offers only the one key. ### 5. Use it ``` devmachine ssh acme ``` 1Password asks you to approve, and the session opens. `devmachine ssh` and `mosh` run the system `ssh`, which reads the same `SSH_AUTH_SOCK`. `devmachine run` keeps its connection open for five minutes, so a few commands in a row ask only once. A program you open from the Dock or a launcher does not read your `~/.zshrc`. If it calls devmachine for you, it has to set `SSH_AUTH_SOCK` to the path in step 2 itself. ## With your agent Steps 1 and 4 happen in 1Password, and step 3's choice is yours, so do those by hand. Then, in a new Claude Code or Codex session on your computer (`devmachine skills add` taught it the CLI): ```text Check that devmachine logs in with my 1Password SSH key: run devmachine doctor and tell me what it says. ``` The agent runs `devmachine doctor`. 1Password asks you to approve, and every line should pass. If one says the login was refused, the agent can list the agent's keys with `ssh-add -l` and compare them with the key `setup` installed. **Check it:** `devmachine doctor` passes, and 1Password showed an approval prompt for it. Source: [1Password — SSH agent](https://www.1password.dev/ssh/agent/), [1Password — advanced use](https://www.1password.dev/ssh/agent/advanced), [1Password — agent config file](https://www.1password.dev/ssh/agent/config) --- # https://mydevmachine.sh/guides/pi-coding-agent/ [Pi](https://pi.dev) is an open-source terminal coding agent. It works like Claude Code or Codex: you point it at a project folder and it reads, edits and runs code for you, switching between many AI providers as you like. This guide installs Pi in a workspace so it runs on your server, not your laptop, and keeps working after you close the terminal. **You need:** a workspace — see [getting started](/getting-started/). ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Add the package ``` devmachine packages add pi --workspace acme devmachine sync ``` `sync` installs Pi's standalone release, not the npm package: one native program in `~/.local/share/pi`, linked from `~/.local/bin/pi`. It needs no Node, and a Node upgrade cannot break it. It also runs as a process called `pi`, which is how the Devmachine app tells a Pi session from any other. ### 2. Sign in, once ``` devmachine login pi --workspace acme ``` This starts `pi` in a real terminal. Pi has no separate login command: type `/login` inside it to connect a subscription or an API key. Pi supports many providers — Anthropic, OpenAI, Google, and others — and you can switch models later with `/model`. ### 3. Start working ``` devmachine ssh acme cd ~/dev/my-project pi ``` Pi reads any `AGENTS.md` in the project for instructions, the same way other agents do. Close the terminal any time — `devmachine ssh acme` brings you back to the same tmux session, with Pi still running. ## Teach Pi the devmachine CLI `devmachine skills add` also teaches Pi how to run devmachine commands, on your own computer: ``` devmachine skills add --agent pi ``` This helps in a session on your computer where you ask Pi to manage your machines and workspaces — not inside the workspace where Pi itself runs. ## With your agent Open a session on your own computer (`devmachine skills add --agent pi`, or the plain `devmachine skills add`, taught it the CLI) and say: ```text Install the Pi coding agent in my devmachine workspace acme. ``` The agent adds the `pi` package and runs `sync`. Signing in with `/login` is yours to do — that is your own account. **Check it:** `devmachine run --workspace acme -- pi --version` prints a version. Then start `pi` in a project folder and ask it a question about the code there. Source: [pi.dev](https://pi.dev/), [Pi coding agent on GitHub](https://github.com/earendil-works/pi) --- # https://mydevmachine.sh/guides/opencode/ [opencode](https://opencode.ai) is an open-source terminal coding agent that works with many model providers. It also ships a few free models, so it answers before you sign in to anything. This guide installs it in a workspace, so it runs on your server and keeps working after you close the terminal. **You need:** a workspace — see [getting started](/getting-started/). ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Add the package ``` devmachine packages add opencode --workspace acme devmachine sync ``` `sync` runs opencode's own installer inside the workspace's account. It puts `opencode` in `~/.opencode/bin` and that folder on the PATH. ### 2. Try it ``` devmachine ssh acme cd ~/dev/my-project opencode ``` With no login, opencode uses its own free models. You land inside tmux, so it keeps running when you close the terminal. ### 3. Connect your own provider, once ``` devmachine login opencode --workspace acme ``` This runs `opencode auth login` in a real terminal: pick a provider, then paste an API key or follow its sign-in. The keys stay in this workspace's `~/.local/share/opencode/auth.json`. ## Skills opencode reads `~/.agents/skills`, so every skill Devmachine installs there works without another step. See [agent skills](/concepts/agent-skills/). ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Install opencode in my devmachine workspace acme. ``` The agent adds the `opencode` package and runs `sync`. Connecting a provider stays yours: `devmachine login opencode --workspace acme` opens a real terminal for you to finish it. **Check it:** `devmachine run --workspace acme -- opencode --version` prints a version. Then start `opencode` in a project folder and ask it about the code. Source: [opencode docs](https://opencode.ai/docs/), [opencode CLI](https://opencode.ai/docs/cli/) --- # https://mydevmachine.sh/guides/antigravity-cli/ [Antigravity CLI](https://antigravity.google/docs/cli/overview/) (`agy`) is Google's terminal coding agent. Point it at a project folder and it reads, edits and runs code for you, with Gemini models. This guide installs it in a workspace, so it runs on your server and keeps working after you close the terminal. **You need:** a workspace — see [getting started](/getting-started/) — and a Google account or a Gemini API key. ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Add the package ``` devmachine packages add antigravity --workspace acme devmachine sync ``` `sync` runs Google's own installer inside the workspace's account. It puts `agy` in `~/.local/bin`, and from then on `agy` updates itself. ### 2. Sign in, once ``` devmachine login antigravity --workspace acme ``` This starts `agy` in a real terminal. Over SSH it does not open a browser: it prints a link. Open the link on your computer, sign in with Google, and paste the code back into the terminal. See [why a login cannot be automated](/how-it-works/why-a-login-cannot-be-automated/). With a Gemini API key instead, set `"modelProvider": "gemini"` in `~/.gemini/antigravity-cli/settings.json` and export the key as `GEMINI_API_KEY` in the workspace. `agy` reads it only from the environment. ### 3. Start working ``` devmachine ssh acme cd ~/dev/my-project agy ``` You land inside tmux, so `agy` keeps running when you close the terminal. `devmachine ssh acme` brings you back to the same session. ## Skills Antigravity CLI reads its skills from `~/.gemini/antigravity-cli/skills`, not from `~/.agents/skills`. Devmachine links each skill there for you: in a workspace with this package, and on your computer with `devmachine skills add --agent antigravity`. See [agent skills](/concepts/agent-skills/). ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Install the Antigravity CLI in my devmachine workspace acme. ``` The agent adds the `antigravity` package and runs `sync`. Signing in stays yours: `devmachine login antigravity --workspace acme` opens a real terminal for you to finish it. **Check it:** `devmachine run --workspace acme -- agy --version` prints a version. Then start `agy` in a project folder and ask it about the code. Source: [Antigravity CLI](https://antigravity.google/docs/cli/overview/), [installation and auth](https://antigravity.google/docs/cli/install/) --- # https://mydevmachine.sh/guides/kimi-code/ [Kimi Code](https://www.kimi.com/code/docs/en/) (`kimi`) is Moonshot AI's terminal coding agent, built for the Kimi models. This guide installs it in a workspace, so it runs on your server and keeps working after you close the terminal. **You need:** a workspace — see [getting started](/getting-started/) — and a Kimi account. ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Add the package ``` devmachine packages add kimi-code --workspace acme devmachine sync ``` `sync` runs Kimi's own installer inside the workspace's account. It puts `kimi` in `~/.kimi-code/bin` and that folder on the PATH. ### 2. Sign in, once ``` devmachine login kimi --workspace acme ``` This runs `kimi login` in a real terminal. It prints a link and a short code: open the link on any device, enter the code, and approve. The terminal waits until you do. An account on kimi.ai rather than kimi.com signs in from the workspace with `kimi login --region global`. ### 3. Start working ``` devmachine ssh acme cd ~/dev/my-project kimi ``` You land inside tmux, so `kimi` keeps running when you close the terminal. ## Skills Kimi Code reads `~/.agents/skills`, so every skill Devmachine installs there works without another step. On your computer, `devmachine skills add --agent kimi` does the same. See [agent skills](/concepts/agent-skills/). ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Install Kimi Code in my devmachine workspace acme. ``` The agent adds the `kimi-code` package and runs `sync`. Signing in stays yours: `devmachine login kimi --workspace acme` opens a real terminal for you to approve the code. **Check it:** `devmachine run --workspace acme -- kimi --version` prints a version. Then start `kimi` in a project folder and ask it about the code. Source: [Kimi Code CLI](https://www.kimi.com/code/docs/en/), [Kimi Code on GitHub](https://github.com/MoonshotAI/kimi-code) --- # https://mydevmachine.sh/guides/cline/ [Cline](https://cline.bot/cli) is an open-source coding agent. Its CLI brings the same agent to the terminal. This guide installs it in a workspace, so it runs on your server and keeps working after you close the terminal. **You need:** a workspace — see [getting started](/getting-started/). ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Add the package ``` devmachine packages add cline --workspace acme devmachine sync ``` Cline ships only through npm, so the package needs Node. `packages add` adds the `dev` package too, which brings it. `sync` installs `cline` into the workspace's own `~/.local`, so a Node upgrade does not remove it. ### 2. Sign in, once ``` devmachine login cline --workspace acme ``` This runs `cline auth` in a real terminal. Pick your Cline account, a ChatGPT subscription, or your own provider's API key. ### 3. Start working ``` devmachine ssh acme cd ~/dev/my-project cline ``` You land inside tmux, so `cline` keeps running when you close the terminal. ## Skills Cline reads its skills from `~/.cline/skills`, not from `~/.agents/skills`. Devmachine links each skill there for you: in a workspace with this package, and on your computer with `devmachine skills add --agent cline`. See [agent skills](/concepts/agent-skills/). ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Install the Cline CLI in my devmachine workspace acme. ``` The agent adds the `cline` package and runs `sync`. Signing in stays yours: `devmachine login cline --workspace acme` opens a real terminal for you to finish it. **Check it:** `devmachine run --workspace acme -- cline --version` prints a version. Then start `cline` in a project folder and ask it about the code. Source: [Cline CLI](https://cline.bot/cli), [Cline CLI reference](https://docs.cline.bot/cli/cli-reference) --- # https://mydevmachine.sh/guides/ssh-or-mosh/ `devmachine ssh` and `devmachine mosh` both open a terminal on your workspace. They pick the same tmux session, so it makes no difference which one you used last time. This page is about which to use when, and the one setting mosh needs before it works. **You need:** a workspace — see [getting started](/getting-started/). ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## What each one is good for `ssh` works everywhere, on any network, with no setup beyond what `setup` already did. It's the default, and it's enough most of the time. `mosh` is worth it when your connection is not steady: it survives a change of Wi-Fi, your laptop going to sleep, roaming between networks, and a link that drops packets. It also shows what you type right away, even on a slow connection, instead of waiting for the server to echo it back. Neither replaces tmux. `mosh` can't scroll back through old output — tmux already gives you that inside the session both commands land in. ## What has to be installed where - **On the server:** the `base` package, part of `essentials`, installs `mosh`. A machine set up with `devmachine setup` already has it. A machine started with `--no-essentials` does not, until you add `base`. - **On your computer:** `devmachine machine setup` installs `ssh` and `mosh` through Homebrew on a Mac (on Linux it tells you what to install instead). `devmachine machine doctor` says what's missing — a missing `mosh` is only a warning, since `ssh` still works. - devmachine does not bundle either program. `ssh` and `mosh` run the real system binaries, so your terminal, your SSH agent, and tmux all behave normally. ``` devmachine machine doctor devmachine machine setup ``` ## Open the UDP range for mosh Unlike `ssh`, mosh needs a UDP port range (60000–61000 by default), not just one TCP port. With the `firewall` package — part of `essentials` — that range is closed by default, on every interface. `mosh` will fail until you open it on one interface with `firewall.mosh_interface`. The recommended way is over [Tailscale](/concepts/reaching-your-server/): that keeps the range off the public internet, reachable only from your own devices. ``` devmachine packages add tailscale devmachine login tailscale devmachine sync ``` Then, in `config.yml`, set the interface under the machine's `settings:`: ```yaml machines: - name: main settings: firewall.mosh_interface: tailscale0 ``` ``` devmachine sync ``` ## By hand ### 1. Check your computer has both ``` devmachine machine doctor ``` If `mosh` is missing, install it: ``` devmachine machine setup ``` ### 2. Connect with ssh ``` devmachine ssh acme ``` Always works, and needs nothing extra. ### 3. Connect with mosh ``` devmachine mosh acme ``` Needs `firewall.mosh_interface` set on the machine, as shown above. Both commands check `/known_hosts` first, the same as any other login. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Open the mosh UDP range on my devmachine machine, over Tailscale only, then sync. ``` The agent adds `firewall.mosh_interface: tailscale0` to `config.yml` and runs `devmachine sync --check` first, then asks before applying it. Signing the server into Tailscale (`devmachine login tailscale`) is a browser step that's yours to do. **Check it:** run `devmachine ssh acme` and `devmachine mosh acme` from two different terminals — both land in the same tmux session, so anything you see in one shows up in the other. Source: [docs/reference/commands.md — ssh, mosh](/reference/commands/), [docs/how-it-works/ssh.md](/how-it-works/ssh/), [docs/concepts/reaching-your-server.md](/concepts/reaching-your-server/) --- # https://mydevmachine.sh/guides/claude-24-7-in-telegram/ Text your own Claude Code session from Telegram, any time, from your phone. Claude Code keeps running on your server; you send it a message in a Telegram chat, it does the work against your real files, and the reply comes back in the same chat — no terminal to open. This uses Claude Code's **channels** feature: a running session that reads messages pushed into it by a plugin. Anthropic marks channels a **research preview** ([code.claude.com/docs/en/channels](https://code.claude.com/docs/en/channels)): the `--channels` flag isn't even listed in `claude --help` yet, and its exact form may still change. **You need:** workspace `acme` with `claude-code` installed — see [getting started](/getting-started/). A Claude account signed in at [claude.ai](https://claude.ai), on a Pro, Max, Team, or Enterprise plan, or a Console API key (channels don't work on Bedrock, Google's Agent Platform, or Microsoft Foundry). If your account belongs to a Team or Enterprise organization, an Owner must turn channels on first, at [claude.ai/admin-settings/claude-code](https://claude.ai/admin-settings/claude-code) (**Channels**). A Telegram account, to create the bot. ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand Two places matter below: **your computer**, where you run `devmachine` commands, and **inside the workspace**, where Claude Code itself runs, which you reach with `devmachine ssh acme`. ### 1. Add Claude Code On your computer: ``` devmachine packages add claude-code --workspace acme devmachine sync ``` ### 2. Sign in, once On your computer: ``` devmachine login claude --workspace acme ``` This opens a real terminal so you finish the sign-in yourself, against your [claude.ai](https://claude.ai) account or Console API key — see [credentials](/concepts/credentials/). ### 3. Open the workspace and start Claude Code ``` devmachine ssh acme claude ``` You land inside tmux, so Claude Code keeps running after you close the terminal — see [keep your sessions running](/guides/keep-sessions-running/). ### 4. Create the Telegram bot In Telegram, open [BotFather](https://t.me/BotFather) and send `/newbot`. Give it a display name and a username ending in `bot`. BotFather gives you a token — copy it, and never paste it anywhere but the step below. ### 5. Install and configure the Telegram plugin Inside the running Claude Code session (the one from step 3): ``` /plugin install telegram@claude-plugins-official ``` If it says `Marketplace "claude-plugins-official" not found`, add it and retry: ``` /plugin marketplace add anthropics/claude-plugins-official ``` Choose the user scope when asked, so the plugin works in every session. If the install summary says `Run /reload-plugins to activate.`, run that too. Then set the token you got from BotFather: ``` /telegram:configure ``` This saves the token to `~/.claude/channels/telegram/.env`, on the server — it never appears on this page, in your devmachine configuration, or in the Telegram chat itself. ### 6. Restart with the channel on Still inside the workspace: ``` claude --channels plugin:telegram@claude-plugins-official ``` This starts the Telegram plugin, which begins polling for messages from your bot. The plugin is a [Bun](https://bun.sh) script — the workspace already has Bun from the `dev` package. ### 7. Pair your Telegram account Send any message to your bot in Telegram. It replies with a pairing code. Back in the Claude Code session: ``` /telegram:access pair ``` Then lock the bot down to your account only: ``` /telegram:access policy allowlist ``` Without this, anyone who finds your bot's username could message it. ## Keep it running The session has to stay open for messages to arrive — closing it stops the channel. Every workspace login already opens inside tmux, so once you close your laptop, `claude --channels ...` and the Telegram plugin both keep running on the server. `devmachine ssh acme` brings you back to the same session, still connected. ### When Claude needs your permission If Claude stops to ask for permission while you are away from the terminal, the session waits until somebody answers, and your Telegram messages wait with it. Give the session the permissions its work needs up front (see Claude Code's [permission modes](https://code.claude.com/docs/en/permission-modes)). `--dangerously-skip-permissions` skips most prompts, but only use it where you trust everything the session can reach: a workspace is a good place for it, because it cannot touch your other workspaces. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Add Claude Code to my devmachine workspace acme, sign me in, and start a session there so I can set up the Telegram channel. ``` The agent runs `packages add claude-code --workspace acme` and `sync`, hands you `devmachine login claude --workspace acme` to sign in yourself in the terminal it opens, then runs `devmachine ssh acme` and starts `claude`. From there, you stay in the driver's seat for everything Telegram-specific: create the bot in BotFather yourself, and when the agent runs `/plugin install telegram@claude-plugins-official`, you paste the bot token into `/telegram:configure ` yourself, inside that same session — never into the chat with the agent. Pairing your account with `/telegram:access pair ` and setting `/telegram:access policy allowlist` are also yours: only you know which Telegram account should have access. **Check it:** send a message to your bot from Telegram; it shows up in the terminal on the server as an inbound line, and Claude's reply appears back in the Telegram chat. Source: [Claude Code — Push events into a running session with channels](https://code.claude.com/docs/en/channels) --- # https://mydevmachine.sh/guides/claude-channels/ A **channel** is a small MCP server that pushes events into a Claude Code session that is already running. A webhook, a chat message or a failed CI run lands in the session, Claude works on it with your files, and answers back through a `reply` tool. At the end you have a webhook channel in workspace `acme`, at `https://hooks.example.com`, that only accepts requests with your secret. ![A message from outside arrives in the Claude Code session](/docs-assets/guides/images/claude-channels.svg) Channels are a **research preview** (Claude Code v2.1.80 or later). They need a claude.ai account or a Console API key, not Bedrock, Google Cloud or Foundry. On a Team or Enterprise plan, an Owner must turn them on first at [Claude Code settings](https://claude.ai/admin-settings/claude-code). **You need:** workspace `acme`, and a domain such as `hooks.example.com` pointed at your machine (or a DNS provider package — see [DNS](/concepts/dns/)). ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Add Claude Code and a secret On your computer: ``` devmachine packages add claude-code --workspace acme devmachine sync devmachine login claude --workspace acme devmachine secrets set WEBHOOK_SECRET --workspace acme --push ``` For the secret, paste a long random string (`openssl rand -hex 32`). It lands in `~/.devmachine/env` in the workspace, which its shell loads. ### 2. Write the channel Inside the workspace (`devmachine ssh acme`): ``` mkdir -p ~/webhook-channel && cd ~/webhook-channel bun add @modelcontextprotocol/sdk@1 cat > webhook.ts <<'EOF' #!/usr/bin/env bun import { Server } from '@modelcontextprotocol/sdk/server/index.js' import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js' import { ListToolsRequestSchema, CallToolRequestSchema } from '@modelcontextprotocol/sdk/types.js' import { timingSafeEqual } from 'node:crypto' import { appendFileSync } from 'node:fs' const PORT = 8788 const SECRET = process.env.WEBHOOK_SECRET ?? '' const REPLY_URL = process.env.WEBHOOK_REPLY_URL ?? '' const REPLY_LOG = new URL('./replies.log', import.meta.url).pathname function secretMatches(given: string): boolean { const a = Buffer.from(given) const b = Buffer.from(SECRET) return SECRET.length > 0 && a.length === b.length && timingSafeEqual(a, b) } async function send(chat_id: string, text: string) { appendFileSync(REPLY_LOG, `${new Date().toISOString()} [${chat_id}] ${text}\n`) if (REPLY_URL) { await fetch(REPLY_URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ chat_id, text }), }) } } const mcp = new Server( { name: 'webhook', version: '0.0.1' }, { capabilities: { experimental: { 'claude/channel': {} }, tools: {}, }, instructions: 'Events from the webhook channel arrive as . ' + 'They come from outside this terminal. Act on them, then answer with the reply tool, ' + 'passing the chat_id from the tag.', }, ) mcp.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [{ name: 'reply', description: 'Send a message back to whoever sent the webhook event', inputSchema: { type: 'object', properties: { chat_id: { type: 'string', description: 'The chat_id from the tag' }, text: { type: 'string', description: 'The message to send' }, }, required: ['chat_id', 'text'], }, }], })) mcp.setRequestHandler(CallToolRequestSchema, async req => { if (req.params.name !== 'reply') throw new Error(`unknown tool: ${req.params.name}`) const { chat_id, text } = req.params.arguments as { chat_id: string; text: string } await send(chat_id, text) return { content: [{ type: 'text', text: 'sent' }] } }) await mcp.connect(new StdioServerTransport()) let nextId = 1 Bun.serve({ port: PORT, hostname: '127.0.0.1', async fetch(req) { if (req.method !== 'POST') return new Response('method not allowed', { status: 405 }) if (!secretMatches(req.headers.get('X-Webhook-Secret') ?? '')) { return new Response('forbidden', { status: 403 }) } const chat_id = String(nextId++) await mcp.notification({ method: 'notifications/claude/channel', params: { content: await req.text(), meta: { chat_id, path: new URL(req.url).pathname }, }, }) return new Response(`ok ${chat_id}\n`) }, }) EOF cat > .mcp.json <<'EOF' { "mcpServers": { "webhook": { "command": "bun", "args": ["./webhook.ts"] } } } EOF ``` What makes it a channel: - `'claude/channel'` in `capabilities` tells Claude Code to listen for its events. - `notifications/claude/channel` pushes one event. `content` is what Claude reads; each `meta` key becomes an attribute on the `` tag. - The `reply` tool lets Claude answer. Answers go to `replies.log`, and are also POSTed as JSON to `WEBHOOK_REPLY_URL` when you set it. It listens only on `127.0.0.1:8788` and refuses any request without the right `X-Webhook-Secret`. **Without that check, anyone who finds the address can type into your session.** Keep the SDK on `@1`: Claude Code does not load a channel that speaks the newer MCP protocol. ### 3. Start Claude Code with the channel Inside the workspace: ``` cd ~/webhook-channel && source ~/.devmachine/env claude --dangerously-load-development-channels server:webhook ``` Accept the three prompts: trust the folder, use the `webhook` MCP server, and "I am using this for local development". A channel you wrote yourself is not on Anthropic's allowlist, so it needs this flag. The banner then shows `Channels (experimental) messages from server:webhook`. ### 4. Send an event Inside the workspace, in a second tmux window (`Ctrl-b c`): ``` curl -X POST localhost:8788 -H "X-Webhook-Secret: $WEBHOOK_SECRET" \ -d "Reply with the word pong using the reply tool." curl -X POST localhost:8788 -d "no secret" ``` The first prints `ok 1`, the second `forbidden`. Back in the Claude window (`Ctrl-b n`), the event shows as `← webhook: Reply with the word pong...`, and Claude answers. Claude sees it as: ``` Reply with the word pong using the reply tool. ``` ### 5. Send it from outside On your computer: ``` devmachine expose add acme 8788 --host hooks.example.com --publish read -s WEBHOOK_SECRET curl -X POST https://hooks.example.com/ci -H "X-Webhook-Secret: $WEBHOOK_SECRET" \ -d "CI run 1234 failed on main. Find why and reply in one sentence." ``` The path (`/ci`) reaches Claude as `path="/ci"`, so one channel can tell senders apart. ## What you can plug in - **Telegram:** no code — use the official plugin, as in [Claude 24/7 in Telegram](/guides/claude-24-7-in-telegram/). - **WhatsApp:** point the webhook of [wuzapi](/guides/wuzapi-as-your-own-package/) at `https://hooks.example.com/whatsapp`, and change `send()` to call wuzapi's send-message endpoint. - **GitLab:** it sends its secret as `X-Gitlab-Token`; change the header name. - **GitHub:** it signs the body (`X-Hub-Signature-256`); swap `secretMatches` for an HMAC-SHA256 check. - **Cron:** `curl localhost:8788` from a crontab line, with no `expose`. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text In my devmachine workspace acme, build the webhook channel from the "Send work to a Claude session" guide in ~/webhook-channel, ask me to set WEBHOOK_SECRET with devmachine secrets set, and expose it at hooks.example.com. ``` The agent writes the files and runs `expose add`. You do three things yourself: `devmachine login claude --workspace acme`, typing the secret, and starting `claude --dangerously-load-development-channels server:webhook` and accepting its prompts. **Check it:** the `curl` with the secret prints `ok 1`, Claude answers in the session, and `tail ~/webhook-channel/replies.log` ends in `[1] pong`. ## Keep it running Events arrive only while the session is open. tmux keeps it open after you close the laptop — see [keep your sessions running](/guides/keep-sessions-running/). After a reboot, start it again. A permission prompt pauses the session and queues new events, so pick a [permission mode](https://code.claude.com/docs/en/permission-modes) that fits the work. ## Troubleshooting - **`ok` but nothing reaches Claude:** run `/mcp` in the session. `failed` usually means an error in `webhook.ts`. - **`connection refused`:** an old server holds the port. `lsof -i :8788`, `kill` it, restart Claude Code. - **`forbidden` with the header:** the shell that started `claude` had no `WEBHOOK_SECRET`. Run `source ~/.devmachine/env` and start again. Source: [Claude Code — Channels reference](https://code.claude.com/docs/en/channels-reference), [Claude Code — Channels](https://code.claude.com/docs/en/channels) --- # https://mydevmachine.sh/guides/langchain-agent-with-openai/ Write a small Python agent with [LangChain](https://docs.langchain.com/oss/python/langchain/overview) in workspace `acme`. It has two tools, one that reads the server's clock and one that counts words, and it answers a question you give it on the command line. The OpenAI key never goes in a command, a script or the chat with your agent: `devmachine secrets` stores it on your computer and writes it into the project's `.env` file in the workspace. **You need:** a Linux VPS (tested on Debian and Ubuntu), or a [local VM](/guides/a-local-vm-with-lima/) (this guide needs no domain), and an OpenAI API key from [platform.openai.com](https://platform.openai.com/api-keys). ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Make the Python project Inside the workspace (`devmachine ssh acme`): ``` mise use -g uv@latest uv init agent && cd agent uv add langchain langchain-openai python-dotenv echo .env >> .gitignore ``` [uv](https://docs.astral.sh/uv/) installs Python packages, and Python itself if the machine lacks the right version. `mise`, from the `mise` package every new workspace gets, installs it without root. `uv init` makes a git repository, so the last line keeps the key file out of it. ### 2. Deliver the OpenAI key On your computer: ``` devmachine secrets set OPENAI_API_KEY --workspace acme --env-file agent/.env --push ``` ``` value for OPENAI_API_KEY: stored acme/OPENAI_API_KEY delivered acme/OPENAI_API_KEY -> agent/.env ``` Paste your key at the prompt. It does not echo, so it never reaches your shell history. The value is kept in your OS keychain, and `--push` writes it at once to `/home/acme/agent/.env`, a file only `acme` can read: ``` OPENAI_API_KEY='' ``` The path after `--env-file` is relative to the workspace's home. Any other lines in that file stay as they were. To change the key later, run the same command again. See [credentials: your app's own secrets](/concepts/credentials/#your-apps-own-secrets). ### 3. Write the agent Inside the workspace, in `~/agent`: ``` cat > agent.py <<'EOF' import sys from datetime import datetime from dotenv import load_dotenv from langchain.agents import create_agent from langchain.tools import tool load_dotenv() @tool def get_time() -> str: """Return the current date and time on this server.""" return datetime.now().isoformat(timespec="seconds") @tool def word_count(text: str) -> int: """Count the words in a piece of text.""" return len(text.split()) agent = create_agent( model="openai:gpt-6-luna", tools=[get_time, word_count], system_prompt="You are a helpful assistant. Use your tools when they help.", ) if __name__ == "__main__": question = " ".join(sys.argv[1:]) or input("Question: ") result = agent.invoke({"messages": [{"role": "user", "content": question}]}) print(result["messages"][-1].content) EOF ``` `load_dotenv()` reads `.env` and sets `OPENAI_API_KEY`, which LangChain's OpenAI model reads by itself. The docstring of each tool is what the model reads to decide when to call it. `gpt-6-luna` is OpenAI's low-cost model; any name from [OpenAI's model list](https://developers.openai.com/api/docs/models) works after `openai:`. ### 4. Ask it something Inside the workspace, in `~/agent`: ``` uv run agent.py "What time is it on the server, and how many words are in 'hello big world'?" ``` The model calls both tools, then writes one answer with the server's time and the number 3. With no question after `agent.py`, it asks you for one. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text In my devmachine workspace acme, make a uv project ~/agent with langchain, langchain-openai and python-dotenv, and write agent.py: a LangChain create_agent agent on openai:gpt-6-luna with two tools, get_time and word_count, that answers the question given on the command line. Read OPENAI_API_KEY from agent/.env. Do not ask me for the key: tell me the devmachine secrets command to run myself. ``` The agent installs uv, makes the project and writes `agent.py` over SSH. The key is yours to give: run the `devmachine secrets set ... --push` command from step 2 yourself, and paste the key at its prompt, never into the chat. Then the agent can run `uv run agent.py` to test it. **Check it:** inside the workspace, `cd ~/agent && uv run agent.py "How many words are in 'hello big world'?"` prints an answer that says 3. ## Troubleshooting **`OpenAIAuthenticationError: Error code: 401 ... 'code': 'invalid_api_key'`** means the code works: the packages are installed, the tools load, the key was read and the request reached OpenAI, which refused the key. The key is wrong, not the code. The message shows only its first and last letters, such as `Incorrect API key provided: sk-test-**********-key`. Copy a fresh key from OpenAI and run step 2 again. **`openai.OpenAIError: Missing credentials. Please pass an api_key ...`** means no key was found. Check that `~/agent/.env` exists and that you run the agent from `~/agent`. On your computer, `devmachine secrets list --workspace acme` shows where the key goes: ``` acme/OPENAI_API_KEY -> agent/.env ``` To test the tools without the model or a key, inside `~/agent`: ``` uv run python -c 'from agent import get_time, word_count; print(get_time.invoke({})); print(word_count.invoke({"text": "hello big world"}))' ``` It prints the server's time, then `3`. ## Next steps - Put the agent behind a small web API and give it a domain: [FastAPI with TLS](/guides/fastapi-with-tls/) shows the app, then `devmachine expose add` publishes it. - Give it memory between questions: pass a `checkpointer` to `create_agent` and the same `thread_id` on each call — see LangChain's [short-term memory](https://docs.langchain.com/oss/python/langchain/short-term-memory). - Add more tools: any Python function with type hints and a docstring, marked `@tool`. Source: [LangChain — Quickstart](https://docs.langchain.com/oss/python/langchain/quickstart) --- # https://mydevmachine.sh/guides/logins-and-secrets/ Every tool in a workspace needs something to prove who it is: GitHub needs you signed in, Claude Code needs your account, a DNS provider needs an API token. This guide walks through all three cases on one machine, using `devmachine credentials list` to see what is missing and what fixes it. **You need:** a VPS (tested on Debian and Ubuntu), and a Cloudflare account with a domain on it (only for the last part, storing an API token). ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Add the tools that need a login ``` devmachine packages add claude-code --workspace acme devmachine packages add cloudflare devmachine sync ``` `gh` is already on `acme`: the `dev` package, on every new workspace, installs it. `claude-code` adds Claude Code. `cloudflare` adds the DNS provider — see [concepts/credentials](/concepts/credentials/) for the three kinds of credential a package can declare. ### 2. See what is missing ``` devmachine credentials list ``` ``` CREDENTIAL SCOPE STATUS FIX gh machine missing devmachine login gh claude workspace missing devmachine login claude --workspace acme cloudflare machine missing devmachine secrets set cloudflare ``` `missing` means the package declared the credential and there is nothing stored for it yet. `stored` means the fix already ran. `unknown` shows up when a package never said where its tool keeps the result — there is nowhere to look, so the CLI cannot tell you either way. Each row's `FIX` column is the exact command that clears it. ### 3. Sign in to GitHub, shared by every workspace ``` devmachine login gh ``` This opens `gh auth login` on the machine, in a real terminal — you finish it in your browser. `gh` is declared `scope: machine`, so the next `sync` copies this one login into every workspace that has not opted out. See [sharing a login](/how-it-works/sharing-a-login/) for what the copy actually does. ### 4. Sign in to Claude Code, one workspace at a time ``` devmachine login claude --workspace acme ``` Claude Code's credential is `scope: workspace`: each workspace signs in for itself, because most people want a different account per client or project, not one account shared everywhere. ### 5. Keep one workspace on its own GitHub account Say a second workspace, `globex`, needs a different GitHub account — a client's, not yours: ``` devmachine workspaces new globex devmachine workspaces edit globex --share gh=own devmachine sync devmachine login gh --workspace globex ``` `--share gh=own` takes `globex` out of the machine-wide copy. Without it, the next `sync` would overwrite whatever `globex` signed in with, and nothing would say why. `--share gh=machine` puts it back. ### 6. Store the Cloudflare token and deliver it ``` devmachine secrets set cloudflare ``` This asks for the value without echoing it back, and stores it in the OS keychain — never in a file you would commit. `devmachine secrets list` shows only the name `cloudflare`, never the value. ``` devmachine credentials push ``` `push` writes what is missing, and a token it delivered before whose value you have since changed with `secrets set`. It skips `gh` and `claude` — nobody can push a browser login — and delivers the `cloudflare` token to `/etc/devmachine/cloudflare/env` on the machine, where the package reads it. Nothing is printed: not the plan, not the result. ### 7. Check it all landed ``` devmachine credentials list devmachine doctor ``` `credentials list` now shows every row as `stored`. `doctor` checks that the CLI can still reach and operate the machine — worth a look after any round of logins, since a bad key or a locked-out account shows up there first. ### 8. Store a secret your own app needs The steps above are all credentials a *package* declared. Say `acme`'s own code reads a `STRIPE_KEY` — nothing in this CLI knows that, and nothing has to: ``` devmachine secrets set STRIPE_KEY --workspace acme devmachine credentials push ``` This stores the value under `acme/STRIPE_KEY` and, on the next push, writes it into `~/.devmachine/env` inside `acme`'s home — a file its shell sources on login. If the app reads an actual `.env` file instead, deliver straight into it: ``` devmachine secrets set STRIPE_KEY --workspace acme --env-file app/.env devmachine credentials push ``` This edits `app/.env` in place: the existing `STRIPE_KEY=` line is replaced, or a new one is appended, and every other line is left exactly as it was. The first time it touches a file that already existed, it keeps a copy at `app/.env.devmachine.bak`. See [credentials: your app's own secrets](/concepts/credentials/#your-apps-own-secrets). ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Set up my devmachine workspace acme with Claude Code, and make sure GitHub and Claude are both signed in. Then add the cloudflare package and get its API token stored. ``` The agent runs `packages add`, `sync`, and `credentials list` to see what is missing. It cannot finish `login gh` or `login claude` for you — both open a real browser sign-in — so it tells you which terminal to finish each one in. For the Cloudflare token, it runs `secrets set cloudflare`, which asks you to paste the value in the terminal it opened, then runs `credentials push` and shows you the updated `credentials list`. **Check it:** `devmachine credentials list` shows `stored` for `gh`, `claude`, and `cloudflare`, and `devmachine doctor` reports the machine is reachable. Source: [GitHub CLI — `gh auth login`](https://cli.github.com/manual/gh_auth_login) --- # https://mydevmachine.sh/guides/cloudflare-dns/ If your domain's DNS is on Cloudflare, devmachine can create and update records for you: `expose add` points a name at your server without you touching the Cloudflare dashboard again. This guide adds the Cloudflare package, hands it a scoped token, and publishes a site at a real subdomain. **You need:** a Linux VPS (tested on Debian and Ubuntu), a domain whose DNS is on Cloudflare (here, `example.com`), and a Cloudflare account. ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Create a scoped Cloudflare API token Go to [dash.cloudflare.com/profile/api-tokens](https://dash.cloudflare.com/profile/api-tokens) and select **Create Token**. Use the **Edit zone DNS** template, and scope it to the one zone you want devmachine to manage (`example.com`). This gives the token `Zone / DNS / Edit` on that zone only — not your whole account. ### 2. Add the package ``` devmachine packages add cloudflare devmachine sync ``` `cloudflare` is a `machine`-scope package: one install serves every workspace and every zone the token can see. See [DNS providers](/how-it-works/dns-providers/) for what it does under the hood, including why it always sends `proxied: false` for a record devmachine manages — the certificate needs the request to reach your server directly, not Cloudflare's edge. ### 3. Store the token and deliver it ``` devmachine secrets set cloudflare devmachine credentials push ``` `secrets set cloudflare` asks for the token without echoing it, and stores it in the OS keychain. `credentials push` writes it to `/etc/devmachine/cloudflare/env` on the machine, where the package reads it — the value is never printed, and never lands in `config.yml`. ### 4. Check the provider can see your zone ``` devmachine dns providers ``` This is the first thing to run when DNS does not do what you expect: it lists every installed provider and the zones it can see. A token from the **Edit zone DNS** template sees exactly the zones it is scoped to, so there is nothing to list by hand. If your zone is not there, the token does not cover it: every `cloudflare` command finds a zone by its name through that same lookup, so `dns` and `expose` cannot reach it either. Edit the token to include the zone, then `secrets set cloudflare` and `credentials push` again if you made a new one. ``` devmachine dns list example.com ``` shows every record the provider holds for that zone right now. ### 5. Expose a workspace's app, pointing DNS automatically ``` devmachine expose add acme 3000 --host app.example.com --publish ``` With `cloudflare` installed, `expose add` creates the `A` record for `app.example.com` itself, instead of printing one for you to add by hand. It then writes the Caddy route on the machine and reloads Caddy, which gets the certificate — no `sync` needed. ### 6. Check it from outside ``` devmachine dns status app.example.com ``` `dns list` asks Cloudflare what is configured; `dns status` asks the internet — it resolves the name and checks the certificate the way a visitor would. A record can be correct in `dns list` and still fail `dns status` for a minute or two while it spreads. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Add the cloudflare package to my devmachine machine, then expose my workspace acme's app on port 3000 at app.example.com using Cloudflare for DNS. ``` The agent runs `packages add cloudflare` and `sync`, then asks you to open [dash.cloudflare.com/profile/api-tokens](https://dash.cloudflare.com/profile/api-tokens) and create a scoped **Edit zone DNS** token for your zone — that page needs your own Cloudflare login, so the agent cannot do it. It then runs `secrets set cloudflare` in a terminal it opens for you to paste the token into, runs `credentials push`, and finally `expose add acme 3000 --host app.example.com --publish`. **Check it:** `curl https://app.example.com` returns your app's response with a valid certificate, and `devmachine dns status app.example.com` reports it healthy. Source: [Cloudflare — Create an API token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/), [Cloudflare — DNS record settings (proxy status, SSL/TLS)](https://developers.cloudflare.com/dns/manage-dns-records/reference/proxied-dns-records/) --- # https://mydevmachine.sh/guides/godaddy-dns/ If your domain's DNS is on GoDaddy, devmachine can create and update records for you: `expose add` points a name at your server without you touching the GoDaddy dashboard again. This guide adds the GoDaddy package, hands it a Personal Access Token, and publishes a site at a real subdomain. **You need:** a Linux VPS (tested on Debian and Ubuntu), a domain whose DNS is on GoDaddy (here, `example.com`), and a GoDaddy account. ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Create a Personal Access Token Go to [developer.godaddy.com](https://developer.godaddy.com), sign in, and create a Personal Access Token that may read your domains and change their DNS records. Copy the token at once: GoDaddy shows it only once. The old key and secret pair does not work here. ### 2. Add the package ``` devmachine packages add godaddy devmachine sync ``` `godaddy` is a `machine`-scope package: one install serves every workspace and every domain the token can see. See [DNS providers](/how-it-works/dns-providers/) for what it does under the hood, including why one `PUT` replaces the whole set at a name. ### 3. Store the token and deliver it ``` devmachine secrets set godaddy devmachine credentials push ``` `secrets set godaddy` asks for the token without echoing it, and stores it in the OS keychain. `credentials push` writes it to `/etc/devmachine/godaddy/env` on the machine, where the package reads it as `GODADDY_API_TOKEN` — the value is never printed, and never lands in `config.yml`. ### 4. Check the provider can see your zone ``` devmachine dns providers ``` This is the first thing to run when DNS does not do what you expect: it lists every installed provider and the zones it can see. GoDaddy lists only `ACTIVE` domains. If your zone is not there, the account has no active domain, or GoDaddy does not allow it on the Domains API: see [troubleshooting](/troubleshooting/). `dns` and `expose` cannot reach a zone this list does not show. ``` devmachine dns list example.com ``` shows the records the provider holds for that zone right now. ### 5. Expose a workspace's app, pointing DNS automatically ``` devmachine expose add acme 3000 --host app.example.com --publish ``` With `godaddy` installed, `expose add` creates the `A` record for `app.example.com` itself, instead of printing one for you to add by hand. It then writes the Caddy route on the machine and reloads Caddy, which gets the certificate — no `sync` needed. ### 6. Check it from outside ``` devmachine dns status app.example.com ``` `dns list` asks GoDaddy what is configured; `dns status` asks the internet — it resolves the name and checks the certificate the way a visitor would. A record can be correct in `dns list` and still fail `dns status` for a minute or two while it spreads. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text Add the godaddy package to my devmachine machine, then expose my workspace acme's app on port 3000 at app.example.com using GoDaddy for DNS. ``` The agent runs `packages add godaddy` and `sync`, then asks you to open [developer.godaddy.com](https://developer.godaddy.com) and create a Personal Access Token that may read your domains and change their DNS records — that page needs your own GoDaddy login, so the agent cannot do it. It then runs `secrets set godaddy` in a terminal it opens for you to paste the token into, runs `credentials push`, and finally `expose add acme 3000 --host app.example.com --publish`. **Check it:** `curl https://app.example.com` returns your app's response with a valid certificate, and `devmachine dns status app.example.com` reports it healthy. Source: [GoDaddy — Authentication](https://developer.godaddy.com/docs/api-users/auth), [GoDaddy — Domains API v1](https://developer.godaddy.com/docs/references/rest/domains/v1) --- # https://mydevmachine.sh/guides/ruby-on-rails/ A workspace set up to build and test a real open source Rails app: [RubyUI](https://github.com/ruby-ui/ruby_ui), a component library with a Rails docs site. This guide forks it, installs Ruby with mise, runs its test suite, and starts its dev server — viewed privately with `devmachine tunnel`, with Claude Code on hand to help. **You need:** a VPS (tested on Debian and Ubuntu), and a GitHub account. ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new components devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Sign in to GitHub and add Claude Code ``` devmachine login gh devmachine packages add claude-code --workspace components devmachine sync ``` `gh` is already installed — it comes with every workspace's `dev` package. `login gh` opens the sign-in in a real terminal; you finish it in your browser. See [logins and secrets](/guides/logins-and-secrets/) if this is your first login. ### 2. Fork and clone RubyUI ``` devmachine ssh components gh repo fork ruby-ui/ruby_ui --clone cd ruby_ui ``` `gh repo fork --clone` forks the repo to your GitHub account, using the login from step 1, and clones your fork. ### 3. Install Ruby with mise ``` mise use -g ruby@3.4 ruby -v ``` RubyUI's CI runs on Ruby 3.3 and 3.4. mise compiles the version you ask for; the `base` package (part of `essentials`) already installed the headers and libraries — `zlib1g-dev`, `libssl-dev`, `libyaml-dev`, and the rest — that compiling Ruby needs, so this step does not fail on a missing header. ### 4. Install dependencies and run the gem's tests ``` cd gem bundle install bundle exec rake ``` `rake` here runs RubyUI's test suite and its `standardrb` linting in one step. This is the part of the repo you are most likely changing: the components themselves. ### 5. Run the docs app ``` cd ../docs bundle install pnpm install bin/dev ``` The docs app is a Rails 8 site that also serves as RubyUI's demo: it reads the gem straight from the path next to it, so a change to a component shows up in the docs app without reinstalling anything. `bin/dev` starts it on port 3000 and keeps running after you close the terminal — the SSH login was inside tmux. ### 6. View it privately Back on your own computer: ``` devmachine tunnel components 3000 ``` Open `localhost:3000`. Nothing is published — no DNS record, no open port — so this is safe to leave running while you work on a fork nobody else should see yet. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text In my devmachine workspace components, fork and clone ruby-ui/ruby_ui with my GitHub login, install Ruby 3.4 with mise, run the gem's test suite, and start the docs dev server on port 3000. ``` The agent runs `gh repo fork --clone`, `mise use -g ruby@3.4`, `bundle install`, `bundle exec rake`, and `bin/dev` over SSH, in that order. It needs `devmachine login gh` already done — a browser sign-in is not something it can do for you — and if it is not, the agent tells you to run it first. Once the dev server is up, it opens the tunnel with `devmachine tunnel components 3000` and tells you to open `localhost:3000`. **Check it:** `bundle exec rake` in `gem/` passes with no failures, and `localhost:3000` (through the tunnel) shows the RubyUI docs and component previews. Source: [ruby-ui/ruby_ui](https://github.com/ruby-ui/ruby_ui), [ruby-ui/ruby_ui — CONTRIBUTING.md](https://github.com/ruby-ui/ruby_ui/blob/main/CONTRIBUTING.md) --- # https://mydevmachine.sh/guides/headscale/ Tested end to end with Headscale 0.29.4 and Tailscale 1.102.4, on Ubuntu 24.04, with packages v23: `login tailscale` with a pre-auth key, `resolve`, `run`, `doctor` and an SSH alias over the Headscale address with the public one blocked, and the fallback to the public address once Tailscale stops on your computer. `scripts/accept/headscale.sh` repeats that run on three local VMs. [Headscale](https://headscale.net) is an open source, self-hosted replacement for Tailscale's control server. You get the same private network, the same `tailscale` client on every device, but you run the server that coordinates it — no third party in the loop. This guide puts Headscale on a small server, joins your devmachine server to it, and joins your own computer too. **You need:** a second small Linux server for Headscale itself, tested on Ubuntu (or reuse your devmachine server if it runs Debian or Ubuntu — see the note below), and your devmachine server already reachable over SSH. ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. This guide does not need a new workspace — it only touches the machine — but the block above is the standard starting point if you have neither yet. ## By hand ### 1. Install Headscale On the server that will run it (a separate small VPS, or your devmachine server itself — Headscale is just one more service on it), install the official `.deb` package from the [Headscale releases page](https://github.com/juanfont/headscale/releases): ``` wget --output-document=headscale.deb \ https://github.com/juanfont/headscale/releases/download/v/headscale__linux_.deb sudo apt install ./headscale.deb ``` `` is `amd64` on an Intel or AMD server and `arm64` on an ARM one (`dpkg --print-architecture` says which). Edit `/etc/headscale/config.yaml` to set your server's URL, then start it: ``` sudo systemctl enable --now headscale ``` See [Headscale's own install docs](https://headscale.net/stable/setup/install/official/) for the config fields and current version. ### 2. Create a user and a pre-auth key ``` headscale users create acme headscale users list headscale preauthkeys create --user --expiration 1h ``` `--user` takes the user's number from the `ID` column of `users list`, not its name. The key printed is what a device trades for a place on your network. It expires — here, in one hour — and by default works once, so generate a fresh one per device. ### 3. Join your devmachine server Add the `tailscale` package: ``` devmachine packages add tailscale ``` Then tell it where your Headscale server is. In `config.yml`, under your machine: ```yaml machines: - name: main settings: tailscale.login_server: https://net.example.com ``` `login_server` needs a packages release whose `tailscale` package declares it — see [settings](/reference/settings/). An older release ignores it and joins Tailscale's own service. Then: ``` devmachine sync devmachine login tailscale ``` `login tailscale` runs the package's join on the server, as its admin, in a real terminal. With `login_server` set, it runs `tailscale up --login-server https://net.example.com` and first asks for a pre-auth key: paste the one from step 2. Leave it empty to sign in through a URL instead, which you then approve on the Headscale server with `headscale nodes register`. Once the server has joined, devmachine asks it for its name on your network and adds it to `config.yml`, above the public address: ```yaml machines: - name: main hosts: - tailscale:main - 203.0.113.10 ``` The key goes into a file only root can read on the server, for as long as `tailscale up` needs it, and never into a command line or your configuration. ### 4. Join your own computer Install Tailscale from [tailscale.com/download](https://tailscale.com/download), then join the same Headscale server: ``` tailscale up --login-server https://net.example.com --authkey ``` ### 5. Check the private address ``` devmachine resolve ``` It lists the server's Headscale address, typically in the `100.64.0.0/10` range, from `tailscale:main`, before the public one. `tailscale:` asks the `tailscale` command on your computer, which works the same whether it talks to Tailscale's own service or to your Headscale server — see [addresses and fallback](/how-it-works/addresses-and-fallback/). When it lists the entry under `skipped`, the reason says why: most often Tailscale is not running on your computer, or it joined another network. ## With your agent Open a session on your own computer (`devmachine skills add` taught it the CLI) and say: ```text My devmachine server needs to join my Headscale server at https://net.example.com. Add the tailscale package with that login server, sync, and run the login. ``` The agent adds the package and the `tailscale.login_server` setting, runs `sync`, and then hands `devmachine login tailscale` to you: it needs a terminal, and a pre-auth key from your Headscale server — generating one is your call, since it decides who gets on your network. Joining your own computer to Headscale is yours to do too: it needs the Tailscale app on your machine, not the server's. **Check it:** `devmachine resolve` lists `tailscale:main` first, with a `100.64.x.x` address. Source: [Headscale](https://headscale.net), [Headscale — Official releases](https://headscale.net/stable/setup/install/official/), [Headscale — Getting started](https://headscale.net/stable/usage/getting-started/) --- # https://mydevmachine.sh/guides/shared-skills-for-every-workspace/ Write a skill once and every workspace that uses your team's package gets it. Change the skill, sync, and the change lands everywhere — no copying files into each workspace by hand, and no drift between one workspace's copy and another's. This guide builds a package called `team-skills` with two skills, `write-tests` and `deploy-preview`, and puts it on two workspaces, `acme` and `globex`. It also installs the same skills on your own computer, so your coding agent there knows them too. **You need:** a machine already set up, and a [getting started](/getting-started/) run through once. ## Before you start: machine, skills, workspace ``` curl -fsSL https://mydevmachine.sh/install.sh | sh devmachine setup devmachine skills add devmachine workspaces new acme devmachine sync ``` Already have a machine? Skip `setup`. Already have the workspace? Skip the last two. See [getting started](/getting-started/) for what each command does. ## By hand ### 1. Create the package ``` devmachine packages new team-skills --scope workspace --into ~/.config/devmachine/packages ``` `~/.config/devmachine` is your configuration folder — run `devmachine config path` if you are not sure yours is there. `--scope workspace` because skills are something each workspace gets, not the machine itself. This writes a starting `package.yml` at `~/.config/devmachine/packages/team-skills/package.yml`. ### 2. Tell the package to ship skills Open `package.yml` and add the `skills` field: ```yaml format: 1 name: team-skills scope: workspace category: Coding agents summary: Our team's shared agent skills. skills: path: skills ``` `path: skills` says every folder directly inside `skills/` is a complete Agent Skill. ### 3. Write the skills ``` mkdir -p ~/.config/devmachine/packages/team-skills/skills/write-tests mkdir -p ~/.config/devmachine/packages/team-skills/skills/deploy-preview ``` `~/.config/devmachine/packages/team-skills/skills/write-tests/SKILL.md`: ```markdown --- name: write-tests description: Use when adding a new feature or fixing a bug in this project, before opening a PR, to write the tests that cover it. Follow the project's existing test style and put the file next to the code it tests. --- # Write tests 1. Find the existing tests closest to the code you changed. Match their file name pattern and test framework. 2. Write one test for the normal case and one for the edge case that would break if the fix regressed. 3. Run the test suite and confirm the new tests fail without your change and pass with it. 4. Do not commit until the whole suite is green. ``` `~/.config/devmachine/packages/team-skills/skills/deploy-preview/SKILL.md`: ```markdown --- name: deploy-preview description: Use when a change is ready for someone else to look at, to publish a preview build they can open in a browser, instead of asking them to check out the branch. --- # Deploy a preview 1. Build the project in preview mode. 2. Publish the build to the team's preview host. 3. Post the preview URL where the reviewer will see it. 4. Say what changed since the last preview, in one or two lines. ``` Each `SKILL.md` needs frontmatter with `name` (matching the folder) and a `description` that says when to use it — that is what your agent reads to decide to pick the skill up. ### 4. Validate it ``` devmachine packages validate ~/.config/devmachine/packages/team-skills ``` Fix anything it reports before moving on — it checks every problem at once, not just the first. ### 5. Add the package to both workspaces ``` devmachine packages add team-skills --workspace acme devmachine workspaces new globex devmachine packages add team-skills --workspace globex ``` ### 6. Sync ``` devmachine sync ``` This sends `team-skills` to both workspaces. A workspace that also has `claude-code`, `antigravity` or `cline` gets a link to the same files for that agent; Codex, Pi, OpenCode and Kimi Code read them directly. ### 7. Install it on your own computer too ``` devmachine skills add --package team-skills ``` Now your own coding agent knows `write-tests` and `deploy-preview` as well, without a machine involved. ### 8. Change a skill, then sync again Edit `~/.config/devmachine/packages/team-skills/skills/write-tests/SKILL.md` — say, add a step about coverage. Then: ``` devmachine sync devmachine skills update ``` `sync` pushes the new version to `acme` and `globex`. `skills update` refreshes your own computer's copy. One edit, three places updated. ## With your agent In a Claude Code, Codex, or Pi session on your own computer (`devmachine skills add` already done there): ```text Create a devmachine package called team-skills, scope workspace, in my configuration folder. Give it two skills: write-tests (use it before opening a PR to write tests for the change) and deploy-preview (use it to publish a preview build and share the URL). Validate the package, then add it to the acme and globex workspaces and sync. ``` The agent runs the same commands as above and writes the two `SKILL.md` files for you — check the wording of `description` matches what you actually want each skill used for. It asks before `devmachine sync` applies anything to a real machine; approve it once you've seen the plan. **Check it:** `devmachine skills list` on your computer shows `write-tests` and `deploy-preview` from `team-skills`. On the server, `devmachine ssh acme` then `ls ~/.agents/skills/` shows the same two folders, and so does `devmachine ssh globex`. --- # https://mydevmachine.sh/troubleshooting/ ## Where the logs are When something went wrong and you want help, these files say what happened. Find the folder with `devmachine config path`. - **`/logs/devmachine.log`** — the CLI's own log. A command that changes a machine (`setup`, `machines add`, `sync`, `update`, `doctor`, `packages add`, `run`, `login`, `credentials push` and the like) writes a start line with the version, system and command line, every line it printed, Ansible's output included, and an end line with how it ended and how long it took. Any other command writes one line when it fails. `devmachine logs path` prints where it is, and a failed command prints it as its last line: `log: `. - **`devmachine.log.1`, `.2`, `.3`**, in the same folder — older runs. At 5 MB the log moves to `.1` and a new one starts; only three old ones are kept. - **`/history.log`** — one line per command that reached a machine: when, which machine or workspace, ok or failed, and the command. No output. - **`~/Library/Logs/Devmachine/app.log`** — written by the macOS app, not the CLI: what the app did and the errors it met. **What is taken out:** before a line reaches `devmachine.log`, passwords, tokens, API keys, `Authorization` and `Bearer` headers, GitHub and Tailscale keys, private keys, `.env` values, values given to `secrets set` and any `NAME=value` whose name says token, secret, password, key or auth become `***`. A password you type or pipe in is never written: the log copies what the CLI prints, not what it reads. Addresses, host names and machine, workspace and user names stay, because without them the log says nothing. The full list is in [the CLI's log](/how-it-works/the-cli-log/#what-is-taken-out). **How to send them:** read the file first, then attach `devmachine.log` (and `.1` if the run you mean is older) to the issue or message. To send only the run that failed, copy from its `start` line to its `end` line; the number in brackets is the same on each line of one run. ## `ssh -devmachine`: "Could not resolve hostname" **What it means:** That name only exists as a Host entry in `~/.ssh/config`, and it is missing — either you said no when `setup` asked about it, or it was set up before that question existed. **What to do:** ``` devmachine aliases --write ``` Say yes when it asks. `devmachine ssh ` and `mosh ` still work either way — only the plain `ssh`/`mosh` form, and tools that dial `ssh` themselves (VS Code Remote-SSH, Zed, the macOS app), need the alias. See [SSH aliases](/concepts/reaching-your-server/#ssh-aliases). ## A new workspace's alias works for a moment, then "Could not resolve hostname" **What it means:** The aliases ended up in two files. Something else owns `~/.ssh/config` — a template, a dotfiles manager — and keeps the aliases in a file it `Include`s, while the CLI was writing its block into `~/.ssh/config` itself. The next time that tool rewrote `~/.ssh/config`, the CLI's block went with it, and the included file never learned about the new workspace. **What to do:** Tell the CLI where the aliases live, once: `devmachine aliases --write --path ~/.ssh/ --yes`. It records the file as `ssh_aliases_path`, empties the block it had left in `~/.ssh/config`, and every later change — a new workspace, a new machine — is written there. ## "workspace X lives on Y, not Z" **What it means:** `sync --workspace X --machine Z` names two things that do not match: the configuration puts workspace X on machine Y. The sync stops before it connects, so nothing changed on either machine. **What to do:** Drop `--machine`. `sync --workspace` finds the machine the workspace lives on by itself. ## "several machines are configured: say which one with --machine" **What it means:** You have more than one server configured, and this command needs to know which one to act on. **What to do:** Add `--machine `, or use a workspace name — that already says which server it lives on. `doctor` never says this: with several machines and no `--machine`, it checks every one of them. ## Commands hang for a minute or more right after the computer wakes **What it means:** An older CLI kept its shared SSH connection open across the sleep. The connection was dead, and each command waited on it until the system gave up. The SSH agent's prompt, such as 1Password's, only appeared after that. **What to do:** Update the CLI. It now drops a dead connection within a few seconds and logs in again. See [Session indicators](/how-it-works/session-indicators/#after-the-computer-sleeps). ## `login-waiting` from `sessions` **What it means:** The machine is fine and accepted your key. Your SSH agent has not signed with it yet: 1Password waits for Touch ID or to be unlocked, as it does after a wake. The login stays open, so nothing is asked of the machine again while it waits. **What to do:** Approve the prompt in 1Password (or unlock your agent). The next `sessions` lists the sessions. If no prompt shows, open 1Password: a locked app may be waiting behind other windows. See [Session indicators](/how-it-works/session-indicators/#a-login-waiting-for-your-approval). ## "no address answered" **What it means:** Nothing answered at the address devmachine tried. The error lists every address it tried and what happened for each. **What to do:** - Check the port. A server on a non-standard port needs `port:` set in its configuration. - Check for a second address — see [Addresses and fallback](/how-it-works/addresses-and-fallback/). ## "connection refused" on a machine that answered before The error ends with: ``` machine "main": no address answered: 203.0.113.10 (dial tcp 203.0.113.10:22: connect: connection refused); this machine answered SSH before, so the server may be blocking this address after failed logins (fail2ban, for example): … ``` **What it means:** devmachine has talked to this server before — its host key is trusted — and now the server turns the connection away before any login: refused, or closed during the handshake. SSH is most likely still running. The usual cause is fail2ban, or another firewall rule, that banned your address after several failed logins in a short time. A key the server refuses, tried again and again by `doctor`, `sessions` or the macOS app, is enough. The port can still look open from another network, because the ban is for your address only. devmachine adds this sentence only for a server it has reached before. For an address it has never seen, "connection refused" means the usual: wrong address or port, or SSH not running. **What to do:** - Stop whatever keeps logging in with the wrong key — a machine left in `config.yml` with a key that does not work, or the macOS app polling it. - Wait about 10 minutes: fail2ban lifts a ban on its own (`bantime`, 10 minutes by default). - Or open the provider's web console, which does not go through SSH, and run `sudo fail2ban-client status sshd` to see the banned addresses, then `sudo fail2ban-client set sshd unbanip `. - Then fix the key — see ["answered on … but refused the login"](#answered-on--but-refused-the-login). `setup` and `machines add` never write a machine whose key has not logged in, so they do not start this loop — see [nothing is written before the key logs in](/how-it-works/trust-bootstrap/#nothing-is-written-before-the-key-logs-in). ## "answered on … but refused the login" **What it means:** The server is there, so the network is fine. The account or the key is the problem. **What to do:** - Check that account exists on the server. A workspace in your configuration is not created on the server until you run `sync`. - Check the key is allowed to log in to that account. ## A new workspace shows as unreachable until sync **What it means:** A workspace you just added is in your configuration, but its account on the machine does not exist until `sync` finishes. Until then, the machine refuses every login to it. `devmachine sessions` reports this as `login-refused`, not `unreachable`: the machine is fine, and the other workspaces on it still answer. Each refused login is a failed login in the machine's SSH log. With fail2ban on, enough of them in a short time block your address for the whole machine, so do not keep asking about a workspace that is not synced yet. **What to do:** Run `devmachine sync`. When it finishes, the workspace answers. ## "no key in the configuration and no SSH agent" **What it means:** devmachine has nothing to log in with. **What to do:** Either set `key:` on the server to a private key, or start an SSH agent and load one. ## `machines add`: "the key does not log in yet and no password was given" **What it means:** `machines add --address …` asks nothing, so it had no way to get the server's password, and the key it chose is not in the admin's `authorized_keys` yet. A server just bought usually takes only a password. Nothing was changed, and nothing was written to `config.yml`, so nothing keeps retrying the key until the server bans your address. **What to do:** Give the password on stdin, so it never appears in the command line or the shell history: ``` printf '%s' "$PASSWORD" | devmachine machines add … --password-stdin ``` Or put the key's public half (`.pub`) in the admin's `authorized_keys` through the provider's console, and run the same command again. ## `create-local` refuses `--cpus`, `--memory` or `--disk` **What it means:** The size you asked for does not fit this computer, so no VM was made. The CPUs can be at most the computer's cores. The memory must be less than the computer's, because macOS or Linux needs some for itself while the VM runs. The disk must be at least 10 GiB, or the first `sync` fills it. **What to do:** Run it again with a number inside the range the message gives. ## `create-local --add`: "the local machine … is running, and was not added" **What it means:** The VM was created and is running, but adding it failed — the error after the colon says which step. Nothing was written to `config.yml`, so nothing points at a half-added machine. **What to do:** Fix the cause, then run the command the error ends with. It is the whole `machines add` for the running VM — name, address, port, the host key's fingerprint, the public password on stdin, and the flags you gave — ready to copy: ``` printf '%s' devmachine | devmachine machines add --name sandbox --address 127.0.0.1 \ --port 60022 --fingerprint SHA256:… --password-stdin ``` Or throw the VM away with `devmachine machines delete-local ` and run `create-local --add` again. ## It used to connect, and now it does not **What it means:** If you recently added keys to your SSH agent, that is very likely the cause, and only on a machine with neither `key:` nor `agent_key:` in its configuration. A server gives up after a few tries, and an agent holding many keys can use them all up before it reaches the one that works. A machine with `key:` or `agent_key:` set is immune to this: devmachine offers that one key and nothing else. Plain `ssh`, and anything else on your computer, is not — it still asks the agent for everything it holds. **What to do:** On a machine with neither field yet, `devmachine setup` and `devmachine machines add` only choose a key the first time — run them again on an existing machine and they resume, without asking. Set the field by hand in `config.yml` instead: `key: ` for a file, or `agent_key: ` (`ssh-add -L` lists what your agent holds, in that format) for one from the agent. Full explanation: [SSH: logging in and knowing it is your server](/how-it-works/ssh/). ## "the SSH agent does not hold the key … that this machine logs in with" **What it means:** The machine's `agent_key:` names a key your SSH agent is not currently offering — the password manager it lives in is locked, or `SSH_AUTH_SOCK` points at a different agent than the one that key is in. **What to do:** Unlock the password manager (1Password, say) and try again. If that does not fix it, check `SSH_AUTH_SOCK`: ``` echo $SSH_AUTH_SOCK ssh-add -l ``` Compare the fingerprint `ssh-add -l` lists against the one the error names. If they never match, `agent_key:` in `config.yml` names the wrong key: replace it by hand with the line `ssh-add -L` prints for the key you meant. ## "ansible-playbook is not on the machine" **What it means:** `sync` runs Ansible, the tool devmachine uses to apply packages, on the server — so the server needs it installed. **What to do:** Run `devmachine setup --machine `, which installs it, or install it once by hand: `apt install ansible` on Debian and Ubuntu, `pacman -S ansible` on Arch. Everything after that is `sync`'s job. `doctor` still tells you the truth about everything else without it. ## "this CLI does not set up "…" yet" ``` this CLI does not set up "fedora" yet: it supports debian, ubuntu and arch, and systems based on them ``` **What it means:** The machine runs Linux, and neither `ID` nor `ID_LIKE` in its `/etc/os-release` names Debian, Ubuntu or Arch Linux. `setup` and `machines add` stop before changing anything: no key was installed, password login is as it was, nothing was written to `config.yml`. `doctor` reports the same thing as a failed `operating system` check. **What to do:** Use a machine with Debian, Ubuntu or Arch Linux — most providers offer all three. Installing Ansible by hand does not get past the check: the packages that `sync` applies are written for those three. ## "… which is based on …: … devmachine is not tested on it" ``` 203.0.113.10 runs manjaro, which is based on arch: it is set up the arch way, but devmachine is not tested on it. ``` **What it means:** Not an error. `ID` in `/etc/os-release` is not one the CLI knows, but `ID_LIKE` says the system is based on one it does. `setup` goes on, and installs Ansible and runs the packages as it would on that base. `doctor` shows the same sentence as a warning. **What to do:** Nothing, while it works. If a package fails on the derivative and not on the base, the derivative has renamed or left out something the base has: see [based on Debian, Ubuntu or Arch](/supported-systems/#based-on-debian-ubuntu-or-arch-accepted-not-tested). ## "… is not a system this CLI sets up" ``` "FreeBSD" is not a system this CLI sets up: it supports Linux (debian, ubuntu, arch) and macOS ``` **What it means:** `uname -s` on the machine said neither `Linux` nor `Darwin` (macOS). The CLI stopped there, before changing anything. **What to do:** Point the command at a Linux server (Debian, Ubuntu or Arch Linux) or a Mac. Your own Mac is set up differently: `devmachine machines add --self `, see [your computer as a machine](/how-it-works/your-computer-as-a-machine/). ## "pacman could not install ansible" ``` pacman could not install ansible from the package lists this machine has. They are probably older than the mirrors: bring the machine up to date with pacman -Syu, then run this again. ``` **What it means:** On Arch, `setup` installs Ansible with `pacman -S` and the package lists the machine already has. The mirrors keep only the newest version of each package, so on a server whose lists are weeks old the version pacman asks for is gone, and the download fails. `setup` does not refresh the lists on its own: `pacman -Sy` without `-u` is a partial upgrade, which can leave Ansible built for a Python the machine does not have. The key is installed and proved; if hardening ran, password login is already off. **What to do:** On the machine, as root, bring it up to date with `pacman -Syu`, then run the same `setup` or `machines add` command again. The key now logs in, so no password is asked for. ## "the admin login cannot become root" **What it means:** The machine's `user` in `config.yml` is not root, and `sudo -n true` fails as that account — its `sudo` wants a password, or it has none. The CLI needs root to turn password login off, install Ansible and run `sync`, and nobody is there to type a password, so it stops before changing anything. **What to do:** Either log in as root (`user: root`, with the key in root's `authorized_keys`), or give the account passwordless sudo, once, on the machine: ``` echo 'alice ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/devmachine-alice sudo chmod 440 /etc/sudoers.d/devmachine-alice ``` Then run the command again. See [an admin login that is not root](/how-it-works/trust-bootstrap/#an-admin-login-that-is-not-root). ## `setup` fails with "Could not open lock file … Permission denied", or `sync` with "sending a directory to /opt/devmachine … mkdir: Permission denied" **What it means:** The admin login is not root, and the CLI is older than the one that runs system steps through `sudo -n`. Those versions ran `apt-get`, the SSH hardening and the bundle upload as the admin itself. **What to do:** Update the CLI (`devmachine update`) and run the same command again. Nothing was half-applied: both errors happen before the first change. If it then says "the admin login cannot become root", see the entry above. ## `setup` says the machine "answered through Tailscale SSH" **What it means:** Port 22 on the address you gave is Tailscale SSH, not `sshd`. Tailscale lets tailnet members in without checking a key, so the CLI cannot prove the key from there. It installs the key anyway, so the machine stays reachable when Tailscale SSH is off or you are outside the tailnet. **What to do:** Nothing, usually. To prove the key on its own, connect to the machine's address outside Tailscale (its LAN or public IP) with `ssh -o IdentitiesOnly=yes -o IdentityAgent=none -i @
`. A machine set up by an older CLI over Tailscale SSH may have no key installed at all: `devmachine setup --machine ` installs it. ## `setup` shows a host key fingerprint that is not the one in `~/.ssh/known_hosts` **What it means:** Usually not a different server. A server has several host keys — ED25519, ECDSA, RSA — and the CLI asks for its own preferred algorithm, which can be a different one from the key your own `ssh` recorded. Two fingerprints of different types never match each other. **What to do:** Compare like with like. The CLI names the type it was shown (`presented ecdsa-sha2-nistp256 host key SHA256:…`). Over a connection you already trust, list every key with `for f in /etc/ssh/ssh_host_*_key.pub; do ssh-keygen -lf $f; done` and check the line of the same type. Only a mismatch of the same type means something changed. `--fingerprint` (`machines add`) and `--expect` (`machines trust`) take the fingerprint of any of the server's keys, so the one in your `known_hosts` works too: when it is not the type the CLI was shown, the CLI asks the server for that type, and trusts that key if it matches. A fingerprint none of the server's keys has is still refused. ## "the drop-in was written but sshd still allows passwords" ``` the drop-in was written but sshd still allows passwords: /etc/ssh/sshd_config.d/00-devmachine-hardening.conf is not read by this sshd ``` **What it means:** `setup` wrote the file that turns password login off, SSH accepted it and was reloaded, and then `sshd -T` — the settings SSH really runs with — still said `passwordauthentication yes`. SSH never reads that file. Usually the main `/etc/ssh/sshd_config` has no `Include /etc/ssh/sshd_config.d/*.conf` line, or sets `PasswordAuthentication yes` above it (SSH keeps the first value it finds). The CLI removed the file again and reloaded SSH, so the server is as it was: the key is installed and proved, and **password login is still on**. **What to do:** On the server, look at the top of `/etc/ssh/sshd_config`. Add `Include /etc/ssh/sshd_config.d/*.conf` as the first line if it is missing, or remove the `PasswordAuthentication yes` above it. Then run `setup` again. To go on without hardening for now, run it with `--no-harden`; password login stays on until `sshd_config` is fixed. ## I can't SSH in with my password any more ``` Permission denied (publickey). ``` **What it means:** `setup` or `machines add` turned SSH password login off, and SSH has one setting for the whole machine, so it went off for **every account**, not only the admin login the CLI uses. On a Mac somebody uses day to day, that is their own account too. Only SSH changed: the login window, `sudo`, Screen Sharing and FileVault still take the password. **What to do:** From this computer, which still has the admin login's key, give the account its password back: ``` devmachine machines password-login --keep ``` or put the system's own setting back for everybody with `--on` (refused while the machine has `ssh_hardening`; remove that package first). With no flag, the command shows who can log in with a password. Without the CLI, log in as the admin login and remove the file: ``` sudo rm /etc/ssh/sshd_config.d/00-devmachine-hardening.conf ``` A Mac reads it on the next connection; on Linux, `sudo systemctl reload ssh` (or `sshd`). Next time, answer the question `setup` asks before password login goes off, or pass `--keep-password-login`. See [password login, account by account](/how-it-works/password-login/). ## "sshd still refuses a password for …" ``` the drop-in was written but sshd still refuses a password for "alice": something earlier in sshd_config decides it, so the previous drop-in was put back ``` **What it means:** the file that keeps a password for some accounts was written and accepted, but `sshd -T -C user=alice` still said `passwordauthentication no`. A `Match` block earlier in the main `sshd_config`, or another drop-in that sorts before `00-`, decides it first. The CLI put back the file that was there before. **What to do:** On the machine, look for `Match` blocks and `PasswordAuthentication` lines in `/etc/ssh/sshd_config` and in `/etc/ssh/sshd_config.d/`. Remove the one that turns it off for that account, then run the command again. ## "Missing privilege separation directory: /run/sshd" **What it means:** `sshd -t`, which checks the SSH configuration before it is reloaded, needs `/run/sshd`. systemd makes that directory only when `ssh.service` starts. On Ubuntu 24.04 and later sshd starts through `ssh.socket`, and a machine reached only through Tailscale SSH may never have started it, so the directory is not there. Nothing about the configuration is wrong. **What to do:** Update the CLI and the packages release: both now make the directory before the check. Until then, `sudo install -d -m 0755 /run/sshd` on the machine and run the command again; the directory is temporary and gone at the next reboot. ## "ansible-playbook is not on your computer" **What it means:** The same check as above, for your own computer. `sync` and `doctor` both refuse to touch anything when Ansible is not on your `PATH`. **What to do:** Run `devmachine setup --machine `. On your own computer it runs the `mac-brew` package's bootstrap (or `mac-ports`'s, when the machine lists it), which lists what is missing and installs it after you agree — no key, no password, no lock-down involved. See [what a machine needs](/how-it-works/what-a-machine-needs/). ## "the Mac has neither Homebrew nor MacPorts" ``` the Mac has neither Homebrew nor MacPorts: run again with --package-manager brew or --package-manager ports the Mac has both Homebrew and MacPorts: run again with --package-manager brew or --package-manager ports ``` **What it means:** A Mac gets Ansible through a package manager, and the machine lists no `mac-brew` or `mac-ports` package. `setup` looked at the Mac (`/opt/homebrew/bin/brew`, `/usr/local/bin/brew`, `/opt/local/bin/port`) and found none, or both, so it cannot pick one for you, and there was no terminal to ask at. Nothing on the Mac was changed. **What to do:** Choose one and run the same command again with `--package-manager brew` (Homebrew) or `--package-manager ports` (MacPorts). Or add the package yourself: `devmachine packages add mac-brew --machine `. ## "machine … lists mac-brew and mac-ports: keep one" ``` machine "studio" lists mac-brew and mac-ports: keep one ``` **What it means:** Both package manager packages are on the machine, and each would install Ansible its own way. `setup` stopped before changing anything. **What to do:** Remove one from the machine's `packages:` in `config.yml`, then run `setup` again. ## "nothing was installed; setup stops here" **What it means:** `setup` listed what the Mac lacks (the Command Line Tools, Homebrew or MacPorts, Ansible) and you answered no. Nothing was installed, and without Ansible the Mac cannot be synced. **What to do:** Run `setup` again and answer yes, or install the listed items yourself and run `setup` again: it finds them and installs nothing. ## "nothing was installed: run again with --install-prerequisites" ``` nothing was installed: run again with --install-prerequisites to install Xcode Command Line Tools and Homebrew ``` **What it means:** The Mac lacks the items named, and `setup` had no terminal to ask whether to install them. `--yes` does not count as that answer: it means other things, and the macOS app passes it in the background. See [why consent has its own flag](/how-it-works/what-a-machine-needs/#why-consent-has-its-own-flag). **What to do:** If you agree to install them, run the same command again with `--install-prerequisites`. Installing the Command Line Tools takes 5 to 10 minutes. ## "the bootstrap stopped at …" ``` the bootstrap stopped at homebrew: the Homebrew installer failed; its output is above. It needs passwordless sudo for the admin login. ``` **What it means:** The package manager package's bootstrap failed at the step it names (`command-line-tools`, `homebrew`, `macports`, `ansible`), and the rest of the message is its own advice. Steps before it are done; running `setup` again skips them. **What to do:** Do what the message says, then run `setup` again. The most common cause is an admin login whose `sudo` asks for a password: the bootstrap only uses `sudo -n`. ## "no mac-brew package with a bootstrap is available here" **What it means:** On your own computer, `setup` runs the `mac-brew` package's bootstrap from the package cache, and the pinned packages release has no such package (or no release is pinned). **What to do:** Run `devmachine packages pin` to pin the latest release, then `devmachine setup --machine ` again. ## "machine X is your computer (self: true), so it has no hosts" **What it means:** A server marked `self: true` in `config.yml` also has `hosts`, `user`, `port` or `key` set — whichever the message names. Your own computer has no address, so it cannot carry these. **What to do:** Remove the field the message names. The same error appears, one field at a time, for `user`, `port` and `key`. ## `sync` on a self machine fails with "ESTABLISH LOCAL CONNECTION FOR USER: root" **What it means:** Ansible asks the shell it runs in who is logged in, not your configuration. Some shells — a login shell started by a GUI app, cron, or a launcher — leave `LOGNAME` set to `root` with `USER` empty. Ansible believed it, looked for `/var/root`, and failed there instead of in your own home. **What to do:** Nothing — this is fixed for you. `devmachine sync` on a `self: true` machine pins `ansible_user` in the generated inventory to the account devmachine itself runs as (read from the operating system, not from `USER`/`LOGNAME`), and exports the right `USER`, `LOGNAME` and `HOME` around the `ansible-playbook` run. If you still see this on a current release, run `whoami` and `echo $HOME` in the terminal you launched devmachine from, and check they say what you expect. ## "… is not a usable location" **What it means:** A `--location` flag, the answer to the location question, or a `location:` in `config.yml` has a character outside the allowed set, or is longer than 40. Capitals and spaces at the ends are fine: they are lowercased and trimmed. **What to do:** Use letters, numbers, spaces, dots, underscores and hyphens, starting with a letter or number — `home office`, `rack-2`, `hostinger`. To go back to the default, clear it with `devmachine machines edit --location ""`. ## A `tailscale:` address is being ignored **What it means:** devmachine drops a `:` entry when the network package says the network is not reachable from your computer — Tailscale is not installed, not running, or does not know that name — and tries the next address instead. This is by design. **What to do:** Run `devmachine resolve`. It lists every entry it skipped, with the reason the package gave. Then run `tailscale status` and check the server is listed under the name you wrote. On a Mac with only Tailscale's app, there is no `tailscale` on `PATH`. The CLI still finds the app's own CLI in `/Applications/Tailscale.app/Contents/MacOS`, so the app being open and signed in is enough. Run `/Applications/Tailscale.app/Contents/MacOS/Tailscale status` to check it by hand. ## "no package declares the prefix" **What it means:** A `hosts` entry is written `:`, and no package in your pinned release or your own `packages/` folder declares that prefix in a `network:` block. The entry is skipped. **What to do:** Add the network package to the machine (`devmachine packages add `) and `sync`, or check the prefix for a typo. For `tailscale:`, a packages release from before network packages still works: the CLI's built-in resolver answers when no package does. ## "the X package's resolve did not answer within 5s" **What it means:** The package's `resolve` script, which runs on your computer, took too long, so its entry was skipped. The network's own command is probably stuck: for Tailscale, `tailscale status` hangs too. **What to do:** Run the network's own status command. Restart its app if that hangs as well. ## "joining X did not finish … run `devmachine sync`" **What it means:** `devmachine login ` ran the package's `join` script on the machine, and it failed. The most common reason is that the package is not on the machine yet: `join` runs from where `sync` put it. Otherwise, the script's own output, above the error, says what went wrong. **What to do:** `devmachine sync`, then `devmachine login ` again. ## `ssh -devmachine` says "no address answered" or "Connection closed by UNKNOWN" **What it means:** The alias connects through `devmachine ssh-proxy`, and none of the machine's addresses accepted a connection. ssh shows the proxy's error, which lists every address and why. **What to do:** Run `devmachine resolve` to see which addresses were tried. If it says `devmachine: command not found` instead, the CLI moved since the alias was written: run `devmachine aliases --write` again. ## `devmachine ssh ` on a Mac ends with "exit status 255" and "Remote Login may not allow" ``` exit status 255: the Mac's Remote Login may not allow alice; `devmachine doctor --machine studio` checks it ``` The Mac's own log (`log show --predicate 'process == "sshd"' --last 5m`) says `pam_sacl: denying 'alice' due to failed service ACL check`. **What it means:** Remote Login on that Mac is set to "Only these users", and the workspace account is not on the list (the group `com.apple.access_ssh`). macOS refuses the login before it checks the key, so `ssh` only sees the connection close. The CLI adds this hint only for a machine it last saw as a Mac; exit 255 has other causes too, such as an address that does not answer. **What to do:** Run `devmachine doctor --machine `. An `ssh access: ` warning confirms it. Run `devmachine sync`, which adds each workspace account to the list, or, on the Mac, choose "All users" in System Settings > General > Sharing > Remote Login. See [what a machine needs](/how-it-works/what-a-machine-needs/#remote-login-set-to-only-these-users). ## `devmachine run` exits 255 **What it means:** The command never ran: `run` could not find the machine or workspace, could not connect, found a changed host key, or the package is not installed there. The line after `error:` says which. `ssh` uses 255 for the same thing, so a script can tell it apart from the command's own failure. A command that exits 255 by itself, or that was stopped with Ctrl-C or SIGTERM, also ends with 255. **What to do:** Read the `error:` line. For a connection, `devmachine doctor --machine ` checks the way in. ## "with --argv, the program and its arguments follow `--`" **What it means:** With `--argv`, everything after `--` is the program and its arguments. Without `--`, the arguments would be read as flags of `devmachine` itself. **What to do:** `devmachine run --argv -- df -h /`. ## "--script "…" names a file inside the package" or "… has no file …" **What it means:** `run --package --script ` runs a file of that package, relative to its `package.yml`. A path that leaves the package (`../`, or starting with `/`) is refused before anything connects, and `run` exits 1. "has no file" means your copy of the package does not have that file, so the machine's copy, which `sync` made from yours, does not either. **What to do:** Use the path as it appears inside the package folder, for example `widgets/disk/check.sh`. If you just added the file, run `devmachine sync` so the machine gets it. ## `doctor` says an alias has "a fixed address, expected one resolved when ssh connects" **What it means:** The alias was written with the address itself, by an older version or while `devmachine` was not on your `PATH`. It works until that address stops working. **What to do:** `devmachine aliases --write`. See [SSH aliases that resolve when you connect](/how-it-works/addresses-and-fallback/#ssh-aliases-that-resolve-when-you-connect). ## `doctor` says `skip ssh aliases managed outside devmachine (ssh_aliases: false)` **What it means:** `config.yml` does not have `ssh_aliases: true`, so devmachine does not keep your SSH aliases. You manage `~/.ssh/config` yourself, and doctor does not judge a file it did not write. Nothing is wrong. **What to do:** Nothing, if you keep `~/.ssh/config` on purpose. To have devmachine keep the aliases and check them, run `devmachine aliases --write` once and say yes. See [SSH aliases](/concepts/reaching-your-server/#ssh-aliases). ## `doctor` exits non-zero, but most machines say `pass` **What it means:** With several machines, `doctor` checks all of them and exits non-zero when any one has a `fail`. The error names which ones, for example `some checks failed on far`. **What to do:** Look at that machine's block, or run `devmachine doctor --machine far` to see only its checks. ## "package X runs on linux; machine Y is macos" ``` package "firewall" runs on linux; machine "studio" is macos ``` **What it means:** The package's `package.yml` lists the systems it runs on under `platforms`, and the machine's system is not one of them. `sync` (and `update`, which syncs) stopped before changing anything on the machine. The machine's system is what `setup`, `sync` or `doctor` last read from it — `devmachine machines show ` prints it — and `sync` checks again on what it reads as it connects. The reverse, `runs on macos; machine … is linux`, is the same stop for a Mac-only package on a Linux server. **What to do:** Take the package off that machine or workspace with `devmachine packages rm ` (add `--workspace ` for a workspace package), then sync again. If the package is your own and does run on that system, add the system to its `platforms`. If the machine was rebuilt with another system, run `devmachine doctor --machine ` so the CLI reads it again. `devmachine packages add` and `devmachine workspaces edit --add` stop the same mistake up front, with `package "docker" runs only on linux and machine "studio" is macos, so it was not added`; nothing is written. `devmachine workspaces new` leaves such a package out of the default list and says so, and refuses it in `--packages` with `leave it out of --packages`. A package can also be refused because of one it needs: `needs systemd-unit, which runs only on linux`. Both check only once the machine's system is known, so a list written before that can still reach `sync` with a package that does not fit. A Mac added by an older CLI may list `essentials`, which runs only on Linux. Swap it for what a new Mac starts with: `devmachine packages rm essentials --machine `, then `devmachine packages add base --machine ` and `devmachine packages add devmachine-app --machine `. ## `packages validate` warns about devmachine_account ``` warning: notes/defaults/main.yml:2: reads devmachine_account, but no task in this package registers it. … ``` **What it means:** The package uses `devmachine_account` (a workspace account's home or group), but none of its own tasks sets it. Ansible keeps a registered variable after the role that set it ends. So this package reads the account the previous package left, which on a machine with several workspaces can be another workspace's. Files then land in the wrong home, or get the wrong group. On a machine with one workspace it looks fine, which is why it can go unnoticed. It is a warning, not an error: `validate` still passes and `sync` still runs. **What to do:** Add this as the first task of the package's `tasks/main.yml`, as the upstream packages do: ```yaml - name: Read the account's home and group ansible.builtin.user: name: "{{ devmachine_workspace.user }}" check_mode: true changed_when: false register: devmachine_account ``` It only reads the account and never changes it. See [one package on many systems](/how-it-works/packages-on-many-systems/). ## A setting is accepted, but the package still uses its default **What it means:** A setting reaches the server as `devmachine__`, with dashes and dots turned into underscores. If the package reads a different variable name, your value arrives but nothing looks at it. **What to do:** See what was actually sent: ``` devmachine run --machine main -- "cat /opt/devmachine/host_vars/devmachine.yml" ``` If your variable is there under a different name than the package's own `defaults/main.yml` uses, the package needs fixing — the name in its defaults is the name a setting has to match. ## `machines edit` or `workspaces edit` says it "does not install the package" **What it means:** The setting's first part, before the dot, names a package that machine or workspace does not have. Nothing would read the value: the role would keep its default, so the CLI refuses it instead. It is usually a typo in the package name, or a package added to the workspace when the setting is on the machine (or the other way round). **What to do:** Check the name with `devmachine packages list`. If the package really is missing, add it first (`devmachine packages add --machine main`), then set the value. ## `devmachine ssh` opens a session as the wrong user **What it means:** `devmachine ssh` with no argument logs you in as the server's **root** account, not a workspace. **What to do:** Name the workspace: `devmachine ssh acme`. ## Changes to config.yml appear to be ignored **What it means:** devmachine may be reading a different file than you think. **What to do:** Check which one: ``` devmachine config path ``` `DEVMACHINE_CONFIG` in your shell beats the default location, and a `--config` flag beats everything. ## `secrets list` shows nothing after storing one **What it means:** The list of names lives in your configuration folder, even though the values themselves live in your keychain. **What to do:** Check you are using the same configuration folder you used when storing it — see `devmachine config path` above. ## `secrets set --env-file` refuses the path **What it means:** `--env-file` takes a path relative to the workspace's own home, and the one given would land outside it — an absolute path (`/etc/passwd`), or one with enough `../` to walk out of the home directory. **What to do:** Give a path inside the workspace, such as `app/.env` or `.env`. There is no way to deliver a workspace secret outside that workspace's own home. ## `credentials push` says a path "reaches outside the workspace's home through a symbolic link" **What it means:** The path looked fine on your computer, but on the machine one of its directories — or the file itself, or its `.devmachine.bak` — is a symbolic link that points outside the workspace's home. The path is either the `--env-file` of a workspace secret, or where a package delivers a workspace credential (`~/.devmachine//env`, or the package's own `path`). The push runs as the machine's admin, and the workspace's own account can create links anywhere in its home, so following one would let that account aim a root write at any file on the machine. The push stops before it reads or writes anything. **What to do:** Look at the path on the machine (`ls -la` each directory on the way). If the link is yours and meant, point `--env-file` at the real file inside the home instead, or replace the link with a real directory or file. If nobody in the workspace made it, treat it as a warning about what runs in that workspace. A link that stays inside the home is followed as usual. ## `sync` says a path "reaches outside the home of through a symbolic link, so the shared login was not copied there" **What it means:** A login shared across workspaces (such as `gh` or `git-key`) lands at its `stored_at` path in each workspace's home. In the named account's home, one directory on that path, or the file itself, is a symbolic link that points outside the home. The copy runs as that account, never as root, so the link could never have let it write a file the account could not already write. But a login copied to some other place would be lost or leaked, so `sync` stops at that account instead. Nothing is written there, and nothing outside the home changes. **What to do:** Look at the path in that workspace (`ls -la` each directory on the way, then the file). Replace the link with a real directory or file, or remove it, and run `sync` again. If you want that workspace to keep a login of its own, opt it out with `devmachine workspaces edit --share =own`. If nobody in the workspace made the link, treat it as a warning about what runs in that workspace. A link that stays inside the home is followed as usual. ## A workspace secret was pushed, but the app never sees it **What it means:** `devmachine credentials push` writes the value into `~/.devmachine/env` (or the `--env-file` you gave), but nothing runs that file for you — that is the shell's job, not the CLI's. **What to do:** For the default `~/.devmachine/env`, check the workspace's shell actually sources it: the `workspace` package loads it through `~/.devmachine/shellenv`, which zsh, bash and sh all read, from packages v37 on. Run `devmachine sync` if the machine is on an older packages release. For `--env-file`, check the app reads that exact file and reloads its process after the value changes — this only writes the file, it does not restart anything running. ## `dns status` says a name does not resolve, but it works in the browser **What it means:** The check runs from **your computer**, not the server, and it ignores your browser's cache and any proxy you use. A name that works in the browser but not here usually means DNS has not finished propagating everywhere, or something local — a VPN, an `/etc/hosts` entry — is resolving it just for you. **What to do:** Wait a few minutes and check again, or check your own network settings for something overriding DNS. ## `dns add`/`dns rm`/`dns list`/`dns check` fail with one of these Every DNS provider reports one of a fixed set of errors, shown here in plain words: | Error | What it means | | --- | --- | | `zone not found, or the token cannot see it` | This domain does not exist under this provider, or your token cannot see it. | | `the token was rejected` | Your credential is wrong or expired. Store the new one with `devmachine secrets set` and run `devmachine credentials push`: it replaces the old copy on the machine. On Hostinger, a 403 before packages v26 was the provider itself, not your token — see below. | | `the token cannot change this zone` | Your token can read the domain but not write to it. | | `the record was rejected` | The registrar refused the value — a bad type, a bad value, or a name it will not accept. | | `rate limited` | The registrar's API is temporarily blocking this token from making more requests. devmachine never retries this on its own; wait and run the command again. | | `this record type is not supported yet` | The types are `A`, `AAAA`, `CNAME`, `TXT`, `MX`, `SRV`, `NS` and `CAA`. `SOA` belongs to the registrar. | | `the value does not fit the type` | The value was refused before any provider was asked: an MX is ` `, an SRV ` `, a CAA ` `, an `A` an IPv4 address. The message says which part is wrong. | | `the installed provider cannot add a value next to the ones a name holds` | The provider package on the machine predates `dns add --append`. Run `devmachine update` to get one that accepts `append`, or leave out `--append` to make the name hold just this value. | | `the name holds several values` | Two installed providers both claim this domain. Say which one with `--dns-provider`. | Two more lines that are not errors, but change what a command does: - **"no installed provider holds this zone"** — none of the providers you have installed recognized this domain. This is normal for a registrar with no devmachine package yet: the command falls back to `manual` and prints the record for you to create by hand. - **"no DNS provider is installed"** — the machine has no DNS provider package at all, so the record is printed. `devmachine packages list` shows the providers you can add. - **"… could not be reached, so no DNS provider on it was asked"** — a provider runs on the machine, so with the machine down nothing can be written or removed, and the record is printed instead. Once the machine answers, `devmachine dns add` or `devmachine dns rm` does it for you. - **"the provider failed"**, with something that looks like a crash — this is a bug in the provider package, not in devmachine itself. The package sent back something that does not match the [DNS provider contract](/reference/dns-provider-contract/). ## Hostinger answers every call with HTTP 403, but the token works with `curl` **What it means:** Before packages `v26`, the `hostinger` provider sent Python's default User-Agent, and Hostinger's firewall answers that with a 403 — the same status a token without DNS access gets. Every `dns` command said the token was rejected, and `expose add` fell back to printing the record by hand. **What to do:** `devmachine packages pin v26` (or later) and `devmachine sync --tags hostinger`. A token without "Domains portfolio" permission also needs the zones listed: `devmachine machines edit main --set hostinger.zones=[example.com]`. ## GoDaddy answers 403 ACCESS_DENIED to every command **What it means:** GoDaddy does not allow the account on its Domains API. It is not the token. GoDaddy lets only accounts that hold a domain, or a plan with management access, call it, and answers every other call with `403 ACCESS_DENIED`. **What to do:** Ask GoDaddy directly: ``` curl -H "Authorization: Bearer $PAT" https://api.godaddy.com/v1/domains ``` A `403` there is GoDaddy's account rule, and a new token will not change it. A `200` with an empty list means the account has no `ACTIVE` domain, so `devmachine dns providers` shows no zone. ## `expose add` said "the DNS record for … was not written" **What it means:** The site is on Caddy, but the DNS provider refused the record; the reason is on the same line. Until the record exists, visitors cannot find the site and Caddy cannot get its certificate. **What to do:** Create the record the command printed, or fix the provider (see the table above) and run `devmachine dns add A
`. ## `expose rm` or `workspaces destroy` said "the DNS record for … was not removed" **What it means:** The site is off Caddy, but the record that pointed the name at the machine is still there: the DNS provider could not list the zone, refused the delete, or its setup is broken; no DNS provider is installed, or the machine could not be reached to ask one; or the name also points at another address, and taking one value out of several is left to you. The reason is on the same line. The name still resolves, and visitors get a TLS error instead of nothing. **What to do:** Remove the record the command printed, or fix the provider (see the table above) and run `devmachine dns rm A
`. ## `expose rm` or `workspaces destroy` says a name "points at …, not at …: its DNS record is left alone" **What it means:** The name's A record no longer holds the serving machine's address, so `expose rm` did not touch it. Somebody repointed the name after `expose add`, maybe at a new server. **What to do:** Nothing, if the new value is right. If the name should go, remove it with `devmachine dns rm A `. ## A certificate never arrives after `expose add` **What it means:** First check `devmachine expose list`: a `pending` site never reached Caddy (the machine was out of reach, or `--no-apply` was used), and `devmachine sync` publishes it. A `published` site is on Caddy, and Caddy (the reverse proxy) only gets a certificate for a name that already points at the server. Two common causes: - **The name does not resolve yet.** DNS can take a few minutes to catch up, even if `expose add` already wrote the record (or printed it for you to add by hand). Caddy keeps retrying on its own; `devmachine dns status ` tells you when it has caught up. - **Caddy has not noticed the new site yet.** It watches for changes, but can miss one on a busy server. **What to do:** Wait for DNS, or force Caddy to reload: ``` devmachine run --machine -- 'systemctl reload caddy' ``` ## `expose add` says "caddy refused the new … routes file, so the old one stays" **What it means:** The route is in `config.yml`, but `caddy validate` refused the whole configuration with the new file in place, so nothing on the machine changed and Caddy serves what it served before. The lines after the message are Caddy's own words. Two common causes: - **Another file in `sites.d` already names the host.** Caddy refuses one host in two files. `devmachine expose list` shows it as `unmanaged`; remove that file, or drop this route and adopt the other one. - **The configuration was already broken** by a file that has nothing to do with this route — something written by hand, or by a package. Caddy checks everything, so any broken file stops the new one. **What to do:** Fix what Caddy names, then run `devmachine sync` — the route is still recorded as `pending`. `devmachine expose rm ` drops it instead. ## `expose add` says the route is pending **What it means:** The route is in `config.yml`, and the machine does not serve it yet. The message says why: the machine could not be reached, or `caddy` is in the configuration but not installed there yet. It is not an error, so the command still succeeds. **What to do:** `devmachine sync` when the machine is back, or once more to install `caddy`. ## `expose add --via` says "no address of … another machine can reach" **What it means:** The machine with Caddy has to reach the workspace's machine, and every address that machine has is a loopback one, such as the `127.0.0.1` a local VM starts with. Only your computer can use that address. **What to do:** Put the machine on your private network and run `devmachine login tailscale --machine `, which adds its `tailscale:` name to `hosts`. Your own computer must be on that network too, since that name is resolved there. See [share an app on your computer with friends](/guides/share-a-local-app-with-friends/). ## `expose add` served, and the response is "Blocked request" **What it means:** This is your application's own check, not Caddy and not `expose`. Many frameworks refuse a `Host` header they do not recognize by default, as a safety guard — and a name you just published is exactly the kind of header the app has never seen before. **What to do:** Add the published hostname to your application's own list of allowed hosts. `expose` has nothing to do with that list. ## A sync cannot fetch the release ``` fetching https://github.com/.../packages-v1.tar.gz: the server answered 404 ``` **What it means:** The pin in `config.yml` names a release that does not exist. **What to do:** Check `packages:` in your configuration against the tags the packages repository actually has — a pin is a release tag, never a branch. If the URL looks right, the problem is your network: this is a plain anonymous download, so a proxy or firewall that blocks GitHub blocks this too. Once a release is downloaded, it is cached — a later sync at the same pin needs no network at all. ## "the asset changed, which a pin exists to prevent" **What it means:** The file downloaded does not match the checksum the release published. devmachine refuses it and stops, rather than send it to your server. **What to do:** This means the release was changed after it was published, or something altered it in transit. Get the release fixed, or pin a different one. ## `update` says "package release v34 has no package named "devmachine-skills"" ``` ==> 3/3 Skills failed: package release v34 has no package named "devmachine-skills" ``` **What it means:** Usually not that the release lacks the package. Before 0.7.32, two devmachine commands that downloaded the same release at the same moment could delete each other's copy. `update` pins the new release and then downloads it for the skills step, while the Mac app runs `packages list` on its own. The command that finished second removed the release the first one was reading, so the package seemed missing for a moment. **What to do:** Run `devmachine skills update --yes`. The pin has already moved, and the release is now complete in the cache. From 0.7.32, each download works in its own folder and never removes a complete release, so the first one to finish is the copy every command uses. If the error comes back, the release really lacks the package: check `devmachine packages list`. ## "package X needs a CLI >= 0.3.0, and this one is 0.2.1" **What it means:** The package says which CLI version can read it, and yours is older. **What to do:** Upgrade: `brew upgrade devmachine`. Or pin an older release of the packages instead, if upgrading is not your call to make. ## "package X is a workspace package, and main is a machine" **What it means:** Some packages belong on a server (shared by everyone, like Docker); others belong to one workspace (like Claude Code, which needs its own sign-in per person). You tried to add this one in the wrong place. **What to do:** Use the command the error shows, for example: ``` devmachine packages add claude-code --workspace acme ``` ## "package X extends caddy.sites.d, but caddy is not installed on machine main" **What it means:** This package adds files into a place another package manages, so that other package has to be on the same server. **What to do:** ``` devmachine packages add caddy --machine main ``` The same error appears if the package is installed but does not declare that it provides that place — check its `provides:` against the `extends:` that names it. ## A file a removed package left behind is still on the machine **What it means:** `sync` only removes a file it remembers writing — see [What sync removes](/how-it-works/what-sync-removes/). If a package was removed from your configuration before you upgraded to the version that started tracking this, `sync` never recorded that file, so it never cleans it up. **What to do:** Find it under the directory the extending package used (`sites.d` for Caddy) and remove it by hand: ``` devmachine run --machine -- 'rm /etc/caddy/sites.d/-' ``` Then reload Caddy, if it is on the server: ``` devmachine run --machine -- 'systemctl reload caddy' ``` ## `sync --check` fails on a machine nothing has been applied to yet A dry run against a server with no packages applied yet reports failures like: ``` No package matching 'docker-ce' is available Could not find the requested service caddy: host ``` **What it means:** Nothing is actually wrong. A dry run changes nothing, so a package's software repository is never really added, and the package it would have provided genuinely is not there to look at yet. **What to do:** Run `devmachine sync` for real once. After that, `--check` is meaningful, because there is something on the server to compare against. Use a dry run to preview a change to a server you already built — not to preview the first build itself. ## "another sync is running on …: wait for it to finish, then run this again" **What it means:** Another `sync` or `sync --check` holds this machine right now. It can be one in another terminal, one from another computer, or the app's Prepare button. Two runs at once would delete each other's files on the machine, so the second one stops before it changes anything. **What to do:** Wait for the other run to end, then run yours again. The lock clears itself when that run ends, when its connection drops, and after a reboot, so there is nothing to remove by hand. See [one sync per machine](/how-it-works/one-sync-per-machine/). ## `sync --check` fails on a skill with "getgrnam(): name not found: '1001'" A dry run stops on a task like `global-skills installs the workflow skill`, with `KeyError: "getgrnam(): name not found: '1001'"`, and a real `sync` of the same machine passes. **What it means:** The machine has an older Ansible (ansible-core 2.16, the Ubuntu 24.04 package). Its `copy` module looks a folder's group up by name in a dry run only, and devmachine gives the workspace's group as a number, because a Mac has no group named after each account. CLI versions 0.8.0 to 0.10.0 have this problem. **What to do:** Update the CLI. From v0.10.1 a dry run leaves that one group out, so it does not report group changes on a skill's files. A real run still sets the group. ## `sync` asks and I answered nothing **What it means:** An empty answer counts as no, and so does closing the input. A command that changes a server defaults to changing nothing. **What to do:** Pass `--yes` to skip the question, or `--check` to see what would happen without being asked at all. ## `expose add --yes` or `dns add --yes` says "nothing was changed" **What it means:** `--yes` only skips questions about files on your computer. It never says yes to putting something on the internet, so the publish question was still asked. In a script or a pipe nobody answered, an empty answer counts as no, and the command stopped. It exits non-zero so a script does not take "I did not do it" for "done". **What to do:** Pass `--publish` to `expose add` or `dns add` when the command runs without a person to ask. `--check` shows what it would do first. ## `ERROR! Invalid options for include_role: devmachine__` **What it means:** This was a bug in how devmachine generated its internal Ansible playbook, and it is fixed. If you see it, your binary predates the fix. **What to do:** Build or install a newer devmachine. Nothing on the server was changed — the run stopped before it started. ## `credential "X" cannot be shared` **What it means:** You asked to share this login (`X: machine`), but the package that declares it says it cannot be — usually because the tool's session file is tied to one device or browser, and a copy of it would not work anywhere else. **What to do:** Ask for `own` instead, and sign in once in each workspace. If you know a copy really does work for that tool, the fix belongs in the package: add `shareable: true` to its declaration. ## The shared login did not reach a workspace **What it means:** Two common reasons, in this order: - **Nobody has signed in yet.** The copy comes from a login already stored on the server, and `sync` skips a workspace rather than fail when there is nothing to copy. - **That workspace keeps its own login.** A workspace with `: own` in its `credentials:` is deliberately left out of the copy, so it never loses the account it signed in with. **What to do:** Run `devmachine login ` then `devmachine sync --tags credentials`, or remove the `own` line if you meant to share after all. ## `credentials list` says `unknown` **What it means:** The package never said where its tool keeps this login, so devmachine has nowhere to look. The login may well be there. **What to do:** Add `stored_at:` to the package's declaration, and the row starts giving a real answer. ## "credential X belongs to a workspace: name it with --workspace" **What it means:** Two workspaces sign in to the same tool with different accounts, so "where do I log in" has no single answer. **What to do:** Name the workspace. The list in the error shows every workspace that uses it. ## "the connection dropped after part of the input was sent" A machine with several addresses in `hosts:` is normally tried one address after another until one answers. That is safe only while nothing has been sent yet. This error means the first connection took part of a file or a secret and then dropped. Sending the rest to the next address would leave a cut-off file on the machine, so the CLI stops instead. Run the same command again. If one address keeps dropping, move the stable one first in `hosts:`. ## The SSH host key is not trusted **What it means:** Configurations made by v0.6 and earlier have no stored server identity. devmachine will not learn one silently. **What to do:** Run `devmachine machines trust `, compare the fingerprint it shows with your provider's dashboard or another source you trust, and approve it. This command reads the key without logging in. ## The SSH host key changed **What it means:** Something about the server no longer matches what devmachine trusted before. This can mean a deliberate rebuild, a configuration mistake, or an attack — devmachine cannot tell which, and will not connect until you decide. **What to do:** Run `devmachine machines trust --check`. It reads the presented key without logging in, writes nothing, and prints both fingerprints, a command to print the same key on the server, and the fix. Run that command from the machine's own console — the provider's web console, or `limactl shell` on the Mac that runs a Lima VM — never through the SSH connection you are trying to verify. If the fingerprints match, run `devmachine machines trust --replace`. `--yes` skips confirmation — that never substitutes for `--replace`. `run` can keep working for up to five minutes after the key changes. It reuses the connection it opened last time, which was checked when it was opened and still goes to the same server. The first new connection after that checks the key again and stops with this error. ## The host key changed after restarting a Lima VM **What it means:** Usually nothing bad. Lima hands the VM a new cloud-init instance ID (`iid-