_desktopdocs

Linux desktops for agents

Run multiple desktops locally or on a server you control. Give each agent an HTTP API for apps, shell commands, and desktop input. Watch or take over from your browser.

your-machine
git clone https://github.com/tanav29/desktop.git
cd desktop
node desktop-cli.mjs new --name research
node desktop-cli.mjs new --name coding

Run these commands with Docker and Node.js 20 or newer.

Architecture

A daemon in every desktop

Every container runs its own daemon and XFCE session. Point your agent at the printed API URL and have it read GET / for desktop control instructions.

  • Agent

    Sends actions to its desktop through HTTP or the TypeScript SDK.

  • Browser

    Connects through noVNC to view and operate the same desktop.

  • Workspace

    Keeps files on the Docker host after the container is removed.

Agent ── HTTP + bearer token ──> Daemon
                                    │
                               XFCE on Xvfb
                                    │
Browser ── viewer password ──────> noVNC

/workspace <── bind mount ──> Host workspace
sdk/drive.mjsfull API →
import { Desktop } from "./dist/index.js";

const desktop = new Desktop({
  host: "127.0.0.1",
  port: 49152, // Replace with the printed API port
  token: process.env.DESKTOP_TOKEN,
  workspace: "../.desktop-workspaces/research",
});

await desktop.create("xterm", { title: "desktop-demo" });
await desktop.actions([
  { do: "wait_for", window: "desktop-demo" },
  { do: "focus", window: "desktop-demo" },
  { do: "type", text: "echo hello" },
  { do: "key", keys: "Return" },
]);
await desktop.screenshot("example.png");

Drive it from code

Control a desktop from Node.js

Launch a terminal, then wait for its window, focus it, and type a command in one request. The screenshot is saved in the desktop’s workspace.

Developed in public

Browse the source, follow changes to the launcher and daemon, or report an issue on GitHub.