docs/content/Tools/remote-device.mdx
import { Callout } from 'nextra/components';
The Remote Device tool lets a DocsGPT agent run shell commands on a machine you control, such as a server, a Raspberry Pi, or your own laptop. You install docsgpt-cli on that machine, run it in host mode, and pair it with your DocsGPT account. The paired device then shows up as a tool you can attach to any agent.
The machine connects outward to DocsGPT, so it works behind NAT or a firewall without opening any inbound ports.
docsgpt-cli host on the target machine. It pairs to your account and keeps a lightweight connection open: it polls while idle and streams while a command is running.run_command action, DocsGPT sends the command down to the daemon.docsgpt-cli installed on the machine you want to control. See the installation instructions: download a binary from the releases page, use Homebrew (brew tap arc53/docsgpt-cli && brew install docsgpt-cli), or build from source.Pairing uses a short one-time code (a device-code style flow).
ABCD-WXYZ and the command to run.docsgpt-cli host pair --url https://your-docsgpt-instance
--url to use the default cloud instance.)Start it in the foreground:
docsgpt-cli host
You will see a startup banner, then periodic "idle" heartbeats. Press Ctrl-C to stop.
To keep it running across reboots, install it as a service:
# Linux (systemd). As root this installs a system service; otherwise a user service.
docsgpt-cli host install-service
# macOS (launchd). The default is a per-user LaunchAgent that starts on login.
docsgpt-cli host install-service
# Always-on machine that starts at boot (Linux example):
sudo docsgpt-cli host install-service --system --user $USER
Remove the service with docsgpt-cli host uninstall-service.
The approval mode is set per device, either in the pairing form or later on the device's page under Settings -> Tools. There are two modes:
Compound commands are split on operators such as &&, ||, ;, and |, and each part is checked on its own, so a dangerous part cannot be hidden behind a safe one.
A paired device behaves like any other tool. Open or create an agent, add the device from the tool picker, and the agent can call its run_command action. The picker shows whether the device is currently online.
If you attach more than one device to an agent, give each a clear description so the agent can pick the right one.
Open the device from Settings -> Tools to:
From the CLI:
docsgpt-cli host status # live status from the server
docsgpt-cli host revoke # revoke on the server and clear local state
docsgpt-cli host reset # clear local pairing only (leaves the server-side device)
Revoking a device stops its daemon: the next time it checks in it sees the revocation, prints a message, and exits. Under a service manager it will not be restarted.