What is nex?
Nex is a comprehensive terminal recording and session management solution designed for developers, DevOps engineers, and system administrators who need to capture, share, and analyze their command-line workflows. Whether you're documenting a complex deployment procedure, debugging a production issue with your team in real-time, or creating educational content about command-line tools and shell scripting, nex provides the infrastructure to record every detail of your terminal session with complete fidelity using pseudo-terminal (PTY) technology.
Built from the ground up in Rust for performance and reliability, nex leverages pseudo-terminal (PTY) technology to capture authentic interactive shell behavior with zero data loss. This means everything that appears on your screen—commands, outputs, errors, interactive programs like vim or top, ANSI color codes, and precise timing information—is recorded exactly as it happens. The result is a portable .nex archive file that can be replayed frame-by-frame, analyzed for performance metrics, or shared with team members who need to see exactly what you did and what happened during the session.
Unlike simple script recorders, log files, or basic stdout redirection, nex understands the complete structure of your shell sessions. Through intelligent integration with shell hooks for bash, zsh, and fish, nex captures not just raw terminal bytes but also structured metadata about command execution lifecycle, including what commands were run, when they started and finished, what directory they executed in, and their exit codes. This dual-layer approach gives you both the raw terminal experience for authentic replay and structured data for advanced analysis, performance monitoring, and export to business intelligence tools.
Core Capabilities and Features
Terminal Session Recording and High-Fidelity Replay
The fundamental feature of nex is its ability to record complete terminal sessions into portable,
self-contained .nex archive files. When you start a recording session with the
nex start command, nex spawns your preferred shell (bash, zsh, fish, or any configured
shell) within a pseudo-terminal environment and captures every
single byte of input and output with millisecond-precision timestamps. This includes not just the visible text you see on
screen, but also terminal control sequences (CSI
codes), ANSI color codes and formatting, cursor movements
and positioning, and timing information that preserves the exact rhythm and pacing of the original
interactive session.
The replay functionality powered by the nex play command lets you watch recorded
sessions exactly as they happened in real-time. Commands appear at the same pace they were
originally executed, outputs stream in with authentic timing that preserves the feeling of the
original session, and interactive programs behave just as they did during recording. This makes
recorded sessions invaluable for creating technical tutorials and screencasts, reviewing debugging
processes and troubleshooting steps, demonstrating complex workflows to team members who weren't
present for the original session, and creating audit trails for compliance and security purposes.
The recording system is architected to be lightweight and completely unobtrusive to your workflow. There's minimal performance overhead (typically less than 1% CPU usage), so you can leave recording running during intensive tasks, long-running builds, or production deployments without worrying about impact on execution speed, memory consumption, or system resources. Recording sessions can run for hours or even days, capturing extensive workflows, multi-step deployments, or debugging marathons without any degradation in recording quality, data loss, or system performance impact.
Real-Time Collaborative Terminal Sessions and Screen Sharing
nex extends far beyond local recording with powerful collaborative features that enable real-time
terminal sharing across local networks and the internet. The nex serve command
transforms your terminal into a shared workspace that multiple users can connect to simultaneously
over TCP/IP. This is invaluable for pair programming sessions where you want a colleague to observe
your coding workflow, remote debugging scenarios where you need to demonstrate a problem to your
distributed team, training and onboarding situations where multiple people need to follow along with
a live demonstration, or code review sessions at the command line.
Remote clients connect using the nex catch command, which not only displays the shared
terminal in real-time with low latency but automatically
records the entire collaborative session locally to a .nex file. This means all participants get
both the live interactive experience and a permanent local record they can review later at their own
pace, share with other team members who couldn't attend, or use as reference material for
documentation and runbooks. The collaborative architecture is optimized for low
latency and maintains responsive feel despite operating over network connections, even on slower
connections or high-latency links.
For broader access scenarios like company-wide demonstrations, client presentations, or training
webinars, nex offers a web-based interface option activated with the
--web flag. This makes terminal sessions accessible through any modern web browser
without requiring participants to install nex, configure SSH, or have command-line expertise. It's perfect for sharing
terminal sessions with stakeholders, clients who need to see deployment processes, or large
audiences during conference presentations and live demonstrations.
Data Export, Analysis, and Integration Capabilities
Terminal sessions contain valuable operational data that often needs to be processed, analyzed
statistically, or integrated into other monitoring and logging systems. nex provides robust export
capabilities through the nex csv and nex json commands that transform
recorded terminal sessions into industry-standard data formats. CSV export produces tabular data with timestamps and event types
that's immediately suitable for spreadsheet analysis in Excel or Google Sheets, statistical
processing in R or Python pandas, time-series analysis, or import into data visualization tools like
Tableau or Grafana.
JSON export provides a structured, machine-readable format with full session metadata that can be consumed by custom scripts and automation tools, integrated into CI/CD pipelines for build monitoring, fed into centralized logging systems like Elasticsearch or Splunk, or processed by monitoring and alerting systems like Prometheus. The export functionality preserves all the rich contextual detail of your sessions, including nanosecond-precision timestamps, event types and classifications, command metadata including working directory and environment, output data with full fidelity, and command execution durations for performance analysis.
This enables sophisticated analysis workflows and automation use cases like measuring command execution times to identify performance bottlenecks in deployment scripts, tracking which commands are used most frequently in production environments to optimize tooling, generating detailed audit trails for compliance requirements (SOC 2, HIPAA, PCI-DSS), analyzing error patterns across multiple debugging sessions to identify systemic issues, and creating dashboards that visualize terminal activity patterns across your organization. Because the underlying .nex format is based on open standards (ZIP archive and JSON), you're never locked into proprietary formats or vendor-specific tools.
Installation Guide - How to Install nex Terminal Recorder
Getting nex running on your Linux, macOS, or Windows system requires the Rust programming language toolchain, which provides the Cargo package manager and build tools necessary for compiling Rust applications. If you don't already have Rust installed on your machine, visit rustup.rs and follow the simple one-command installation process that works across all major operating systems. The Rust installation typically completes in just a few minutes and includes rustc (the compiler), cargo (package manager), and all necessary development tools.
Once you have Rust and Cargo available in your PATH, you can build nex from source code hosted on GitHub. Clone the nex repository using git and navigate to the project directory. The Cargo build process is straightforward, handles all Rust dependencies automatically through Cargo.toml, and produces an optimized production-ready binary.
git clone https://github.com/aryansrao/nex && cd nex
cargo build --release
For system-wide installation that makes the nex command available from any directory in your
terminal, use Cargo's install command. This compiles the project with maximum optimizations enabled
(--release mode) and places the resulting binary in your Cargo bin directory, which is typically
located at ~/.cargo/bin on Unix-like systems and should
already be in your PATH environment variable after standard Rust
installation.
cargo install --path .
After installation completes, verify everything is working correctly by running nex with the help
flag to display usage information. You should see the complete list of available commands, options,
and usage examples. If the command isn't found, ensure your Cargo bin directory is properly
configured in your PATH environment variable. You can add it permanently by including the
appropriate export statement in your shell configuration file like .bashrc for bash, .zshrc for zsh, or config.fish for fish shell.
nex --help
Complete nex Command Reference and CLI Usage
nex stop. By default, recordings are automatically saved with ISO 8601 timestamps in the filename for easy organization,
but you can specify custom filenames for specific use cases like project names or ticket
numbers.
--verbose flag enables detailed logging of connection events, client IP addresses, and session activity for monitoring and
debugging. This command is perfect for pair programming sessions with remote colleagues,
collaborative debugging sessions across distributed teams, live demonstrations and training
sessions, and code review sessions at the command line
level.
Technical Architecture - How nex Works Under the Hood
The technical foundation of nex is built on pseudo-terminal (PTY) technology, which is the same low-level Unix mechanism used by terminal emulators like GNOME Terminal, iTerm2, and Windows Terminal to run shells and interactive programs. When you start a recording session, nex creates a PTY pair consisting of a master pseudo-terminal device and a slave pseudo-terminal device. Your shell process (bash, zsh, fish, etc.) runs attached to the slave side, believing it's running in a real terminal, while nex controls the master side, giving it complete bidirectional visibility into all data flowing between your shell and the terminal emulator.
This PTY-based capture approach records terminal sessions with complete fidelity and zero information
loss. Unlike simple output redirection with
> or tee, or basic script recording with
the script command, PTY capture sees everything exactly
as it appears on your screen in real-time, including interactive program behavior like vim, emacs, top, htop, less, and ncurses applications, terminal
control sequences and ANSI escape codes for colors and cursor movement,
raw binary data and non-printable characters, timing information with millisecond precision for
authentic replay, and even terminal resizing events. The captured data is written to an efficient newline-delimited JSON stream format, with each
line representing a single atomic event—either raw terminal output with precise timestamp or a
structured command lifecycle event with rich metadata.
Command lifecycle tracking and metadata collection is achieved through intelligent shell hooks that nex installs in your shell configuration files (.bashrc, .zshrc, config.fish). These hooks emit structured JSON events when commands start executing (preexec hook) and when they complete (precmd hook), providing valuable metadata like the full command text and arguments, current working directory path, command start timestamp and end timestamp, process exit code for success/failure tracking, and shell session ID for correlation. This dual-capture approach gives you both the raw PTY terminal experience for authentic visual replay and structured command metadata for advanced analysis, searching, filtering, and export to analytics platforms.
The .nex file format itself is deliberately simple, open, and based on industry standards to ensure
long-term accessibility. It's a standard ZIP archive (compatible with any
zip tool) containing exactly two JSON files with well-defined schemas: manifest.json containing session-level
metadata like creation time, duration, shell type, and environment; and session.json
containing the complete event stream in newline-delimited JSON format. This design ensures
portability across platforms, easy inspectability with standard command-line tools like
unzip and jq, and long-term
accessibility regardless of future changes to nex itself. You can examine, extract, and process .nex
files with standard tools, integrate them into custom workflows, or archive them with confidence
they'll remain readable for years to come.
Real-World Use Cases and Applications for nex
nex solves critical problems that developers, DevOps engineers, site reliability engineers, and operations teams face daily in modern software development. When you're working through a complex debugging session troubleshooting a production outage, recording the entire diagnostic process creates a perfect artifact for post-mortem analysis and learning. You can review exactly what commands you tried, what diagnostic outputs you observed, which log files you examined, and which approach finally identified and solved the problem. This transforms time-sensitive debugging sessions into valuable learning opportunities and creates permanent documentation that helps prevent similar issues in the future, reduces mean time to resolution (MTTR), and builds institutional knowledge.
Technical documentation and training materials benefit enormously from authentic terminal recordings that capture real workflows. Instead of writing lengthy step-by-step instructions that quickly become outdated with software updates, you can record the actual process once and let people watch it happen with perfect accuracy. Tutorial creators and technical educators can demonstrate complex workflows like Kubernetes deployments, database migrations, or CI/CD pipeline configurations with complete fidelity. Training materials become living documents that show exactly how tasks are performed in real production environments rather than describing them in text that might be misinterpreted or become outdated. New team members can onboard faster by watching recorded sessions of senior engineers performing common tasks.
Incident response and troubleshooting scenarios in production environments demand accurate, timestamped records of all actions taken and results observed for compliance and audit purposes. Recording your incident response with nex creates an immutable audit trail that helps with post-incident analysis, root cause investigation, and compliance requirements for standards like SOC 2, ISO 27001, HIPAA, and PCI-DSS. When working on production systems during critical outages, having an exact timestamped record of what commands you executed, what outputs you observed, and what changes you made provides both accountability for security audits and a reliable reference for creating runbooks, standard operating procedures (SOPs), and automation scripts that codify best practices.
Collaborative work and remote team coordination becomes dramatically more effective when you can share your terminal in real-time across geographic boundaries. Code reviews can happen at the command line level with both parties seeing the same terminal output and discussing implementation details. Junior developers can watch senior team members work through complex tasks in real-time, learning not just what commands to run but how to think about problems, debug issues, and make architectural decisions. Remote teams spread across multiple time zones can collaborate as effectively as if they were sitting at the same desk. Customer support teams can record troubleshooting sessions with clients and share them with engineering teams for deeper investigation without requiring the engineer to directly access customer systems.
Getting Started with nex - Quick Start Tutorial
The simplest way to start using nex for local terminal recording is to run the nex start
command to begin a new recording session. Work in your terminal as you normally would—run commands,
edit files, check logs, deploy applications—and then simply exit the shell when you're done with
your task. The session is automatically saved with an ISO timestamp filename like
recording-2025-10-28T14-30-00.nex. You can then replay it instantly with
nex play to review what you did, or export it to CSV or JSON for detailed analysis of
command execution times and patterns.
# Start recording a terminal session
nex start
# Work normally in your terminal
cd /var/www/myapp
git pull origin main
npm install
npm run build
sudo systemctl restart nginx
# Exit the shell to save the recording
exit
# Replay the recorded session
nex play recording-2025-10-28T14-30-00.nex
# Export session data for analysis
nex csv recording-2025-10-28T14-30-00.nex --out deployment.csv
For collaborative scenarios and real-time terminal sharing, one person starts a nex server on a
network port using nex serve while remote
team members connect using nex catch from their machines anywhere on the network or
internet. The host sees connection notifications in verbose mode showing when clients join and
disconnect, and clients get both a real-time live view of the shared terminal and an automatic local
recording of the complete session. This makes collaborative debugging sessions, pair programming, and remote training highly productive while
ensuring nothing is lost when the live session ends.
# Host machine - start collaborative session
nex serve 3000 --verbose
# Client machine - connect to shared session
nex catch 192.168.1.100 3000 --out shared-session.nex
# Or connect from anywhere on the internet
nex catch example.com 3000 --out remote-session.nex
Export capabilities enable you to integrate terminal session data into your broader DevOps workflows and analytics pipelines. Extract sessions to CSV format for performance analysis in spreadsheet applications, identifying slow commands that could benefit from optimization. Export to JSON for feeding into centralized logging systems like Elasticsearch, monitoring dashboards built with Grafana, or custom analysis scripts written in Python that track command usage patterns across your team. The structured export preserves all the detailed metadata and timing information of your sessions in formats that standard data processing tools can consume.
# Export to CSV for spreadsheet analysis
nex csv session.nex --out analysis.csv
# Export to JSON for automated processing
nex json session.nex --out data.json
# Process JSON with jq for custom analysis
cat data.json | jq '.events[] | select(.type=="command")'
Why Choose nex? Key Benefits and Advantages
Open Source and Free: nex is completely open source software released under a permissive license, meaning you can use it freely in personal projects, commercial environments, and enterprise deployments without licensing costs or vendor lock-in. The source code is publicly available on GitHub for transparency, security auditing, and community contributions.
High Performance Rust Implementation: Built entirely in Rust, nex offers memory safety without garbage collection overhead, minimal CPU and memory footprint during recording, fast startup times and efficient resource usage, and cross-platform compatibility across Linux, macOS, and Windows operating systems.
Complete Fidelity PTY Recording: Unlike basic logging tools, nex captures everything through pseudo-terminal technology including interactive programs, ANSI colors and formatting, precise timing information, and terminal resize events for authentic reproduction.
Structured Metadata Extraction: Shell integration provides rich command metadata beyond raw bytes including command text and arguments, execution timestamps and duration, working directory context, and exit codes for success/failure tracking.
Real-Time Collaboration Features: Share your terminal live with team members across networks, support multiple simultaneous viewers, provide automatic recording for all participants, and offer web interface for browser-based access without installation.
Flexible Export Formats: Export session data to CSV for spreadsheet analysis and visualization, JSON for programmatic access and system integration, and open ZIP-based format that never locks you into proprietary tools.
Production-Ready Reliability: Minimal performance overhead allows continuous recording, handles long-running sessions without degradation, provides graceful error handling and recovery, and maintains data integrity even during system issues.