cs routines
Run standing work from a terminal. A routine starts Tasks on a schedule, once at a set time, on a GitHub event or on an API call; create, change, run and read routines with cs routines.
cs routines drives Routines from a shell. A routine is
standing work: on a schedule, once at a time, on a GitHub event, or when an
API call fires it, a Task starts with the routine's prompt (or the prompt is
delivered into one Task). Every fire is a run, and a run is a
Task.
The Agents area is a preview: it may change at any time.
cs routines uses the credential cs already holds: CS_TASK_TOKEN inside
a Task's Box, else CS_API_KEY when it is set, else your
cs login session.
Usage
cs routines create --name <n> --prompt <p> | --prompt-file <file|-> [flags]
cs routines [list] [--status …] [--paused] [--search …] [--space …] [--repo …]
cs routines get | pause | resume | archive | unarchive | duplicate <id>
cs routines duplicate <id> --space <name>
cs routines update <id> [create flags but --space] [--expected-updated-at <ms>]
cs routines run <id> [--text …] [--force]
cs routines runs <id> [--state …] [--after 2026-09-01 --before …]
cs routines revisions <id>
cs routines delete <id>
cs routines trigger add <id> <trigger flags> | rm <id> <trigger-id>
cs routines trigger token <id> <trigger-id>Every command takes --json: it prints the answer as JSON instead of the
view. cs routines --help prints the usage with every flag. Enum values are
the wire's own (queue_one, latest_once) everywhere.
cs routines create --name "Nightly audit" --repo acme/web --space growth \
--prompt-file audit.md --cron "7 2 * * *" --tz Asia/Shanghai --expires 2026-12-31
cs routines run <id> --text "after the 2.3 release"
cs routines runs <id> --state failed
cs routines duplicate <id> --space everyone
cs routines pause <id>list and get
Bare cs routines lists the routines you can see as a table: one routine a
line, with its name, status, space, repository, triggers, next fire and last
run. --space keeps one space's routines, named as
cs spaces prints them. get <id> prints one routine
with its triggers.
create and update
create takes a name and a prompt (--prompt, or --prompt-file, where
- reads stdin), and prints the routine as it was saved, with its next
three fires, so you confirm the schedule rather than the cron.
- Triggers.
--cron "<5 fields>"with--tz(the zone the schedule is read in; default, yours),--windowand--catchup skip|latest_once;--at 2026-09-20T09:00once;--on-github pull_request:opened,closedwith--gh-repoand--gh-filter merged=true(repeatable); and--api-trigger. A routine may mix them. - The run. The
createflags of a Task (--repo,--branch,--engine,--model,--effort,--fast,--env) plus--time-limit 120m,--budget-tokens,--runs-per-day,--overlap skip|queue_one|allow(with--max-concurrentforallow),--keep-tasks 4h,--target task:<id>to deliver each fire into one Task (new_task, the default, starts a new Task per run),--no-continuity,--notify always|notable|failures|never,--expires 2026-12-31(through the end of that day) and--paused. - Templates.
--template <id>starts from one of the service's templates; any flag overrides what it names. - Space and subscribers. A routine is in the space
--spacenames, your own by default.--subscribers <user-id>,<user-id>names teammates who hear about its runs.
update <id> takes the same flags except --space; none clears a field
(--repo none). --expected-updated-at refuses the edit when someone
changed the routine since you read it. revisions <id> lists its earlier
versions. Changing a routine takes the level use in its space.
run and runs
run <id> starts a run now, paused or not; --text adds words to the prompt
for this run, and --force starts it while an earlier run still goes.
runs <id> lists the routine's runs, newest first: when each was made, how
it was fired, its Task and its outcome.
Triggers
trigger add <id> adds a trigger with the trigger flags of create, and
trigger rm <id> <trigger-id> removes one. trigger token <id> <trigger-id>
mints an API trigger's bearer token, shown once; it replaces any earlier
token of that trigger. A member mints it: a Task or a space API key is
refused.
pause, archive, duplicate and delete
pause stops the triggers until resume, which counts the next fire from
now. archive takes a routine out of the active list; unarchive brings it
back. duplicate <id> copies it, paused and without API tokens, in its own
space, or with --space in another. delete is permanent and takes an
archived routine; its past runs and their Tasks stay.
Errors
A failure prints Error: <message> with one of cs's
exit codes. The refusals are those of
cs tasks; … allows N routines (exit 4) means
the plan's number of routines is reached: archive one, or change the plan.
no routine <id> that you can see means the routine does not exist, or it is
in a space you are not in.