Skip to content

Terminal Sync

Terminal sync makes a local terminal accessible from the web. Sync is opt-in and per-terminal — you choose exactly which terminals are available remotely.

Terminal window
kexsh terminal sync <id|name>
Terminal window
$ kexsh terminal sync dev
Terminal synced: dev (a3f) ✓
Access at app.kex.sh

The CLI opens a persistent WebSocket connection to the cloud relay. Terminal I/O is forwarded bidirectionally in real-time.

Terminal window
kexsh terminal unsync <id|name>
Terminal window
$ kexsh terminal unsync dev
Terminal unsynced: dev (a3f)

The terminal continues running locally but is no longer accessible remotely.

Synced terminals show their status in kexsh terminal ls:

Terminal window
kexsh terminal ls
ID NAME STATUS SYNC CREATED
a3f dev running synced 5 minutes ago
b7c — running local 2 minutes ago

When you sync a terminal, the kexsh server:

  1. Opens a WebSocket connection to the cloud relay (wss://api.kex.sh)
  2. Authenticates using your stored session token
  3. Registers the terminal with the relay
  4. Forwards all terminal I/O over the encrypted connection

The connection automatically reconnects if interrupted. On reconnect, the CLI sends a full status update so the relay knows which terminals are still synced.