Docs · 02

Connecting a machine.

A machine reaches CommandAGI through a host — the program on the computer it is plugged into — or straight from the browser page.

The host

The host is the program that gives the workbench this computer's files and the machines attached to it. There is exactly one host per computer. The desktop app is a host; so is the background service, started with commandagi daemon start. When the desktop app starts, it takes over from a running service.

The host listens on 127.0.0.1 only (port 4173 by default, or any free port), and keeps its state in ~/.commandagi:

filewhat it holds
host.jsonthe account this host is linked to, its id and its link settings (owner-only)
grants.jsonthe standing grants made on this host (owner-only)
principals.jsonhashes of principals' credentials and the trusted account keys (owner-only)
mcp.jsonthe local MCP endpoint and its per-launch token (owner-only)
daemon.jsonwhich process is hosting, on which port
settings.json, recents.json, devices/, worlds/your user-level settings and definitions
daemon.logthe host's log

Available today: the host ships inside the desktop app. The host's own command line — commandagi daemon, grant, mcp — is documented here as it is built, but it is not yet published as an installable package. (The commandagi package on npm today is the SDK's command line; see SDK and MCP.)

The commandagi command

shell
commandagi daemon start [--port N] [--project DIR] [--name X] [--no-platform]
commandagi daemon status | stop | logs
commandagi daemon run   [same flags, in the foreground]
commandagi mcp [--credential-file F]
commandagi grant add | list | revoke …
commandagi threed install | status
commandagi code eval <path> [--input name=value]…
  • daemon start runs the host in the background and logs to ~/.commandagi/daemon.log. --no-platform hosts locally without linking to an account.
  • daemon stop refuses while the desktop app is the host — quit it from the app instead.
  • mcp is the stdio relay for agents (see SDK and MCP). grant makes and revokes standing grants (see Agents and standing grants).
  • threed installs the local 3D design service; code eval evaluates a code part headlessly and prints its operation graph as JSON.

A host linked to an account can be reached from that account's workbench anywhere, and acts as that account. Linking is signing in:

  • in the desktop app, sign in when it asks;
  • at the workbench page served by the host, sign in from the left dock — the host checks the key and keeps it;
  • from a shell, set COMMANDAGI_API_KEY to an API key before starting the daemon.

The account key is kept in host.json, an owner-only plain file, so a copied ~/.commandagi stays signed in. Signing out removes it.

Pair hosts with each other

Hosts on different computers can pair, both ways, in one act: one host offers, the other accepts. Pairing is always a person's decision. Once paired, agents can list the other hosts and call them — within whatever grants exist there.

Page drivers: USB and Bluetooth from the browser

Some drivers run in the workbench page itself, using WebSerial and Web Bluetooth. A browser opens a port only when you pick it, so an agent always uses a connection a person made and never opens one on its own. Network machines (a printer's HTTP API, a FluidNC controller on TCP) are driven by the host.

Drivers that listen for machines dialling in over the LAN need the setting "devices.lanListener": true.

Driver catalog

Every driver says what it has been verified against: none, loopback (against a faithful software fake of the protocol), bench or hardware. A driver never claims more than was done. No machine has been commissioned on hardware yet.

drivermachine and protocolruns inverified
grbl-serialGRBL 1.1, USB serialpageloopback
grbl-tcpFluidNC / grblHAL, telnet (TCP 23)hostloopback
marlin-serialMarlin, USB serialpageloopback
smoothie-serialSmoothieware, USB serialpageloopback
linuxcnc-rshLinuxCNC 2.9 linuxcncrsh (TCP 5007)hostloopback
octoprint-httpOctoPrint 1.xhostloopback
moonraker-httpKlipper via Moonrakerhostloopback
prusalink-httpPrusaLinkhostloopback
repetier-httpRepetier-Serverhostloopback
duet-httpDuet / RepRapFirmware 3.1+hostloopback
feetech-sts-serialFeetech STS/SCS servo bus (SO-100/101)pageloopback
dynamixel2-serialDynamixel Protocol 2.0 (Koch, WidowX)pageloopback
xarm-tcpUFACTORY xArm / Lite 6 (TCP 502)hostloopback
host-relayCommandAGI ESP32 arm, LAN HTTPhostloopback
wifi8k-droneWIFI_8K / E99 drone via an ESP32 linkpageloopback
ble-hid-relayBLE HID relay (ESP32)pageloopback
jpeg-pushnetwork camera pushing JPEG (ESP32-CAM)hostloopback
openpnp-filesOpenPnP job hand-off (files)hostloopback
os-inputkeyboard and pointer of this computerhostloopback
cdp-taba browser tab (Chrome DevTools Protocol)hostloopback
cdp-screencasta browser tab's videohostloopback
pty-shella shell on this computerhostloopback
python-kernela Python kernel (notebooks)hostloopback
display-capturescreen capturepagenone
uvc-cameraUSB camerapagenone
microphonemicrophonepagenone

Simulation worlds use two simulators instead: gcode-sim for G-code channels and servo-sim for servo buses.

Next

Give an agent authority over a machine: Agents and standing grants.