rzen

Crates.iorzen
lib.rsrzen
version0.1.0
created_at2025-08-29 12:40:43.134706+00
updated_at2025-08-29 12:40:43.134706+00
descriptionA TUI-based CLI tool for building, deploying, and monitoring Rust projects
homepagehttps://github.com/kurosci/rzen
repositoryhttps://github.com/kurosci/rzen
max_upload_size
id1815790
size181,814
ΠΊuro (kurosci)

documentation

README

rzen

A comprehensive TUI-based CLI tool for building, deploying, and monitoring Rust applications. Designed specifically for developers who want to easily manage the complete lifecycle of their Rust projects, from development to production deployment.

Features

  • πŸ—οΈ Build: Compile your Rust projects with Cargo integration
  • πŸš€ Deploy: Deploy to VPS via SSH with systemd service management
  • πŸ‘€ Monitor: Real-time health monitoring and log tailing
  • πŸ–₯️ TUI Interface: Beautiful terminal user interface with Ratatui
  • βš™οΈ Configuration: Simple TOML-based configuration
  • πŸ”§ CLI Mode: Command-line interface for automation
  • πŸ“Š Progress Tracking: Visual progress bars for long operations
  • πŸ”’ Security: SSH key-based authentication with fallback to passwords
  • ♻️ Reliability: Robust error handling and retry mechanisms

Quick Start

1. Installation

# Clone the repository
git clone https://github.com/yourusername/rzen.git
cd rzen

# Build the project
cargo build --release

# Install (optional)
cargo install --path .

2. Initialize Configuration

# Create a default configuration file
rzen init

# Or specify custom values
rzen init --name my-api --host my-server.com

3. Configure Your Project

Edit rzen.toml with your project settings:

[project]
name = "my-api"
path = "."
build_mode = "release"

[deploy]
vps_host = "your-server.com"
vps_user = "deploy"
vps_key_path = "~/.ssh/id_rsa"
deploy_path = "/opt/my-api"

[monitor]
health_endpoint = "http://your-server.com:8080/health"
log_path = "/var/log/my-api.log"

4. Use rzen

# Start TUI interface (default)
rzen

# Build your project
rzen build

# Deploy to production
rzen deploy

# Monitor your application
rzen monitor

# Validate configuration
rzen validate

Usage

TUI Mode

Run rzen without arguments to launch the interactive TUI:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ rzen - Rust Project Manager                                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Build β”‚ Deploy β”‚ Monitor β”‚ Config β”‚ Exit                       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Build Status                                                   β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚ β”‚ Build Progress                                          β”‚    β”‚
β”‚ β”‚ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100%                 β”‚    β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚                                                                β”‚
β”‚ Build Logs                                                    β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚ β”‚ Compiling my-api v0.1.0 (/path/to/project)             β”‚    β”‚
β”‚ β”‚ Finished release [optimized] target(s) in 12.34s       β”‚    β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚                                                                β”‚
β”‚ Build Info                                                    β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚ β”‚ Binary: my-api | Size: 8.5 MB | Mode: release          β”‚    β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Navigation:

  • h / ← : Previous tab
  • l / β†’ : Next tab
  • b : Start build
  • d : Start deploy
  • m : Start monitoring
  • q / Esc : Quit

CLI Commands

Build

rzen build                    # Build in default mode
rzen build --mode debug       # Build in debug mode
rzen build --dry-run          # Simulate build

Deploy

rzen deploy                   # Build and deploy
rzen deploy --skip-build      # Deploy existing binary
rzen deploy --force           # Force redeployment
rzen deploy --dry-run         # Simulate deployment

Monitor

rzen monitor                  # One-time status check
rzen monitor --continuous     # Continuous monitoring
rzen monitor --lines 50       # Show last 50 log lines

Configuration

rzen init                     # Create default config
rzen init my-config.toml      # Create config with custom name
rzen validate                 # Validate current config
rzen validate custom.toml     # Validate specific config

Global Options

rzen --config custom.toml     # Use custom config file
rzen --log-level 4            # Set log level (0-5)
rzen --dry-run                # Simulate operations
rzen --help                   # Show help
rzen --version                # Show version

Configuration

The rzen.toml configuration file supports the following sections:

[project]

  • path: Path to your Rust project
  • name: Project name (used for binary and service names)
  • build_mode: "debug" or "release"

[deploy]

  • target: Deployment target ("vps" for now)
  • vps_host: Server hostname or IP
  • vps_user: SSH username
  • vps_key_path: Path to SSH private key
  • vps_password: SSH password (alternative to key)
  • deploy_path: Remote installation directory
  • service_name: Systemd service name
  • ssh_port: SSH port (default: 22)

[monitor]

  • health_endpoint: HTTP endpoint for health checks
  • log_path: Remote log file path
  • interval_secs: Monitoring poll interval
  • health_timeout_secs: Health check timeout

Architecture

src/
β”œβ”€β”€ main.rs           # Application entry point and CLI routing
β”œβ”€β”€ cli.rs            # Command-line argument parsing
β”œβ”€β”€ config.rs         # TOML configuration handling
β”œβ”€β”€ logging.rs        # Structured logging system
β”œβ”€β”€ tui.rs           # Terminal user interface
β”œβ”€β”€ commands/         # Command implementations
β”‚   β”œβ”€β”€ build.rs     # Build functionality
β”‚   β”œβ”€β”€ deploy.rs    # Deployment functionality
β”‚   └── monitor.rs   # Monitoring functionality
└── utils/           # Shared utilities (SSH, progress, etc.)

Requirements

  • Rust: 1.70+ (2021 edition)
  • Cargo: Latest stable
  • SSH: For deployment (key-based auth recommended)
  • Systemd: For service management on target server

Target Server Requirements

  • Linux with systemd
  • SSH access
  • sudo privileges for service management
  • Rust/Cargo (optional, binaries can be cross-compiled)

Development

Building

# Debug build
cargo build

# Release build
cargo build --release

# Run tests
cargo test

# Run with logging
RUST_LOG=debug cargo run

Testing

# Unit tests
cargo test

# Integration tests
cargo test --test integration

# With coverage
cargo tarpaulin

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Run cargo fmt and cargo clippy
  6. Submit a pull request

Troubleshooting

Common Issues

SSH Connection Failed

  • Verify SSH key permissions: chmod 600 ~/.ssh/id_rsa
  • Check SSH agent: ssh-add ~/.ssh/id_rsa
  • Test connection: ssh user@host

Build Failed

  • Ensure Cargo.toml exists in project directory
  • Check Rust version: rustc --version
  • Clean and rebuild: cargo clean && cargo build

Service Won't Start

  • Check service status: sudo systemctl status your-service
  • View logs: sudo journalctl -u your-service
  • Verify binary permissions: ls -la /opt/your-app/

Configuration Errors

  • Validate config: rzen validate
  • Check TOML syntax
  • Ensure all required fields are present

Debug Mode

Enable verbose logging:

rzen --log-level 5 build

Or set environment variable:

RUST_LOG=trace rzen build

License

This project is licensed under the MIT License - see the LICENSE file for details.

Roadmap

MVP (Current)

  • βœ… TUI interface
  • βœ… Build system integration
  • βœ… SSH-based VPS deployment
  • βœ… Systemd service management
  • βœ… Health monitoring
  • βœ… TOML configuration

Future Enhancements

  • Multi-target deployment (AWS, Kubernetes)
  • Docker container support
  • Advanced monitoring with metrics
  • Rollback functionality
  • Plugin system
  • Web dashboard
  • CI/CD integration

Acknowledgments

  • Ratatui - Terminal UI framework
  • Clap - CLI argument parsing
  • Tokio - Async runtime
  • SSH2 - SSH client library

Commit count: 2

cargo fmt