buncore-cli
v0.1.5
Published
Bun Process Manager — a fast, zero-dependency process manager built in Zig for Bun workloads
Maintainers
Readme
buncore - Modern Process Manager for Bun
A modern, Bun-optimized process manager with production-ready features.
Installation
npm install -g buncore-cliAfter installation, use the buncore command:
buncore start app.ts --name api
buncore list
buncore stop apiQuick Start
# Start a TypeScript application
buncore start server.ts --name api --instances 4
# Start with environment variables
buncore start app.ts --name web --env production
# Start from ecosystem file
buncore start ecosystem.config.js
# Monitor processes
buncore list
buncore info api
# Manage processes
buncore restart api
buncore stop api
buncore delete apiFeature Comparison with PM2
| Feature | buncore | PM2 | Notes |
|---------|----------|-----|-------|
| Core Process Management | ✅ | ✅ | Start/stop/restart/delete |
| Load Balancing | ✅ Cluster mode with SO_REUSEPORT | ✅ Cluster mode | buncore uses modern OS-level load balancing |
| Hot Reload | ✅ Zero-downtime graceful reload | ✅ Graceful reload | |
| Auto-restart | ✅ With exponential backoff | ✅ | buncore has smarter backoff strategy |
| Log Management | ✅ Separate stdout/stderr + rotation | ✅ | |
| Ecosystem Config | ✅ JS/JSON support | ✅ | Compatible format |
| Environment Management | ✅ Named env switching | ✅ | |
| Startup Scripts | ✅ systemd/launchd generation | ✅ | |
| Monitoring | ✅ Real-time metrics | ✅ | Built-in web dashboard |
| Memory Management | ✅ Auto-restart on memory limit | ✅ | |
| Cron Jobs | ✅ Built-in cron restart | ❌ | |
| Container Support | ✅ --no-daemon mode | ❌ | Better for Docker/K8s |
| Signal Handling | ✅ Custom signal sending | ✅ | |
| Runtime Scaling | ✅ buncore scale app 8 | ✅ | |
| TypeScript Native | ✅ Built for Bun/Deno | ⚠️ Requires transpilation | buncore runs TS directly |
| Modern Runtime | ✅ Zig + Node.js | ⚠️ Node.js only | Better performance |
| JSON API | ✅ --json output | ✅ | |
| Web Dashboard | ✅ Built-in | ✅ PM2 Plus (separate) | |
Advanced Features
Cluster Mode with SO_REUSEPORT
# OS-level load balancing (Linux/macOS)
buncore start app.ts --name api --exec-mode cluster --instances 4Graceful Reload (Zero Downtime)
# Rolling restart without dropping connections
buncore reload apiSeparate Log Files
# Split stdout and stderr
buncore start app.ts --name api --out-file app.out.log --error-file app.err.logExponential Backoff
# Smart restart delays: 100ms → 200ms → 400ms → ... → 15s
buncore start unstable-app.ts --exp-backoff-restart-delay 100Container Mode
# Run without daemon (Docker/K8s friendly)
buncore start app.ts --no-daemonCron Restart
# Daily restart at midnight
buncore start app.ts --cron-restart "0 0 * * *"Ecosystem Configuration
// ecosystem.config.js
module.exports = {
apps: [
{
name: "api",
script: "server.ts",
instances: 4,
exec_mode: "cluster",
env: {
NODE_ENV: "development",
PORT: 3000
},
env_production: {
NODE_ENV: "production",
PORT: 8000
},
max_memory_restart: "1G",
log_file: "combined.log",
out_file: "out.log",
error_file: "err.log",
cron_restart: "0 0 * * *",
exp_backoff_restart_delay: 100
}
]
};Web Dashboard
# Start built-in monitoring dashboard
buncore web
# Open http://localhost:9615Commands
Process Management
buncore start <script>- Start applicationbuncore restart <name|id|all>- Restart processesbuncore reload <name|id|all>- Graceful reload (zero-downtime)buncore stop <name|id|all>- Stop processesbuncore delete <name|id|all>- Delete processesbuncore kill- Kill daemon and all processes
Monitoring
buncore list- List all processesbuncore info <name|id>- Detailed process informationbuncore logs <name|id>- Show logsbuncore web- Web-based monitoring dashboard
Scaling & Management
buncore scale <name> <number>- Scale instancesbuncore reset <name|all>- Reset restart countersbuncore signal <signal> <name|id>- Send custom signal
Configuration
buncore startup- Generate startup scriptbuncore unstartup- Remove startup scriptbuncore save- Save current process listbuncore resurrect- Restore saved processesbuncore dump- Dump process configuration
Why buncore?
✨ Modern Runtime Support
- Native TypeScript: Run
.tsfiles directly with Bun/Deno - Better Performance: Zig-based daemon with minimal overhead
- Container Ready:
--no-daemonmode for Docker/Kubernetes
🚀 Advanced Features
- SO_REUSEPORT Clustering: Modern OS-level load balancing
- Smart Backoff: Exponential restart delays prevent resource exhaustion
- Cron Restart: Built-in scheduled restarts for memory cleanup
- Separate Logs: stdout/stderr split with automatic rotation
🔧 Production Ready
- Graceful Reload: Zero-downtime deployments
- Memory Management: Auto-restart on memory limits
- Signal Control: Send arbitrary signals to processes
- Startup Integration: systemd/launchd service generation
GitHub & Issues
- Repository: https://github.com/ayazkazan/buncore
- Issues: https://github.com/ayazkazan/buncore/issues
- NPM Package: https://www.npmjs.com/package/buncore-cli
License
MIT
