peer-term
v1.4.9
Published
Share your terminal instantly using a 6-digit code or QR code. Encrypted. No config.
Maintainers
Keywords
Readme
PeerTerm
Share your terminal instantly over WebRTC using a 6-digit code. Fully end-to-end encrypted. No configuration or accounts required.
Quick Start
You don't even need to install it. Just run:
npx peer-termThis will start a terminal sharing session and give you a 6-digit code.
Share this code with your peer. They can view your terminal by going to https://peerterm.dhananjaybalekar.in/ and entering the code.
Global Installation
If you prefer to install it globally:
npm install -g peer-termThen you can just run:
peer-termUsage
peer-term # starts at home directory
peer-term --path ~/projects # starts at ~/projects
peer-term --path . # starts in current directory
peer-term --readonly # view-only session
peer-term --secure # require fingerprint verification
peer-term --expiry 10m # custom expiry time
peer-term --rejoin 5m # custom reconnection window
peer-term --relay wss://custom # use a custom relay server
peer-term --verbose # enable debug loggingCLI Highlights
| Flag | Description | Default |
| :--- | :--- | :--- |
| --expiry <time> | Session expiry duration (e.g. 5m, 30s, 1h) | 5m |
| --rejoin <time> | Reconnection window if connection drops (e.g. 2m, 10m) | 2m |
| --readonly | Disable client keystrokes (view-only terminal mode) | Off |
| --secure | Enable fingerprint verification for MITM protection | Off |
| --path <dir> | Starting directory for the terminal session | ~ (Home) |
| --relay <url> | Custom relay server WebSocket URL(s) | wss://relay.dhananjaybalekar.in |
| -V, --verbose | Enable verbose debug logging | Off |
| -h, --help | Display usage information and exit | — |
| -v, --version | Output version number and exit | — |
Interactive Controls
While running, you can manage sessions directly from the host CLI:
| Command | Description |
| :--- | :--- |
| n | Create a new session |
| l | List all active sessions and permissions ([READ-ONLY] vs [INTERACTIVE]) |
| r <code> | Toggle read-only / interactive mode for an active session (alias: rt <code>) |
| a <code> | Authorize verified fingerprint (in --secure mode) |
| k <code> | Kill a specific session |
| q | Quit all sessions and exit |
Features
- No Config: Works instantly. No port forwarding or firewall configuration needed.
- End-to-End Encrypted: Terminal data is encrypted locally using AES-256-GCM with ECDH P-256 key exchange. The relay never sees plaintext. A
--secureflag enables an out-of-band fingerprint check for strict MITM protection. - WebRTC P2P: Creates a direct Peer-to-Peer connection on the same LAN for zero-latency, relay-free sessions.
- Live Permission Toggling & Read-Only: Start view-only with
--readonlyor switch between Read-Only and Interactive mode on the fly withr <code>. Guests get instant visual badges and notifications without reconnecting. - File Uploads: Clients can drag-and-drop to securely upload files directly to
~/peerterm-uploads/on the host machine. Fully encrypted end-to-end. - Custom Start Path: Set the starting directory with
--path. - Resilient Connections: Both host and client get a 2-minute rejoin window if their IP changes or connection drops. PTY state is fully preserved — no session restart needed.
- Multi-Session: Manage multiple simultaneous sessions with the interactive CLI menu.
- QR Code Support: Displays a terminal QR code for instant connection from mobile or tablet devices without manually entering the code.
- Interactive Controls: Manage sessions directly from the CLI (
nfor new session,lto list,r <code>to toggle permissions,kto kill,ato authorize fingerprint,qto quit).
How It Works
- Host registers a session on the relay and gets a 6-digit code
- Client opens the web UI and enters the code
- Both sides perform an ECDH key exchange to derive a shared AES-256-GCM secret
- If
--secureis used, both sides compare a short fingerprint, then the host authorizes the verified session witha <code> - All terminal I/O is encrypted end-to-end — the relay only forwards opaque blobs
- If both peers are on the same LAN, a WebRTC DataChannel is established to bypass the relay entirely
