Scheduler CLI
CLI commands for scheduling periodic agent and recipe execution
Scheduler CLI
Schedule agents and recipes to run periodically as background daemons. Perfect for monitoring tasks, periodic reports, and automated workflows.
Commands Overview
| Command | Description |
|---|---|
praisonai schedule start | Start a new scheduler |
praisonai schedule list | List all schedulers |
praisonai schedule stop <name> | Stop a scheduler |
praisonai schedule logs <name> | View scheduler logs |
praisonai schedule restart <name> | Restart a scheduler |
praisonai schedule delete <name> | Delete a scheduler |
praisonai schedule describe <name> | Show scheduler details |
praisonai schedule save <name> | Export scheduler config |
praisonai schedule stop-all | Stop all schedulers |
praisonai schedule stats | Show aggregate statistics |
Start a Scheduler
With a Task Prompt
# Basic scheduler with task
praisonai schedule start news-checker "Check AI news and summarize" --interval hourly
# With custom interval
praisonai schedule start monitor "Monitor system status" --interval "*/30m"
# With timeout and budget
praisonai schedule start reporter "Generate daily report" \
--interval daily \
--timeout 300 \
--max-cost 1.00
# With max retries
praisonai schedule start checker "Check for updates" \
--interval hourly \
--max-retries 5With a Recipe
# Schedule a recipe
praisonai schedule start news-monitor --recipe news-analyzer --interval hourly
# Recipe with custom interval
praisonai schedule start daily-report --recipe report-generator --interval daily
# Recipe with all options
praisonai schedule start my-scheduler \
--recipe my-recipe \
--interval "*/6h" \
--timeout 600 \
--max-cost 2.00 \
--max-retries 3With an Agents YAML File
# Schedule from agents.yaml
praisonai schedule agents.yaml
# With interval override
praisonai schedule agents.yaml --interval "*/2h"Start Options
| Option | Description |
|---|---|
--recipe | Recipe name to schedule |
--interval | Schedule interval (hourly, daily, */30m, etc.) |
--timeout | Timeout per execution in seconds |
--max-cost | Maximum budget in USD |
--max-retries | Maximum retry attempts (default: 3) |
--daemon | Run as background daemon |
--verbose | Enable verbose logging |
Interval Formats
| Format | Description |
|---|---|
hourly | Every hour |
daily | Every day |
*/30m | Every 30 minutes |
*/6h | Every 6 hours |
3600 | Every 3600 seconds |
List Schedulers
# List all schedulers
praisonai schedule listOutput
Name Status PID Interval Task
================================================================================
news-checker 🟢 running 12345 hourly Check AI news and summarize
daily-report 🟢 running 12346 daily Generate daily report
monitor 🔴 stopped 0 */30m Monitor system status
Total: 3 scheduler(s)Stop a Scheduler
# Stop by name
praisonai schedule stop news-checker
# Stop all schedulers
praisonai schedule stop-allView Logs
# View recent logs
praisonai schedule logs news-checker
# Follow logs in real-time
praisonai schedule logs news-checker --follow
# Show more lines
praisonai schedule logs news-checker --lines 100Restart a Scheduler
# Restart by name
praisonai schedule restart news-checkerDelete a Scheduler
# Delete by name (stops if running)
praisonai schedule delete news-checkerDescribe a Scheduler
# Show detailed information
praisonai schedule describe news-checkerOutput
Scheduler: news-checker
========================
Status: running
PID: 12345
Task: Check AI news and summarize
Recipe: news-analyzer
Interval: hourly
Timeout: 300s
Budget: $1.00
Max Retries: 3
Started: 2024-01-15 10:30:00
Statistics:
Total Executions: 24
Successful: 23
Failed: 1
Success Rate: 95.8%
Total Cost: $0.0024Save Scheduler Config
Export a scheduler’s configuration to YAML:
# Save to file
praisonai schedule save news-checker --output news-checker.yamlOutput YAML
name: news-checker
task: Check AI news and summarize
recipe_name: news-analyzer
interval: hourly
timeout: 300
max_cost: 1.00
max_retries: 3Show Statistics
# Aggregate stats for all schedulers
praisonai schedule stats
# Stats for specific scheduler
praisonai schedule stats news-checkerExamples
Complete Workflow
# 1. Start a recipe scheduler
praisonai schedule start news-monitor \
--recipe news-analyzer \
--interval hourly \
--max-cost 0.50
# 2. List schedulers
praisonai schedule list
# 3. Check logs
praisonai schedule logs news-monitor --follow
# 4. View stats
praisonai schedule describe news-monitor
# 5. Stop when done
praisonai schedule stop news-monitorForeground Mode (for Testing)
# Run in foreground (Ctrl+C to stop)
praisonai schedule "Check news" --interval "*/10s"Production Daemon
# Start as daemon
praisonai schedule start production-monitor \
--recipe system-monitor \
--interval "*/5m" \
--daemon
# Check it's running
praisonai schedule list
# View logs
praisonai schedule logs production-monitor --followMultiple Schedulers
# Start multiple schedulers
praisonai schedule start hourly-news --recipe news-monitor --interval hourly
praisonai schedule start daily-report --recipe report-generator --interval daily
praisonai schedule start health-check --recipe health-checker --interval "*/5m"
# List all
praisonai schedule list
# Stop all at once
praisonai schedule stop-allTroubleshooting
Scheduler Not Starting
If scheduler fails to start:
- Check if name is already in use:
praisonai schedule list - Verify recipe exists:
praisonai recipe list - Check logs for errors
High Cost
If costs are higher than expected:
- Set
--max-costbudget limit - Increase interval between executions
- Use a smaller/cheaper model
Scheduler Stopped Unexpectedly
If scheduler stops:
- Check logs:
praisonai schedule logs <name> - Verify API keys are set
- Check if budget limit was reached
Cannot Stop Scheduler
If stop command doesn’t work:
- Get PID from list:
praisonai schedule list - Kill manually: `kill
`
- Delete state:
praisonai schedule delete <name>
See Also
- Scheduler SDK – Python API for scheduling
- Background Tasks CLI – One-time background tasks
- Async Jobs CLI – Server-based job execution