Expand description
CLI command implementations for CeleRS distributed task queue management.
This module provides all the command implementations for the CeleRS CLI tool.
Commands are organized into the following categories:
- Worker Management: Starting, stopping, pausing, scaling workers
- Queue Operations: Listing, purging, moving, importing/exporting queues
- Task Management: Inspecting, canceling, retrying, and monitoring tasks
- DLQ Operations: Managing failed tasks in the Dead Letter Queue
- Scheduling: Managing scheduled/periodic tasks with cron expressions
- Monitoring: Metrics, dashboard, health checks, and diagnostics
- Database: Connection testing, health checks, migrations
- Configuration: Validation, initialization, and profile management
§Error Handling
All functions return anyhow::Result<()> for consistent error handling.
Errors are user-friendly and provide actionable feedback.
§Examples
use celers_cli::commands;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Start a worker
commands::start_worker(
"redis://localhost:6379",
"my_queue",
"fifo",
4,
3,
300
).await?;
Ok(())
}Functions§
- add_
schedule - Add a new scheduled task
- alert_
start - Start alert monitoring service
- alert_
test - Test webhook notification
- analyze_
bottlenecks - Analyze performance bottlenecks
- analyze_
failures - Analyze failure patterns
- autoscale_
start - Start auto-scaling service
- autoscale_
status - Show auto-scaling status
- cancel_
task - Cancel a running or pending task
- clear_
dlq - Clear Dead Letter Queue
- db_
health - Check database health
- db_
migrate - Run database migrations
- db_
pool_ stats - Show connection pool statistics
- db_
test_ connection - Test database connection
- debug_
task - Debug task execution details
- debug_
worker - Debug worker issues
- doctor
- Automatic problem detection and diagnostics
- drain_
worker - Drain worker (stop accepting new tasks)
- export_
queue - Export queue tasks to a JSON file
- health_
check - Run system health diagnostics
- import_
queue - Import queue tasks from a JSON file
- init_
config - Generate a default configuration file with template settings.
- inspect_
dlq - Inspect failed tasks in the Dead Letter Queue (DLQ).
- inspect_
task - Inspect a specific task by ID
- list_
queues - List all queues (Redis only)
- list_
schedules - List all scheduled tasks
- list_
workers - List all running workers
- move_
queue - Move all tasks from one queue to another
- pause_
queue - Pause queue processing
- pause_
schedule - Pause a schedule
- pause_
worker - Pause task processing for a worker
- purge_
queue - Purge all tasks from a queue
- queue_
stats - Show detailed queue statistics
- remove_
schedule - Remove a scheduled task
- replay_
task - Replay a task from DLQ
- report_
daily - Generate daily execution report
- report_
weekly - Generate weekly statistics report
- requeue_
task - Move task from one queue to another
- resume_
queue - Resume queue processing
- resume_
schedule - Resume a paused schedule
- resume_
worker - Resume task processing for a worker
- retry_
task - Retry a failed task (from any queue)
- run_
dashboard - Run interactive TUI dashboard for real-time monitoring
- scale_
workers - Scale workers to N instances
- schedule_
history - Show execution history for a schedule
- show_
metrics - Display Prometheus metrics
- show_
status - Display queue status and statistics.
- show_
task_ logs - Show task execution logs
- show_
task_ result - Show task result from backend
- start_
worker - Start a worker with the given configuration.
- stop_
worker - Stop a specific worker
- trigger_
schedule - Manually trigger a scheduled task
- validate_
config - Validate configuration file
- worker_
logs - Stream worker logs with optional filtering and follow mode
- worker_
stats - Show detailed statistics for a worker