Schedule recurring tasks using cron expressions, routing events to scoops as licks
Synopsis
crontask <command> [options]
Description
crontask creates, lists, and deletes scheduled tasks within SLICC. Each cron task fires on a standard cron schedule. When a task fires, it dispatches a lick event to the specified scoop. An optional JavaScript filter function can run on each tick to decide whether to dispatch (return false to skip, true to run, or an object to use as the event payload).
In extension mode, cron tasks are managed through the LickManager (or a proxy to the offscreen document). In standalone/CLI mode, they are managed via the /api/crontasks REST API.
Commands
create [options] Create a new cron task
list List all active cron tasks
delete <id> Delete a cron task by ID
kill <id> Alias for delete
Options
--name <name> Name for the cron task (required)
--scoop <name> Route cron events to this scoop (scoop receives events as licks)
--cron <expr> Cron expression: "min hour day month weekday" (required)
--filter <code> JS filter function: () => false (skip), true (run), or object (payload). Called on each tick to decide whether to dispatch
-h, --help Show help message
Cron Expression
┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-6, Sun=0)
│ │ │ │ │
* * * * *
Special characters: * (any), - (range), , (list), / (step)
Examples
$ crontask create --name hourly-check --scoop monitor --cron "0 * * * *"
Create a task that fires every hour and sends events to the "monitor" scoop.
$ crontask create --name workday-9am --scoop alerts --cron "0 9 * * 1-5"
Create a task that fires at 9 AM on weekdays, routing to the "alerts" scoop.
$ crontask create --name every-5min --scoop poller --cron "*/5 * * * *" --filter "() => ({ time: Date.now() })"
Fire every 5 minutes with a filter that provides a timestamp payload.
$ crontask list
List all active cron tasks with their IDs, schedules, and next run times.
$ crontask delete abc123
Delete the cron task with ID "abc123".
Notes
This command has no native Unix equivalent — it is a SLICC-specific mechanism for scheduling recurring lick events to scoops. The --filter option is not supported in extension mode due to Content Security Policy restrictions that block dynamic code evaluation. Both --name and --cron are required when creating a task.
See Also
webhook