Skip to content

CLI Tools Overview

Nerve Framework Command Line Interface

The Nerve Framework provides a comprehensive set of command-line tools for monitoring, debugging, and managing your applications.

Available Commands

System Monitoring

  • nerve-cli status - Overall system status
  • nerve-cli memory - Memory usage and buffer statistics
  • nerve-cli threads - Thread lifecycle and performance
  • nerve-cli nodes - Node registry and communication status
  • nerve-cli comms - Communication patterns and metrics

Performance Analysis

  • nerve-cli perf - Performance metrics and benchmarks
  • nerve-cli config - Configuration management
  • nerve-cli debug - Debugging and diagnostic tools

Quick Start

# Check system status
nerve-cli status

# Monitor memory usage
nerve-cli memory

# View thread information
nerve-cli threads

# Check node registry
nerve-cli nodes

Command Examples

System Status

nerve-cli status --detailed

Output:

🚀 Nerve Framework Status
├── System: Running
├── Uptime: 2h 15m
├── Memory Usage: 45.2MB
├── Active Threads: 8
├── Registered Nodes: 12
└── Message Throughput: 1,245 msg/sec

Memory Monitoring

nerve-cli memory --buffer-stats

Output:

🧠 Memory Statistics
├── Total Usage: 45.2MB
├── Buffer Usage: 12.8MB
├── BestEffort: 1,245 messages
├── Reliable: 892 messages
├── Guaranteed: 567 messages
└── RealTime: 1,023 messages

Advanced Usage

Performance Monitoring

# Real-time performance monitoring
nerve-cli perf --live --interval 1s

# Generate performance report
nerve-cli perf --report --output performance.json

Debugging Tools

# Enable debug mode
nerve-cli debug --verbose

# Trace message flow
nerve-cli debug --trace --topic "sensor.*"

# Memory leak detection
nerve-cli debug --memory-leak-check

Configuration

The CLI tools can be configured through:

  1. Command-line arguments - Direct parameter specification
  2. Environment variables - System-wide configuration
  3. Configuration files - Persistent settings
  4. Runtime options - Dynamic configuration changes

Integration

With Applications

use nerve::cli::Monitor;

// Start CLI monitoring
let monitor = Monitor::new();
monitor.start().await?;

External Monitoring

# Export metrics for Prometheus
nerve-cli perf --export-prometheus

# Generate Grafana dashboard
nerve-cli config --generate-dashboard

Next Steps


This is a placeholder file. Full content coming soon.