# Run conversations on another machine

A machine is any computer OpenProgram reaches. A project is a folder on one machine with a shell, and every conversation in the project runs on that machine, in that folder.

| Environment | Commands run | Files read and written |
| --- | --- | --- |
| This computer (always exists) | This computer | This computer |
| SSH host | Remote host, in the project's folder there | Remote host |
| Docker container | A container for this conversation | This computer; the project's folder is mounted at the same path |

A [channel](https://fzkuji.github.io/OpenProgram/docs/integrations/channels.html) only decides where messages are mirrored. Binding one never moves where tools run.

## Open a project on a machine

1. In a new chat, open the project menu in the top bar and choose **Open folder on…**, or **Add project folder…** on the Projects page.
2. Pick the machine. One that is not connected is greyed; **Add device…** opens Settings → Devices.
3. Pick the folder. This computer and a Docker machine use the usual folder picker. An SSH host opens a browser of its folders, starting in its remote folder; type a path or step into a subfolder.

The project menu lists projects under their machine, this computer first. The home project is always on this computer. The machine chip above the message box shows the project's machine; it cannot be switched there, because the project decides. To run on another machine, open a project there.

| Dot beside a machine's icon | Means |
| --- | --- |
| Green | Connected |
| Turning ring | Connecting |
| Grey | Switched off |
| Red | Could not be reached |

The sidebar shows a project on another machine with that machine's icon, dot and name beside the project's name.

## Add a machine

In **Settings → Devices**, or from the terminal. Each machine there has **Test**, **Edit**, **Remove** and an on/off switch. `openprogram setup` has a **Machines** step.

| Command | Effect |
| --- | --- |
| `openprogram machines add devbox --name "Dev box" ssh target=me@devbox workdir=~/work` | `target` is `user@host` or a host from `~/.ssh/config`. `workdir` is an absolute or `~` path; blank is the remote home. This computer on port 22 is refused; on another port, as in `ssh://me@127.0.0.1:2222`, it reaches a virtual machine or container whose port is forwarded. |
| `openprogram machines add sandbox docker image=python:3.12` | Default image `ubuntu:24.04` |
| `openprogram machines list --kinds` | All machines, on or off; `--kinds` adds each connection method and its settings |
| `openprogram machines test devbox` | Checks that the machine answers |
| `openprogram machines disable devbox` | Switches it off: its projects are greyed and take no new conversation, their conversations' next commands and file calls stop with an error, and its containers are removed with the files in them before the command returns. Switched off in Settings, the machine first lets the commands already running there finish (up to 5 minutes), and switching it back on meanwhile keeps its containers. `enable` switches it back on. |
| `openprogram machines remove devbox` | Removes it, in the same way |

IDs are lowercase letters, digits, `-` or `_`, and never change; only the name is edited. The `environments` section of an older configuration is not read: add those places again as machines.

Each machine is reached one way, and that decides what it is for. SSH hosts and Docker containers run commands. An OSWorld virtual machine (`openprogram machines add lab osworld url=http://192.168.64.2:5000`) gives [computer use](https://fzkuji.github.io/OpenProgram/docs/capabilities/computer-use.html) its screen.

Another computer's OpenProgram, added by pairing, shows its conversations here and runs them there. When **Let paired devices operate this computer** is on over there, computer use can also operate its windows, screen and browsers.

## Requirements

|  | Needs and behaviour |
| --- | --- |
| SSH sign-in | System `ssh` with `BatchMode=yes`: nothing may prompt. Use a key your SSH agent or `~/.ssh/config` provides. New host keys are accepted once, then checked. Connections are shared for five minutes. |
| SSH host | A POSIX shell, `find` and `grep`; `rg` when installed |
| Docker | `docker` on the PATH and the daemon running |
| Docker container | One per conversation, `openprogram-<machine>-<conversation>`. The first command starts it, later ones reuse it, so installed packages persist. Started again by the next command after a Docker restart, `docker stop` or removal by hand. Recreated if the conversation's folders change. Removed with its files when the conversation is deleted, alone or by Clear all, and when its machine is removed or switched off. Another OpenProgram installation using the same Docker keeps its own containers. |

## Limits

- A turn's undo does not cover files changed on an SSH host; files on this computer are still restored.
- A project on an SSH host has no git pill, worktrees, automatic commits or **Reveal in file manager**; the Files panel and `@` file search read the folder on the host.
- On an SSH host a file must be read before it is edited, and an edit is refused if it changed since that read.
- The local sandbox applies only to this computer. SSH and Docker have the permissions of the remote account or container.
- If the machine is removed or switched off, even during a turn, the conversation's next command or file call stops with an error, never falling back to this computer. Add it back with the same ID, switch it on, or open the project's folder on another machine.
