relay-ttydocs
Reference

CLI Commands

All commands follow the pattern relay [options] <command>. URLs are printed to stdout, status messages to stderr (POSIX convention).

Session commands

relay <command>

Create a session and attach locally.

relay bash                    # interactive shell
relay htop                    # run any command
relay -- python3 -m http.server  # use -- for commands with flags
FlagDescription
--detach, -dCreate session without attaching. Prints session URL to stdout

relay attach <id>

Reattach to an existing session in raw TTY mode.

  • Press Ctrl+] to detach
  • Session continues running after detach

relay list

List all active sessions with their IDs, commands, and status.

relay info

Show information about the current relay session. Must be run from inside a relay session (where RELAY_SESSION_ID is set).

relay info          # pretty-printed session details
relay info --json   # machine-readable JSON output

Displays: session ID, command, CWD, status, PID, terminal size, title, throughput, timestamps, and the pty-host binary path with its build date.

If run outside a relay session, prints "Not a relay session" to stderr.

FlagDescription
--jsonOutput session metadata as JSON (includes binary path and mtime)

relay stop <id>

Kill a session and its underlying process.

relay share <id>

Generate a read-only share link.

FlagDescription
--ttl <seconds>Link expiration (default: 3600, max: 86400)
--password <pw>Require password to view

Output: share URL to stdout, metadata to stderr.

relay tui

Interactive session picker with a split-pane terminal UI. Shows running sessions in a navigable list with a live terminal preview. Exited sessions are hidden from the list.

KeyAction
/ or j/kNavigate sessions
EnterAttach to selected session
xStop selected session (confirms first)
rRefresh session list
g / GJump to top / bottom
q or EscQuit

Mouse support: click to select, scroll wheel to navigate, click selected session to attach.

Server commands

relay server start

Start the web server in the foreground.

FlagDescription
--tunnelEnable public access via relaytty.com
--port <port>Override server port (default: 7680)

relay server install

Install as a system service (launchd on macOS, systemd on Linux).

relay server uninstall

Remove and stop the system service.

On this page