nex - terminal recorder & sharing
This project contains a Rust CLI nex that records terminal sessions into .nex files.
Commands:
nex start— start recording the current shell sessionnex stop— stop recording and finalize the.nexfilenex inspect <file.nex>— view metadatanex play <file.nex>— replay recorded session (TBD)nex csv <file.nex> --out <file.csv>— export to CSVnex json <file.nex> --out <file.json>— export to JSONnex serve <port> [--verbose]— host a collaborative sessionnex catch <host> <port> --out <file.nex>— join a collaborative session and savenex serve <port> --web— host a collaborative session with web UI (TBD)
This scaffold implements a minimal MVP for start/stop using a PTY-based approach in Rust.
Build:
cargo build --release
Installing:
cargo install --path .
nex records interactive terminal sessions into a portable .nex archive. It can:
- Record a local interactive shell to a
.nexfile (nex start/exit, nex stop). - Replay a
.nex(nex play <file>). - Export recorded sessions to CSV or JSON (
nex csv <file>,nex json <file>). - Serve a shared shell over TCP for collaborative sessions (
nex serve <port>). - Join a shared session as a client and auto-save the session (
nex catch <host> <port>).
This project is a small Rust prototype. It uses a PTY-backed shell and records raw terminal bytes plus command lifecycle markers (injected via zsh hooks) into a newline-delimited JSON stream inside the .nex archive.
Quickstart
Installing:
cargo install --path .
Record locally (default timestamped filename):
nex start
Replay:
nex play recording.nex
CSV / JSON export:
nex csv recording.nex --out out.csv nex json recording.nex --out out.json
Collaborative session (host):
nex serve 3000 # silent by default nex serve 3000 --verbose # show connect/exits
Collaborative session (client):
nex catch <host-ip> 3000 --out mysession.nex
nex serve 3000 # silent by default nex serve 3000 --verbose # show connect/exits
Collaborative session (client):
nex catch <host-ip> 3000 --out mysession.nex
Collaborative session (web UI):
nex serve 3000 --web
Recording format
A .nex file is a ZIP archive containing:
manifest.json— metadata and durationsession.json— newline-delimited JSON events (raw terminal bytes and command start/end objects)
Raw event example:
{"t": 0.123, "data": "<base64>"}
Command event example:
{"type":"command","phase":"start","t": 1234567890.123,"cwd":"/home/user","cmd_b64":"..."}