Skip to main content

Scheduler CLI

Schedule agents and recipes to run periodically as background daemons. Perfect for monitoring tasks, periodic reports, and automated workflows.

Commands Overview

CommandDescription
praisonai schedule startStart a new scheduler
praisonai schedule listList 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-allStop all schedulers
praisonai schedule statsShow 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 5

With 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 3

With an Agents YAML File

# Schedule from agents.yaml
praisonai schedule agents.yaml

# With interval override
praisonai schedule agents.yaml --interval "*/2h"

Start Options

OptionDescription
--recipeRecipe name to schedule
--intervalSchedule interval (hourly, daily, */30m, etc.)
--timeoutTimeout per execution in seconds
--max-costMaximum budget in USD
--max-retriesMaximum retry attempts (default: 3)
--daemonRun as background daemon
--verboseEnable verbose logging

Interval Formats

FormatDescription
hourlyEvery hour
dailyEvery day
*/30mEvery 30 minutes
*/6hEvery 6 hours
3600Every 3600 seconds

List Schedulers

# List all schedulers
praisonai schedule list

Output

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-all

View 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 100

Restart a Scheduler

# Restart by name
praisonai schedule restart news-checker

Delete a Scheduler

# Delete by name (stops if running)
praisonai schedule delete news-checker

Describe a Scheduler

# Show detailed information
praisonai schedule describe news-checker

Output

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.0024

Save Scheduler Config

Export a scheduler’s configuration to YAML:
# Save to file
praisonai schedule save news-checker --output news-checker.yaml

Output YAML

name: news-checker
task: Check AI news and summarize
recipe_name: news-analyzer
interval: hourly
timeout: 300
max_cost: 1.00
max_retries: 3

Show Statistics

# Aggregate stats for all schedulers
praisonai schedule stats

# Stats for specific scheduler
praisonai schedule stats news-checker

Examples

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-monitor

Foreground 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 --follow

Multiple 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-all

Troubleshooting

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-cost budget 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 <PID>
  • Delete state: praisonai schedule delete <name>

See Also