Docs/Automation

Cron jobs

Schedule recurring prompts for your AI agent and let the gateway run them unattended on a cron schedule.

Source: crates/gray/src/cron

A cron job is a stored prompt with a schedule, kept in ~/.gray/cron/jobs.json. The agent can create them itself by running gray cron add through bash. Jobs fire when something ticks the store: the gateway daemon, gray cron serve, a gray cron tick host (system cron or a systemd timer), or an open REPL. A slow run never overlaps its own next trigger.

bash
$gray cron add "0 9 * * *" "summarize yesterday's commits" --in ~/code/app
$gray cron add "every 30m" "check the deploy" --name deploy-watch
$gray cron add "in 10m" "remind me to stretch"
$gray cron list
$gray cron run deploy-watch # fire now
$gray cron pause deploy-watch # resume to undo
$gray cron remove deploy-watch

Schedules accept a one-shot ("in 10m" or an RFC 3339 timestamp), an interval ("every 1h", "30m"), or a 5-field cron expression in local time. The shortest honored period is 60 seconds.

gray cron add

FlagMeaning
--namejob name (default: the prompt's first line)
--in DIRabsolute working directory the job runs in
--skills a,bskills to attach; must resolve at fire time
--script PATHpre-run script whose stdout is injected into the prompt
--deliver local|originsave the result to a file, or also append it to --origin-session

Running the ticker

bash
$gray cron serve # tick every 60 s until stopped
$gray cron tick # one pass — point system cron at this
$/cron # dashboard in the REPL; space pauses a job

Join the Discord

Chat with the people building and running Gray. Show what you made with it.

Join Discord →

Need help?

Open an issue on GitHub, run /feedback from the REPL, or ask in Discord.

Open an issue →