celers-cli
Command-line interface for managing CeleRS workers, queues, and task execution.
Overview
Status: ✅ FEATURE COMPLETE
A comprehensive CLI tool providing full-featured management for CeleRS distributed task queues. Supports multiple brokers (Redis, PostgreSQL), advanced worker management, monitoring, debugging, and operational workflows.
Installation
# Install from source
# The binary is named 'celers'
Quick Start
# Initialize configuration
# Start a worker
# Check queue status
# Run health diagnostics
# Launch interactive dashboard
Core Features
Worker Management
# Start worker with configuration
# List all running workers
# Show worker statistics
# Stop a worker (graceful)
# Pause/resume worker
# Drain worker (finish current tasks, accept no new ones)
# Stream worker logs
# Scale workers
Queue Management
# List all queues (Redis)
# Show detailed queue statistics
# Pause/resume queue processing
# Purge all tasks from queue
# Move tasks between queues
# Export/import queues
Task Operations
# Inspect task details
# Cancel a running task
# Retry a failed task
# Show task result
# Show task execution logs
# Move task to different queue
Dead Letter Queue (DLQ)
# Inspect failed tasks
# Clear all DLQ tasks
# Replay specific task from DLQ
Scheduling & Beat
# List scheduled tasks
# Add new scheduled task
# Pause/resume schedule
# Manually trigger scheduled task
# Show execution history
# Remove schedule
Monitoring & Metrics
# Display live metrics
# Export metrics to file
# Filter metrics by pattern
# Watch mode (auto-refresh)
# Interactive dashboard (TUI)
Auto-scaling
# Start auto-scaling service
# Check auto-scaling status
Alerting
# Start alert monitoring
# Test webhook notification
Debugging & Diagnostics
# Debug task execution
# Debug worker issues
# System health check
# Automatic problem detection
Reporting & Analytics
# Daily execution report
# Weekly statistics
# Analyze performance bottlenecks
# Analyze failure patterns
Database Operations
# Test database connection
# Run latency benchmark
# Check database health
# Show connection pool statistics
# Apply migrations
# Check migration status
Configuration
Generate Default Configuration
Configuration File Format
# celers.toml
[]
= "redis" # or "postgres"
= "redis://localhost:6379"
= "celers"
= "fifo" # or "priority"
# Broker failover (optional)
= [
"redis://backup1:6379",
"redis://backup2:6379"
]
= 3
= 5
[]
= 4
= 1000
= 3
= 300
# Multiple queues
= ["celers", "high_priority", "low_priority"]
[]
= false
= 1
= 10
= 80
= 20
= 60
[]
= false
= "https://hooks.example.com/alerts"
= 60
= 100
= 50
Environment Variables
Configuration supports environment variable expansion:
[]
= "${REDIS_URL:redis://localhost:6379}" # Uses $REDIS_URL or default
= "${QUEUE_NAME}" # Uses $QUEUE_NAME
Profile Support
Use different configurations for different environments:
# Create profile-specific configs
# Use specific profile
Configuration Validation
# Validate configuration file
# Validate and test broker connection
Shell Completion
Generate completion scripts for your shell:
# Bash
# Zsh
# Fish
# PowerShell
# Elvish
Man Pages
Generate and install man pages:
# Generate man pages
# Install system-wide
# View man page
Broker Support
Redis
Full support for all features:
- FIFO and Priority queues
- Real-time monitoring
- Pub/Sub for commands
- DLQ management
- Task scheduling
PostgreSQL
Full support for all features:
- FIFO and Priority queues
- Transaction support
- Schema migrations
- Connection pooling
Advanced Usage
Multi-Queue Management
# Configure multiple queues in config file
# Start worker processing all queues
Production Workflows
# 1. Health check before deployment
# 2. Drain workers for maintenance
# 3. Export queue for backup
# 4. Monitor with auto-refresh
# 5. Set up alerting
Automation & Scripting
The CLI returns appropriate exit codes for scripting:
#!/bin/bash
# Check if queue is healthy
if ; then
else
fi
Command Reference
| Category | Command | Description |
|---|---|---|
| Worker | worker |
Start worker process |
worker-mgmt list |
List all workers | |
worker-mgmt stats |
Worker statistics | |
worker-mgmt stop |
Stop worker | |
worker-mgmt pause/resume |
Pause/resume worker | |
worker-mgmt drain |
Drain worker | |
worker-mgmt scale |
Scale workers | |
worker-mgmt logs |
Stream worker logs | |
| Queue | queue list |
List queues |
queue stats |
Queue statistics | |
queue purge |
Clear queue | |
queue move |
Move tasks | |
queue export/import |
Backup/restore | |
queue pause/resume |
Pause/resume queue | |
| Task | task inspect |
Task details |
task cancel |
Cancel task | |
task retry |
Retry task | |
task result |
Show result | |
task logs |
Task logs | |
task requeue |
Move task | |
| DLQ | dlq inspect |
View failed tasks |
dlq clear |
Clear DLQ | |
dlq replay |
Retry task | |
| Schedule | schedule list |
List schedules |
schedule add |
Add schedule | |
schedule remove |
Remove schedule | |
schedule pause/resume |
Pause/resume | |
schedule trigger |
Manual trigger | |
schedule history |
Execution history | |
| Monitoring | metrics |
Show metrics |
dashboard |
Interactive TUI | |
autoscale start/status |
Auto-scaling | |
alert start/test |
Alerting | |
| Diagnostics | health |
Health check |
doctor |
Problem detection | |
debug task/worker |
Debug tools | |
| Reporting | report daily/weekly |
Reports |
analyze bottlenecks |
Performance | |
analyze failures |
Failure patterns | |
| Database | db test-connection |
Test connection |
db health |
Database health | |
db pool-stats |
Pool statistics | |
db migrate |
Run migrations | |
| Config | init |
Generate config |
validate |
Validate config | |
completions |
Shell completion | |
manpages |
Generate man pages | |
| Other | status |
Queue status |
Colored Output
The CLI uses colored output for better readability:
- 🟢 Green: Success messages
- 🟡 Yellow: Warnings
- 🔴 Red: Errors
- 🔵 Cyan: Information
Colors are automatically disabled when output is piped or in CI environments.
Exit Codes
0: Success1: General error2: Configuration error3: Connection error
Contributing
See the main CeleRS repository for contribution guidelines.
See Also
celers-core: Core types and traitscelers-worker: Worker runtimecelers-broker-redis: Redis broker implementationcelers-broker-postgres: PostgreSQL broker implementationcelers-metrics: Metrics collection and export
License
See LICENSE file in the repository root.