Open Source Written in Rust AI-Powered

The AI-powered
process manager.

Single binary. Zero dependencies. Health probes, AI crash diagnosis, Telegram alerts, Prometheus metrics, reverse proxy, cloud fleet management, TUI dashboard. All built in Rust.

mhost
$ mhost start mhost.toml
Started 'api-server'
Started 'worker' (2 instances)
Started 'frontend'

$ mhost list
id   name          status       pid    cpu    mem      uptime     restarts
────────────────────────────────────────────────────────────────────────────
a1b2 api-server    ● online    12345  12.3%  128MB    2d 14h     0
c3d4 worker        ● online    12346   3.1%   64MB    2d 14h     0
e5f6 worker        ● online    12347   2.8%   62MB    2d 14h     0
g7h8 frontend      ● online    12348   1.0%   32MB    1d 08h     0

$ mhost ai diagnose api-server
Root Cause: Connection pool exhausted (10/10 connections)
Fix: Increase pool_size to 25 in database.config
Prevention: Add alert for pool utilization > 80%
0
Rust Crates
0
Tests Passing
0
CLI Commands
0
Notification Channels
0
AI Features
Comparison

Everything PM2 does.
And everything it doesn't.

FeaturePM2mhost
Runtime requiredNode.js (150MB+)None (14MB binary)
Health checksAlive/dead onlyHTTP, TCP, script probes
Log searchgrep files manuallyBuilt-in FTS5 full-text search
NotificationsPlugin required8 channels built-in
MetricsBasicPrometheus + alerts + auto-remediation
Reverse proxyNoneBuilt-in with auto-TLS
DeployBasicGit + hooks + rollback + history
DashboardWeb onlyTerminal TUI with sparklines
Process groupsNoneDependency ordering (topological sort)
Restart strategyBasicExponential backoff + circuit breaker
AI intelligenceNoneDiagnose, optimize, ask, watch (OpenAI/Claude)
Cloud fleetNoneSSH fleet — AWS, Azure, DO, Railway auto-import
Remote controlNoneTelegram/Discord bot with role-based permissions
Config formatJS onlyTOML, YAML, JSON
Features

Built for production.
Designed for developers.

Every feature you need to manage processes in production. No plugins, no runtime dependencies.

Health Probes

HTTP, TCP, and script-based health checks. Processes only go online after probes pass. Failures trigger auto-restart.

Auto-Restart

Exponential backoff (100ms to 30s). Circuit breaker stops restart loops. Configurable per process.

Process Groups

Dependency ordering with topological sort. Start databases before APIs. Stop in reverse order.

8 Notification Channels

Telegram, Slack, Discord, Email, PagerDuty, Teams, Ntfy, Webhook. Throttling, escalation, auto-resolve.

Log Engine

FTS5 full-text search. JSON auto-parse. GELF, Loki, Elasticsearch, Syslog sinks. Retention policies.

Prometheus Metrics

CPU, memory, uptime, restarts exported to /metrics. Alert rules with auto-remediation.

Reverse Proxy

Host-based routing, load balancing (round-robin, least-conn, IP-hash), auto-TLS via Let's Encrypt, sticky sessions.

Deploy Engine

Git pull + pre/post hooks + graceful reload. Full deploy history. One-command rollback.

TUI Dashboard

Split-pane terminal UI. Process table, CPU/memory sparklines, live log tail, vim keybindings.

💬

Chat Bot Control

Control processes from Telegram or Discord. Role-based permissions, confirmation for destructive actions, audit logging.

NEW

AI-Powered Intelligence.
Built right in.

The first process manager with built-in LLM capabilities. Diagnose crashes, query logs in English, generate configs, get optimization suggestions.

mhost ai
$ mhost ai diagnose api-server
Root Cause
Unhandled promise rejection in database.js:42. Connection pool exhausted after 15 concurrent requests exceeded the pool limit of 10.

Fix Steps
1. Increase pool size: max_connections: 25
2. Add connection timeout: idle_timeout: 30000

Prevention
Add health check for DB pool utilization. Set alert: memory > 256MB for 5m
$ mhost ai ask "which process uses the most memory?"
api-server is using 128.4 MB across 1 instance. The workers are at 64 MB each.
$ mhost ai config "node api with 2 python workers and health checks"
Generated mhost.toml
[process.api]
command = "node server.js"
instances = 1

[process.api.health.http]
url = "http://localhost:3000/health"

10 AI Commands

diagnose — crash root cause analysis
logs — natural language log search
optimize — performance recommendations
config — generate config from description
postmortem — incident report generation
watch — real-time anomaly detection
ask — ask anything about your processes
explain — config explanation in plain English
suggest — proactive improvement suggestions
setup — configure OpenAI or Claude

Supports Both Providers

OpenAI
GPT-4o, GPT-4o-mini, any chat model
Anthropic Claude
Sonnet, Haiku, Opus
# ~/.mhost/ai.json
{ "provider": "openai",
  "api_key": "${OPENAI_API_KEY}",
  "model": "gpt-4o" }
NEW

Manage your entire fleet.
From one terminal.

Connect to EC2, Azure, DigitalOcean, Railway, or any SSH server. Deploy, monitor, and scale across your entire infrastructure.

mhost cloud
$ mhost cloud import aws --region us-east-1 --tag env=production
+ prod-api (54.123.45.67)
+ prod-worker (54.123.45.68)
+ prod-db (54.123.45.69)
Imported 3 servers from aws

$ mhost cloud status
Server          Status   mhost   Processes  CPU
────────────────────────────────────────────────────
prod-api        ● up     yes     4/4        45%
prod-worker     ● up     yes     3/3        72%
prod-db         ● up     yes     1/1        12%

$ mhost cloud restart all api-server
prod-api: restarted 'api-server'
prod-worker: restarted 'api-server'

Cloud Providers

Auto-import servers from AWS EC2, Azure VMs, DigitalOcean, Railway. One command to discover your entire fleet.

Remote Operations

Deploy configs, stream logs, restart processes, scale instances — all via SSH. No custom agents required.

AI Cloud Ops

AI provisions infrastructure, diagnoses remote servers, and plans migrations between environments.

Get Started

Install in seconds.

🍺
Homebrew
brew install maqalaqil/tap/mhost
📦
npm
npm install -g @maqalaqil93/mhost
Cargo
cargo install mhost
curl
curl -fsSL mhost.dev/install.sh | sh
PowerShell
irm mhost.dev/install.ps1 | iex
💻
From Source
git clone && cargo build --release
See It In Action

From zero to production
in 60 seconds.

~/myapp
Configuration

One file.
Your entire stack.

Define processes, health checks, groups, notifications, metrics, deploy hooks, and AI config in a single TOML, YAML, or JSON file. Environment variable expansion with ${VAR} syntax.

TOML, YAML, JSON support
Environment variable expansion
Health probes per process
Dependency groups
Notification channels
Alert rules & auto-remediation
# mhost.toml [process.api-server] command = "node server.js" instances = 4 max_memory = "512MB" grace_period = "5s" [process.api-server.health.http] url = "http://localhost:3000/health" interval = "10s" [process.worker] command = "python3 worker.py" instances = 2 cron_restart = "0 3 * * *" [groups.backend] processes = ["api-server", "worker"] [notifications.telegram] bot_token = "${TELEGRAM_TOKEN}" events = ["crash", "errored"] [alerts.high-memory] condition = "memory > 450MB for 5m" action = "restart"
Architecture

15 crates. One binary.

Modular Rust workspace. Each crate has one responsibility. The CLI and daemon compile into two binaries with zero runtime dependencies.

mhost-core Core types, state machine, JSON-RPC protocol mhost-config TOML / YAML / JSON config parsing mhost-ipc JSON-RPC over Unix socket / named pipe mhost-logs Log capture, FTS5, rotation, 4 external sinks mhost-health HTTP / TCP / script health probes mhost-notify 8 notification channels + throttle + escalation mhost-metrics Collector, time-series, Prometheus, alerts mhost-proxy Reverse proxy, TLS, ACME, load balancing mhost-deploy Git deploy, hooks, rollback, history mhost-ai LLM intelligence (OpenAI / Claude) - 10 features mhost-cloud Remote fleet management - SSH, AWS, Azure, DO, Railway mhost-bot Telegram/Discord bot - role-based control, audit log mhost-tui Terminal dashboard with sparklines (ratatui) mhost-daemon Process supervisor, state store (mhostd binary) mhost-cli CLI interface with 49 commands (mhost binary)

Ready to replace PM2?

One command to install. One file to configure. Zero dependencies.