> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Scheduler CLI

> CLI commands for scheduling periodic execution in TypeScript

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    User([User]) --> CLI[CLI]
    CLI --> Scheduler([Schedule])

    classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef tool fill:#189AB4,stroke:#7C90A0,color:#fff

    class Scheduler agent
    class User,CLI tool
    classDef agent fill:#8B0000,color:#fff
    classDef tool fill:#189AB4,color:#fff
```

# Scheduler CLI (TypeScript)

Schedule agents and recipes to run periodically using the praisonai-ts CLI.

## Quick Start

<Steps>
  <Step title="Simple Usage">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    praisonai-ts schedule start my-job --recipe my-recipe --interval hourly
    ```
  </Step>

  <Step title="With Configuration">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    praisonai-ts schedule start my-job --recipe my-recipe --interval hourly --max-cost 1.00
    ```
  </Step>
</Steps>

***

## Commands Overview

| Command                             | Description           |
| ----------------------------------- | --------------------- |
| `praisonai-ts schedule start`       | Start a new scheduler |
| `praisonai-ts schedule list`        | List all schedulers   |
| `praisonai-ts schedule stop <name>` | Stop a scheduler      |
| `praisonai-ts schedule logs <name>` | View scheduler logs   |
| `praisonai-ts schedule stats`       | Show statistics       |

## Start a Scheduler

### With a Task

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Basic scheduler
praisonai-ts schedule start news-checker "Check AI news" --interval hourly

# With timeout and budget
praisonai-ts schedule start reporter "Generate report" \
    --interval daily \
    --timeout 300 \
    --max-cost 1.00
```

### With a Recipe

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Schedule a recipe
praisonai-ts schedule start news-monitor --recipe news-analyzer --interval hourly

# With all options
praisonai-ts schedule start my-scheduler \
    --recipe my-recipe \
    --interval "*/6h" \
    --timeout 600 \
    --max-cost 2.00 \
    --max-retries 3
```

### Start Options

| Option          | Description             |
| --------------- | ----------------------- |
| `--recipe`      | Recipe name to schedule |
| `--interval`    | Schedule interval       |
| `--timeout`     | Timeout per execution   |
| `--max-cost`    | Maximum budget in USD   |
| `--max-retries` | Maximum retry attempts  |

### Interval Formats

| Format   | Description      |
| -------- | ---------------- |
| `hourly` | Every hour       |
| `daily`  | Every day        |
| `*/30m`  | Every 30 minutes |
| `*/6h`   | Every 6 hours    |

## List Schedulers

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts schedule list
```

## Stop a Scheduler

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts schedule stop news-checker
```

## View Logs

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts schedule logs news-checker
praisonai-ts schedule logs news-checker --follow
```

## Show Statistics

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts schedule stats
praisonai-ts schedule stats news-checker
```

## Examples

### Complete Workflow

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# 1. Start a recipe scheduler
praisonai-ts schedule start news-monitor \
    --recipe news-analyzer \
    --interval hourly

# 2. List schedulers
praisonai-ts schedule list

# 3. Check logs
praisonai-ts schedule logs news-monitor --follow

# 4. View stats
praisonai-ts schedule stats news-monitor

# 5. Stop when done
praisonai-ts schedule stop news-monitor
```

### Multiple Schedulers

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Start multiple
praisonai-ts schedule start hourly-news --recipe news-monitor --interval hourly
praisonai-ts schedule start daily-report --recipe report-generator --interval daily

# List all
praisonai-ts schedule list

# Stop all
praisonai-ts schedule stop hourly-news
praisonai-ts schedule stop daily-report
```

## Related

<CardGroup cols={2}>
  <Card title="Scheduler SDK" icon="clock" href="/docs/js/scheduler">
    TypeScript API
  </Card>

  <Card title="Background Tasks" icon="list-check" href="/docs/js/background-tasks">
    One-off tasks
  </Card>
</CardGroup>
