Remote Terminal Control
Access and control terminal sessions on your MacBook from anywhere — securely, in real time.
Real-time terminal
Full xterm.js emulator with instant keystroke response
Secure by default
Clerk authentication + per-device token authorization
Low latency
Ably pub/sub delivers sub-100ms I/O round trips
Access anywhere
Control your MacBook from any browser, worldwide
How it works
The browser and your Mac both connect to Ably pub/sub channels. No port-forwarding or VPN required — keystrokes flow browser → Ably → agent → PTY, output comes back the same way.
1Browser (xterm.js)2 ↕ Ably channel: terminal:{sessionId}3cmd-agent (node-pty on your Mac)4 ↕ Ably channel: control:{deviceId}5Next.js backend (cmd.cvasingh.com)
Get started in 3 steps
Install the agent
Install cmd-agent globally on your Mac. Node.js 18+ is required.
npm install -g cmd-agent
Run & authenticate
On first run you'll be prompted for a device name, then your browser opens to approve it.
cmd-agent
Open a terminal
Sign in at cmd.cvasingh.com, click New Terminal, pick your device, and start typing.
Commands
cmd-agent—Start the agent (runs setup on first launch)cmd-agent --login-lRe-run browser login (keeps device name)cmd-agent --logout—Clear saved credentials — re-login requiredcmd-agent --reconfigure-rFull reset: re-enter device name + re-logincmd-agent --status—Show device name, ID, and config pathcmd-agent --version-vShow installed versioncmd-agent --help-hShow helpRun in the background with pm2
Keep the agent running persistently and auto-start it on login using pm2.
1npm install -g pm22cmd-agent # complete login first, then Ctrl-C3pm2 start $(which cmd-agent) --name cmd-agent4pm2 save5pm2 startup # auto-start on login
Config file
All config is stored automatically at ~/.cmd-agent (readable only by you, chmod 600). No .env file is needed.
1{2 "deviceName": "My MacBook",3 "deviceCode": "…",4 "deviceId": "…"5}
Delete the file or run cmd-agent --logout to start fresh.
Ready to connect?
Create an account and connect your first device in under a minute.
Built by Shiva Singh · MIT License