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

Architecture

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.

text
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)
Quick start

Get started in 3 steps

01

Install the agent

Install cmd-agent globally on your Mac. Node.js 18+ is required.

bash
npm install -g cmd-agent
02

Run & authenticate

On first run you'll be prompted for a device name, then your browser opens to approve it.

bash
cmd-agent
A browser window opens → log in → click Approve Device → the agent starts automatically.
03

Open a terminal

Sign in at cmd.cvasingh.com, click New Terminal, pick your device, and start typing.

CLI reference

Commands

CommandAliasDescription
cmd-agentStart the agent (runs setup on first launch)
cmd-agent --login-lRe-run browser login (keeps device name)
cmd-agent --logoutClear saved credentials — re-login required
cmd-agent --reconfigure-rFull reset: re-enter device name + re-login
cmd-agent --statusShow device name, ID, and config path
cmd-agent --version-vShow installed version
cmd-agent --help-hShow help
Background process

Run in the background with pm2

Keep the agent running persistently and auto-start it on login using pm2.

bash
1npm install -g pm2
2cmd-agent # complete login first, then Ctrl-C
3pm2 start $(which cmd-agent) --name cmd-agent
4pm2 save
5pm2 startup # auto-start on login
Configuration

Config file

All config is stored automatically at ~/.cmd-agent (readable only by you, chmod 600). No .env file is needed.

json
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