---
name: cron-pretty
description: Translate cron expressions to plain English and show the next N fire times. Supports standard 5-field crontab and limited 6-field (with seconds). Optional reverse mode — natural-language phrasing → cron expression. Pure Python — uses croniter for next-fire times, hand-rolled English description. Use when the user asks "what does this cron run", "explain this crontab", "next runs of X", "convert daily 9am to cron", or is debugging a scheduled task.
---


# cron-pretty

Translate cron expressions to plain English and preview the next N fire times. Reverse-mode converts common natural-language phrases back into cron expressions.

## Usage

Explain a cron expression and preview the next 5 fire times (default):

```
python3 scripts/cron.py --cron "0 9 * * 1-5"
```

Show next 10 fire times starting from a custom date:

```
python3 scripts/cron.py --cron "*/15 * * * *" --next 10 --from "2026-05-01T00:00:00"
```

Reverse mode — natural language to cron:

```
python3 scripts/cron.py --reverse --cron "every weekday at 9am"
python3 scripts/cron.py --reverse --cron "daily at 6pm"
python3 scripts/cron.py --reverse --cron "every 5 minutes"
```

## Flags

- `--cron <expr>` — cron expression (or English phrase if `--reverse`)
- `--next <N>` — number of upcoming fire times to print (default: 5)
- `--from <iso>` — ISO datetime to start counting from (default: now)
- `--reverse` — interpret `--cron` as natural language and return a cron expression
- `--json` — emit machine-readable JSON instead of pretty text

## Field reference (5-field crontab)

```
 ┌──── minute (0-59)
 │ ┌── hour (0-23)
 │ │ ┌── day of month (1-31)
 │ │ │ ┌── month (1-12)
 │ │ │ │ ┌── day of week (0-6, Sun=0)
 │ │ │ │ │
 * * * * *
```

## Notes

- Auto-installs `croniter` on first run.
- 6-field expressions (with seconds prefix) are accepted by croniter but the English description focuses on the 5-field portion.
- Reverse mode handles a fixed catalogue of common phrases. For exotic schedules, write the cron expression directly.
