Synopsis
Description
operator cron manages the set of scheduled jobs stored in <workspace>/cron/jobs.json. When the gateway is running, it loads this file and executes each enabled job on its configured schedule. Each job sends a message to the agent loop — the agent processes it as if it were a user message and can optionally deliver the response to a messaging channel.
Jobs can be scheduled in two ways:
- Every N seconds — a simple interval trigger using
--every - Cron expression — a standard 5-field cron expression using
--cron
Cron expression format
Operator uses the gronx library, which implements standard 5-field POSIX cron syntax:| Expression | Meaning |
|---|---|
0 9 * * * | Every day at 09:00 |
0 9 * * 1 | Every Monday at 09:00 |
*/15 * * * * | Every 15 minutes |
0 8 1 * * | First day of every month at 08:00 |
0 18 * * 1-5 | Weekdays at 18:00 |
How the agent processes a cron job
When a job fires, the gateway calls the agent loop with the job’smessage as the prompt. The job runs without session history — each execution is independent. If --deliver is set, the agent’s response is sent to the specified channel and recipient.
Cron jobs only execute while
operator gateway is running. If the gateway is stopped, no jobs fire. Jobs that were missed while the gateway was offline are not replayed.Subcommands
operator cron add
Add a new scheduled job.A human-readable name for the job. Shorthand:
-n.The message (prompt) sent to the agent when the job fires. Shorthand:
-m.Repeat interval in seconds. Mutually exclusive with
--cron. Shorthand: -e.A 5-field cron expression. Mutually exclusive with
--every. Shorthand: -c.If set, the agent’s response is delivered to the specified channel. Shorthand:
-d.The channel to deliver the response to (e.g.
telegram, discord, slack). Requires --deliver.The recipient (user ID or chat ID) to deliver the response to. Requires
--deliver.operator cron list
List all scheduled jobs including disabled ones.operator cron remove
Remove a job by its ID.operator cron enable
Enable a disabled job by its ID.operator cron disable
Disable a job without removing it.Examples
Add a daily morning briefing job:The output message always says “enabled” regardless of whether you ran
enable or disable. Use operator cron list to confirm the current state of a job.Job storage
All cron jobs are persisted in a JSON file:~/.operator/workspace/cron/jobs.json
You can edit this file directly, but prefer using the operator cron subcommands to ensure the schema stays valid.
Agent-managed scheduling
In addition to CLI-managed jobs, the agent can schedule tasks itself using the built-incron tool. When you ask the agent to “remind me every morning” or “check my server logs daily at midnight”, it calls the cron tool to create a job entry on your behalf.
You can inspect and manage agent-created jobs with operator cron list and the other subcommands just like manually added jobs.
Cron execution timeout
Jobs have a configurable execution timeout. If the agent does not finish processing within the limit, the job is cancelled. Configure this inconfig.json:
Related commands
operator gateway— the gateway must be running for cron jobs to fireoperator agent— interact with the agent directly; the agent can also create cron jobs via the cron tool