nevr-agent is a single CLI binary (agent) for recording, converting, and replaying EchoVR game session and player bone data.
- Agent: Record session and player bone data from EchoVR game servers via HTTP API polling
- Advanced frame filtering (FPS control, game mode filtering, active-only mode)
- Bone data exclusion to reduce payload size
- Idle/active FPS switching for bandwidth optimization
- API Server: HTTP server for storing and retrieving session event data with MongoDB backend
- Capture storage management with retention policies and size limits
- Real-time WebSocket streaming API with seek/rewind support
- Prometheus metrics endpoint
- Player lookup integration with caching
- Converter: Convert between .echoreplay (zip) and .nevrcap (zstd compressed) file formats
- Progress bar support for large file conversions
- Replayer: HTTP server for replaying recorded session data
- Go 1.25 or later (for building from source)
- MongoDB (for API server functionality)
Download the latest release for your platform from the Releases page.
# Clone the repository
git clone https://github.com/EchoTools/nevr-agent.git
cd nevr-agent
# Build the consolidated binary
make build
# Or build for specific platforms
make linux # Build for Linux
make windows # Build for WindowsThe agent application provides a unified CLI with subcommands for different functionality.
# View available commands
agent --help
# Get help for a specific command
agent stream --helpRecord session and player bone data from EchoVR game servers:
# Basic recording from localhost ports 6721-6730 at 30Hz
agent stream --frequency 30 --output ./output 127.0.0.1:6721-6730
# Record with streaming to Nakama server
agent stream --stream --stream-username myuser --stream-password mypass 127.0.0.1:6721
# Record with Events API enabled
agent stream --events --events-url http://localhost:8081 127.0.0.1:6721-6730
# Stream all frames at 30 FPS, excluding bone data for smaller payloads
agent stream --all-frames --fps 30 --exclude-bones 127.0.0.1:6721
# Only stream Echo Arena matches during active gameplay
agent stream --include-modes echo_arena --active-only 127.0.0.1:6721
# Reduce bandwidth with idle FPS (1 FPS in lobby, 30 FPS during gameplay)
agent stream --fps 30 --idle-fps 1 --active-only 127.0.0.1:6721-6730| Flag | Description |
|---|---|
--all-frames |
Send all frames, not just frames with events |
--fps <n> |
Target frames per second (0 = use polling frequency) |
--idle-fps <n> |
Frame rate for non-gametime frames (default: 1) |
--include-modes |
Only stream these game modes (comma-separated) |
--exclude-modes |
Exclude these game modes from streaming |
--exclude-bones |
Exclude player bone data to reduce payload size |
--active-only |
Only stream frames during active gameplay |
--exclude-paused |
Exclude paused frames (with --active-only) |
Run an HTTP server for storing and retrieving session events:
# Start with default settings
agent serve
# Custom MongoDB URI and port
agent serve --mongo-uri mongodb://localhost:27017 --server-address :8081
# Enable capture storage with retention (7 days, max 10GB)
agent serve --capture-dir ./captures --capture-retention 168h --capture-max-size 10737418240
# Enable Prometheus metrics on port 9090
agent serve --metrics-addr :9090
# Full production setup
agent serve \
--mongo-uri mongodb://localhost:27017 \
--capture-dir ./captures \
--capture-retention 168h \
--metrics-addr :9090 \
--jwt-secret "your-secret-key"- Capture Storage: Automatically stores match recordings with configurable retention and size limits
- Match Retrieval: Download completed matches via REST API with format conversion
- Real-time Streaming: WebSocket API for live match data with seek/rewind support
- Prometheus Metrics:
/metricsendpoint for monitoring frames, matches, connections, and storage - Player Lookup: Integration with echovrce API for player information with LRU caching
See docs/WEBSOCKET_STREAM.md for WebSocket API details.
Convert between replay file formats:
# Auto-detect conversion (echoreplay → nevrcap or vice versa)
agent convert --input game.echoreplay
# Specify output file
agent convert --input game.nevrcap --output converted.echoreplay
# Force specific format
agent convert --input game.echoreplay --format nevrcap
# Show progress bar for large files
agent convert --input large_game.echoreplay --progressReplay recorded sessions via HTTP server:
# Replay a single file
agent replay game.echoreplay
# Replay multiple files in sequence
agent replay game1.echoreplay game2.echoreplay
# Loop playback continuously
agent replay --loop game.echoreplay
# Custom bind address
agent replay --bind 0.0.0.0:8080 game.echoreplayThe application supports multiple configuration methods (in order of precedence):
- Command-line flags (highest priority)
- Environment variables (prefix with
EVR_) - Configuration file (YAML format)
- Default values (lowest priority)
Create a agent.yaml file in your working directory or specify with --config:
# Global configuration
debug: false
log_level: info
# Agent configuration
agent:
frequency: 10
output_directory: ./output
stream_enabled: false
# API Server configuration
apiserver:
server_address: ":8081"
mongo_uri: mongodb://localhost:27017See agent.yaml.example for a complete example.
All configuration can be set via environment variables with the EVR_ prefix:
# Agent configuration
export EVR_AGENT_FREQUENCY=30
export EVR_AGENT_OUTPUT_DIRECTORY=./recordings
# Stream credentials
export EVR_AGENT_STREAM_USERNAME=myuser
export EVR_AGENT_STREAM_PASSWORD=mypassword
# Run the agent
agent stream 127.0.0.1:6721-6730You can also use a .env file. See .env.example for all available variables.
Credentials (API keys, passwords, database URIs) can be managed securely:
- Environment variables: Set sensitive values as environment variables
- .env file: Store credentials in a
.envfile (never commit this file!) - Config file: Use for non-sensitive configuration (can be committed)
# Build for current OS
make build
# Build all legacy individual commands
make legacy
# Run tests
make test
# Run benchmarks
make bench
# Clean build artifacts
make clean# Run all tests
go test ./...
# Run tests with coverage
go test -cover ./...See LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.