Velos
High-performance AI-friendly process manager (PM2 alternative). Zig core + Rust shell. Native MCP server, algorithmic smart logs β zero LLM cost.
Ask AI about Velos
Powered by Claude Β· Grounded in docs
I know everything about Velos. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Velos
High-performance AI-friendly process manager
Zig core + Rust shell. Next-gen PM2 alternative with native MCP server and zero-LLM smart log analysis.
Why Velos?
Process managers like PM2 and Supervisor were built before the AI era. Velos is designed from the ground up for a world where AI agents manage your infrastructure: a native MCP server lets Claude, Codex, or Gemini start, stop, and debug your processes directly. When something breaks, Velos detects the error in real time, analyzes it with AI, and can auto-fix the bug β all without you opening a terminal.
Under the hood, a Zig core keeps the daemon at ~3 MB RAM idle, growing just ~65 KB per managed process (vs PM2's ~60 MB baseline from the Node.js/V8 runtime). A Rust shell provides a modern CLI, smart log analysis, and observability stack β all in a single binary with zero runtime dependencies.
| Velos | PM2 | Supervisor | |
|---|---|---|---|
| Daemon memory | ~3 MB | ~60 MB | ~30 MB |
| MCP server for AI agents | Built-in (13 tools) | - | - |
| AI crash analysis + auto-fix | Built-in | - | - |
| Runtime error detection | Sentry-like | - | - |
| Crash alerts (Telegram) | Built-in | - | - |
| Smart log analysis | Algorithmic (zero LLM cost) | - | - |
| Prometheus + OpenTelemetry | Built-in | plugin | - |
| REST API + WebSocket | Built-in | plugin | - |
| Cluster mode | Yes | Yes | - |
| TUI dashboard | Yes | Yes | - |
| Watch mode | kqueue/inotify | chokidar | - |
Quick Start
Install
# One-line installer (macOS / Linux)
curl -fsSL https://releases.velospm.dev/install.sh | bash
# macOS (Homebrew)
brew install Dave93/tap/velos
# Debian / Ubuntu
curl -fsSL https://releases.velospm.dev/setup-apt.sh | sudo bash
# RHEL / Fedora / CentOS
curl -fsSL https://releases.velospm.dev/setup-yum.sh | sudo bash
# From source (requires Zig 0.15+ and Rust 1.75+)
git clone https://github.com/Dave93/velos.git
cd velos
make build
Usage
# Start managing processes (daemon starts automatically)
velos start server.js --name api
velos start worker.py --name bg -i 4 # cluster mode: 4 instances
velos list # show all processes
velos logs api --summary # smart log summary
velos monit # TUI dashboard
Note: The daemon starts automatically on your first CLI command. No need to run
velos daemonmanually.
Shell Completions
# Bash
velos completions bash > ~/.bash_completion.d/velos
# Zsh
velos completions zsh > ~/.zfunc/_velos
# Fish
velos completions fish > ~/.config/fish/completions/velos.fish
Features
Process Management
- Start/stop/restart/reload with graceful shutdown (SIGTERM -> SIGKILL)
- Autorestart with crash loop detection (max_restarts, min_uptime, exp_backoff)
- Cluster mode β multi-instance with
velos start -i Nor-i max - Watch mode β auto-restart on file changes (kqueue/inotify)
- Memory limits β restart when RSS exceeds threshold (
--max-memory 150M) - Cron restart β periodic restart on schedule (
--cron-restart "0 3 * * *") - Ready signal β process reports readiness via IPC (
--wait-ready) - Graceful shutdown β JSON message via IPC instead of SIGTERM (
--shutdown-with-message) - State persistence β save/resurrect process list across daemon restarts
- Auto-daemon β daemon starts automatically on first CLI command, no manual setup required
Runtime Error Detection (Sentry-like)
Velos monitors stderr of running processes for error patterns (Traceback, TypeError, panic, FATAL, segmentation fault, etc.) and sends notifications without requiring a process crash β similar to how Sentry detects runtime errors.
- Configurable via Telegram notifications
- Per-process 60-second cooldown to prevent notification spam
- Suppressed after AI auto-fix restart (no duplicate alerts)
- Works independently of crash detection
Smart Log Engine (Zero LLM Cost)
All "smart" features are algorithmic β regex, statistics, heuristics. No LLM API calls.
- Auto-classifier β detect log levels (regex + JSON-aware)
- Deduplication β collapse repeated messages with count and time range
- Pattern detection β frequency analysis with trend (rising/stable/declining)
- Anomaly detection β sliding window, mean + stddev, 2Ο/3Ο thresholds
- Summary β health score (0-100), top patterns, anomalies, last error
velos logs api --summary
velos logs api --level error --grep "timeout" --dedupe
MCP Server (AI Agent Integration)
Built-in Model Context Protocol server with 13 tools for AI agents. Supports stdio (local) and Streamable HTTP (remote) transports.
Local (stdio) β AI client and Velos on the same machine
Claude Code β .mcp.json in project root
{
"mcpServers": {
"velos": { "command": "velos", "args": ["mcp-server"] }
}
}
Claude Desktop β ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"velos": { "command": "/Users/you/.velos/bin/velos", "args": ["mcp-server"] }
}
}
Cursor β .cursor/mcp.json
{
"mcpServers": {
"velos": { "command": "velos", "args": ["mcp-server"] }
}
}
OpenAI Codex β ~/.codex/config.toml
[mcp_servers.velos]
command = "velos"
args = ["mcp-server"]
Or via CLI: codex mcp add velos -- velos mcp-server
Gemini CLI β ~/.gemini/settings.json
{
"mcpServers": {
"velos": { "command": "velos", "args": ["mcp-server"] }
}
}
Remote (HTTP) β Velos on VPS, AI client on your laptop
Start MCP server on your VPS:
velos mcp-server --port 8080
Then configure your AI client with the remote URL:
Claude Code / Claude Desktop / Cursor
{
"mcpServers": {
"velos": { "type": "url", "url": "http://your-vps:8080/mcp" }
}
}
OpenAI Codex β ~/.codex/config.toml
[mcp_servers.velos]
url = "http://your-vps:8080/mcp"
Gemini CLI β ~/.gemini/settings.json
{
"mcpServers": {
"velos": { "url": "http://your-vps:8080/mcp" }
}
}
Tip: For production, use HTTPS via a reverse proxy (nginx/caddy) or SSH tunnel:
ssh -L 8080:localhost:8080 user@your-vps
Available Tools
| Tool | Description |
|---|---|
process_list | List processes with status, memory, uptime |
process_start | Start a new process |
process_stop | Stop by name or ID |
process_restart | Restart by name or ID |
process_delete | Delete a stopped process |
process_info | Detailed info (config + state + metrics) |
log_read | Last N lines with level filter |
log_search | Regex search with time range |
log_summary | Health score, patterns, anomalies (~150 tokens vs 50K lines) |
health_check | Overall + per-process health score |
metrics_snapshot | Current CPU, RAM, restarts, uptime |
config_get | Process configuration |
config_set | Modify config (planned) |
Full reference: docs/mcp-tools.md
AI Output Mode (--ai)
The --ai flag outputs compact JSON with abbreviated keys, designed to minimize token usage when piping Velos output to LLMs or AI agents.
# Standard output
velos list
# ID Name PID Status Memory Uptime Restarts
# 0 api 1234 online 45.2 MB 2h 30m 0
# JSON output (full keys)
velos list --json
# [{"id": 0, "name": "api", "pid": 1234, "status": "online", "memory_bytes": 47395840, ...}]
# AI output (abbreviated keys, ~40% fewer tokens)
velos list --ai
# [{"n":"api","i":0,"s":"online","m":47395840,"u":9000000,"r":0,"p":1234}]
Key abbreviations: n=name, i=id, s=status, p=pid, m=memory (bytes), u=uptime (ms), r=restarts, c=cpu (%), t=timestamp, l=level
Supported commands: velos list --ai, velos info <name> --ai, velos logs <name> --ai
AI Crash Analysis & Auto-Fix
When a process crashes, Velos can analyze the error with AI and auto-fix the bug. Supports Anthropic (Claude) and OpenAI-compatible providers (OpenAI, OpenRouter, Groq, Ollama, xAI).
# Configure AI provider
velos config set ai.provider anthropic
velos config set ai.api_key sk-ant-...
velos config set ai.model claude-sonnet-4-20250514
# Optional: enable auto-analysis on crash
velos config set ai.auto_analyze true
# Configure Telegram for crash notifications
velos config set telegram.bot_token 123456:ABC...
velos config set telegram.chat_id -100123456789
velos config set notifications.language ru # en or ru
On crash or runtime error: logs are collected, stack traces parsed, source code extracted, AI analysis runs, and a Telegram notification is sent with Fix / Ignore inline buttons. After a successful AI fix, the process is automatically restarted and notifications are suppressed to prevent duplicate alerts.
# Manual commands
velos ai list # list crash records
velos ai analyze <crash-id> # re-analyze a crash
velos ai fix <crash-id> # run AI agent to auto-fix
velos ai ignore <crash-id> # mark as ignored
The AI fix agent has 9 tools: read/edit/create/delete files, grep, glob, list directories, run commands, and git diff β all sandboxed to the project directory.
Supported AI providers: Anthropic (Claude), OpenAI, OpenRouter, Groq, Ollama, xAI β any OpenAI-compatible API.
Monitoring & Metrics
- TUI dashboard (
velos monit) β real-time process table, memory sparkline, live logs - Prometheus endpoint (
velos metrics -p 9615) β scrape at/metrics - OpenTelemetry β OTLP export (
--otel-endpoint) - REST API (
velos api -p 3100) β JSON API + WebSocket real-time updates
CLI Reference
All commands support --json for machine-readable output.
| Command | Description |
|---|---|
velos daemon | Run daemon in foreground |
velos start <script> | Start a process (or --config velos.toml) |
velos stop <name|id> | Stop a process |
velos restart <name|id|all> | Restart process(es) |
velos reload <name|id|all> | Graceful reload |
velos list | List all processes (alias: ls) |
velos info <name|id> | Detailed process info |
velos logs <name> | Show logs with smart analysis |
velos delete <name|id> | Delete a process |
velos save | Save process list to state file |
velos resurrect | Restore saved processes |
velos flush [name|id] | Flush log files |
velos scale <name> <count> | Scale cluster instances (+N, -N, max) |
velos monit | TUI monitoring dashboard |
velos metrics | Start Prometheus exporter |
velos api | Start REST API + WebSocket server |
velos mcp-server | Start MCP server (stdio or --port for Streamable HTTP) |
velos startup | Auto-start daemon on boot (launchd/systemd) |
velos unstartup | Remove auto-start configuration |
velos completions <shell> | Generate shell completions |
velos config set <key> <val> | Set global config value |
velos config get [key] | Show config value(s) |
velos ai list | List crash records |
velos ai fix <id> | Auto-fix crash with AI agent |
velos ai analyze <id> | Re-analyze crash with AI |
velos ai ignore <id> | Mark crash as ignored |
velos ping | Check daemon connectivity |
Key Flags
# Start options
velos start app.js --name api --watch --max-memory 256M
velos start app.js -i 4 # cluster: 4 instances
velos start app.js -i max # cluster: CPU count instances
velos start app.js --cron-restart "0 3 * * *"
velos start app.js --wait-ready --shutdown-with-message
velos start --config velos.toml
# Log options
velos logs api -l 200 # last 200 lines
velos logs api --level error,warn # filter by level
velos logs api --grep "timeout" # regex filter
velos logs api --since "1h" --dedupe # last hour, deduplicated
velos logs api --summary # health score + patterns
# Output modes
velos list --json # full JSON
velos list --ai # compact JSON for LLM
Configuration (TOML)
[apps.api]
script = "server.js"
cwd = "/app"
interpreter = "node"
autorestart = true
max_restarts = 15
min_uptime = 1000
kill_timeout = 5000
max_memory_restart = "150M"
# File watching
watch = true
watch_paths = ["src/", "config/"]
watch_ignore = ["node_modules", ".git", "*.log"]
watch_delay = 1000
# Environment variables
[apps.api.env]
NODE_ENV = "production"
PORT = "3000"
# Profile-specific env (--env production)
[apps.api.env_production]
DATABASE_URL = "postgres://prod:5432/db"
[apps.worker]
script = "worker.py"
interpreter = "python3"
autorestart = true
max_memory_restart = "256M"
velos start --config velos.toml
velos start --config velos.toml --env production
Full example: config/velos.example.toml
Stack Examples
| Stack | Config | Description |
|---|---|---|
| Node.js Web Server | velos.toml | Express/Fastify with file watching, memory limits, env profiles |
| Python FastAPI | velos.toml | Uvicorn + Celery worker |
| Rust Binary | velos.toml | Compiled binary with exponential backoff restarts |
| Multi-Process | velos.toml | Frontend + Backend + Worker in one config |
Architecture
ββββββββββββββββ Unix socket ββββββββββββββββββββββββ
β velos CLI β <ββββ IPC ββββββββ> β Zig Daemon Core β
β (Rust) β binary protocol β fork/exec, kqueue, β
β clap, tokio β β CPU/RAM monitoring, β
ββββββββββββββββ β log collector, β
β file watcher, β
β cron scheduler β
ββββββββββββββββββββββββ
Zig core (zig/src/): daemon, fork/exec, IPC server, event loop (kqueue/epoll), CPU/RAM monitoring via syscalls, log collector with error pattern detection, ring buffer, file watcher, cron parser, IPC channel (socketpair).
Rust shell (crates/): CLI (clap) with 27+ commands, IPC client, TOML config, Smart Log Engine, MCP Server (JSON-RPC stdio + Streamable HTTP), Prometheus/OpenTelemetry, REST API (axum), TUI (ratatui), AI crash analysis agent.
Bridge: Zig compiles to libvelos_core.a (static library, C ABI) -> Rust links via FFI.
| Crate | Role |
|---|---|
velos-ffi | FFI bindings to Zig (extern "C", safe wrappers) |
velos-core | Shared types: ProcessConfig, ProcessState, IPC protocol, errors |
velos-client | IPC client (Unix socket -> daemon) |
velos-config | TOML parsing and validation |
velos-log-engine | Smart Logs: classifier, dedup, patterns, anomaly, summary |
velos-mcp | MCP Server (stdio, JSON-RPC, 13 tools) |
velos-metrics | Prometheus exporter, OpenTelemetry |
velos-api | REST API + WebSocket (axum) |
velos-ai | AI crash analysis, agent with tools, multi-provider |
velos-cli | CLI binary (clap, ratatui TUI) |
IPC protocol: binary, 7-byte header (magic 0xVE10 + version + length LE u32) + MessagePack payload. Unix socket at ~/.velos/velos.sock.
Full architecture: docs/ARCHITECTURE.md
Runtime Directory
~/.velos/
βββ velos.sock # IPC Unix socket
βββ velos.pid # Daemon PID file
βββ config.toml # Global config (velos config set/get)
βββ state.bin # Saved process state (velos save / auto-save)
βββ crashes/ # AI crash records and agent logs
β βββ <id>.json # Crash context + analysis
β βββ <id>.log # AI agent execution log
βββ logs/ # Process log files
βββ api-out.log # stdout
βββ api-err.log # stderr
Building from Source
Requirements
- Zig 0.15+
- Rust 1.75+ (with cargo)
- macOS or Linux
Build
make dev # Debug: Zig + Rust (fast iteration)
make build # Release: Zig (ReleaseFast) + Rust (release)
make test # All tests: Zig unit + Rust unit
make clean # Clean build artifacts
Pipeline: zig build -> libvelos_core.a -> cargo build -> target/release/velos
Tests
# Zig unit tests
cd zig && zig build test
# Rust unit tests
cargo test --workspace
# Integration tests (49 tests, full lifecycle)
bash tests/integration_lifecycle.sh
Documentation
| Document | Description |
|---|---|
| CHANGELOG.md | Release notes |
| CONTRIBUTING.md | Development setup and contribution guide |
| SECURITY.md | Security policy and vulnerability reporting |
| docs/ARCHITECTURE.md | Full architecture (1200+ lines) |
| docs/mcp-tools.md | MCP Server tool reference (13 tools) |
Contributing
We welcome contributions! Please see CONTRIBUTING.md for development setup, code style, and PR guidelines.
Before contributing, please read:
- CONTRIBUTING.md β development setup and workflow
- CODE_OF_CONDUCT.md β community standards
- docs/ARCHITECTURE.md β Zig+Rust hybrid architecture
For security vulnerabilities, see SECURITY.md.
License
MIT OR Apache-2.0
