cron
Original:🇺🇸 English
Translated
Create and manage Codex app automations stored in the local SQLite database (~/.codex/sqlite/codex-dev.db). Use when you need to add, list, update, enable/disable, delete, or run-now automations; edit automation names, prompts, RRULE schedules, or cwd scopes; or inspect automation records while troubleshooting app automation behavior.
2installs
Sourcetkersey/dotfiles
Added on
NPX Install
npx skill4agent add tkersey/dotfiles cronTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Cron
Overview
Use this skill to manage Codex automations through the native Zig CLI. Runtime paths are Zig-only (no Python fallback, no shell launchd wrappers).
cronZig CLI Iteration Repos
When iterating on , use these two repos:
cron- (
skills-zig): source for the/Users/tk/workspace/tk/skills-zigbinary, build/test wiring, release tags.cron - (
homebrew-tap): formula/checksum updates for released binaries./Users/tk/workspace/tk/homebrew-tap
Quick Start
bash
run_cron_tool() {
install_cron_direct() {
local repo="${SKILLS_ZIG_REPO:-$HOME/workspace/tk/skills-zig}"
if ! command -v zig >/dev/null 2>&1; then
echo "zig not found. Install Zig from https://ziglang.org/download/ and retry." >&2
return 1
fi
if [ ! -d "$repo" ]; then
echo "skills-zig repo not found at $repo." >&2
echo "clone it with: git clone https://github.com/tkersey/skills-zig \"$repo\"" >&2
return 1
fi
if ! (cd "$repo" && zig build build-cron -Doptimize=ReleaseFast); then
echo "direct Zig build failed in $repo." >&2
return 1
fi
if [ ! -x "$repo/zig-out/bin/cron" ]; then
echo "direct Zig build did not produce $repo/zig-out/bin/cron." >&2
return 1
fi
mkdir -p "$HOME/.local/bin"
install -m 0755 "$repo/zig-out/bin/cron" "$HOME/.local/bin/cron"
}
local os="$(uname -s)"
if command -v cron >/dev/null 2>&1 && cron --help 2>&1 | grep -q "cron.zig"; then
cron "$@"
return
fi
if [ "$os" = "Darwin" ]; then
if ! command -v brew >/dev/null 2>&1; then
echo "homebrew is required on macOS: https://brew.sh/" >&2
return 1
fi
if ! brew install tkersey/tap/cron; then
echo "brew install tkersey/tap/cron failed." >&2
return 1
fi
elif ! (command -v cron >/dev/null 2>&1 && cron --help 2>&1 | grep -q "cron.zig"); then
if ! install_cron_direct; then
return 1
fi
fi
if command -v cron >/dev/null 2>&1 && cron --help 2>&1 | grep -q "cron.zig"; then
cron "$@"
return
fi
echo "cron binary missing or incompatible after install attempt." >&2
if [ "$os" = "Darwin" ]; then
echo "expected install path: brew install tkersey/tap/cron" >&2
else
echo "expected direct path: SKILLS_ZIG_REPO=<skills-zig-path> zig build build-cron -Doptimize=ReleaseFast" >&2
fi
return 1
}- List automations:
run_cron_tool list - Show one automation:
run_cron_tool show --id <id> - Create an automation:
run_cron_tool create --name "Weekly release notes" --prompt-file /path/to/prompt.md --rrule "RRULE:FREQ=WEEKLY;BYDAY=FR;BYHOUR=9;BYMINUTE=0" - Update an automation:
run_cron_tool update --id <id> --rrule "RRULE:FREQ=DAILY;BYHOUR=9;BYMINUTE=0" - Enable or disable: or
run_cron_tool enable --id <id>run_cron_tool disable --id <id> - Run immediately:
run_cron_tool run-now --id <id> - Delete:
run_cron_tool delete --id <id> - Run due automations once:
run_cron_tool run-due - Run due automations dry-run:
run_cron_tool run-due --dry-run - Install/start launchd scheduler (macOS):
run_cron_tool scheduler install - Stop/remove launchd scheduler (macOS):
run_cron_tool scheduler uninstall - Show scheduler status (macOS):
run_cron_tool scheduler status
Runtime bootstrap policy mirrors //: require the Zig binary, default to Homebrew install on macOS, and fallback to direct Zig install from on non-macOS.
seqcasliftskills-zigSubcommand prints top-level usage. For detailed options, use the matrix below.
--helpWorkflow
- Choose working directories (). Default is current repo if omitted on
cwds.create - Write the automation prompt (use for multi-line prompts).
--prompt-file - Provide an RFC5545 RRULE string.
- Create or update with .
cron - For unattended execution, install scheduler via .
cron scheduler install
Headless Runner
- executes due automations by calling
cron run-dueand updates:codex execautomations.last_run_atautomations.next_run_at- rows
automation_runs
- is read-only:
cron run-due --dry-run- no rows are inserted/updated
automation_runs - no /
automations.last_run_atupdatesnext_run_at - no automation files or writes
memory.md
- no
- accepts executable name or absolute path (default resolves
--codex-binor$CODEX_BINincodex).PATH - Locking is label-scoped and fail-closed (, or env
--lock-label).CRON_LAUNCHD_LABEL - uses strict label validation: only
--lock-label(no slashes/spaces).[A-Za-z0-9._-] - default batch limit is
run-dueautomations per invocation (10overrides).--limit - Scheduler commands are macOS-only and manage directly from Zig.
~/Library/LaunchAgents/<label>.plist - Launchd scheduler runs with default DB path and default limit unless you invoke
run-duemanually with overrides.cron - Logs: and
~/Library/Logs/codex-automation-runner/out.log.~/Library/Logs/codex-automation-runner/err.log
Command Options (High Signal)
- :
list,--status <ACTIVE|PAUSED>--json - :
showor--id <id>, optional--name <name>--json - :
create,--name,--prompt|--prompt-file, optional--rrule,--status(repeatable),--cwd,--cwds-json,--clear-cwds--next-run-at - :
update, optional--id|--name,--new-name,--prompt|--prompt-file,--rrule,--status(repeatable),--cwd,--cwds-json,--clear-cwds,--next-run-at--clear-next-run-at - :
enable|disable|run-now|deleteor--id--name - : optional
run-due,--id,--limit,--dry-run,--codex-bin(--lock-labelonly)[A-Za-z0-9._-] - : optional
scheduler install,--label,--interval-seconds,--path--codex-bin - : optional
scheduler uninstall|status--label - Scheduler is strict: only
--label(no slashes/spaces).[A-Za-z0-9._-]
Clarify When Ambiguous
Ask questions only when the request is ambiguous or when the user explicitly asks for guidance. Do not block otherwise.
Essential elements to confirm or infer:
- Automation name.
- Prompt content (single line or file path).
- Schedule as an RFC5545 RRULE string (include prefix).
RRULE: - Working directories (), default to current repo if not specified.
cwds - Status if explicitly requested; otherwise default to .
ACTIVE
When ambiguous, ask for missing details. Examples:
- If user says “daily”/“weekly” without time, ask for required time/day fields.
- If user says “run it for this repo” without paths, confirm repo root as .
cwd
Schedule (RRULE)
- Accept only RFC5545 RRULE strings. Cron expressions are unsupported.
- Rules are canonicalized to -prefixed form.
RRULE: - Legacy non-prefixed stored values () are still accepted at run time for compatibility.
FREQ=... - Validation is fail-closed.
- /
BYHOURare interpreted in UTC.BYMINUTE - Supported frequencies:
- requires
HOURLYBYMINUTE - requires
DAILYandBYHOURBYMINUTE - requires
WEEKLY,BYDAY, andBYHOURBYMINUTE
Example rules:
- Daily at 09:00:
RRULE:FREQ=DAILY;BYHOUR=9;BYMINUTE=0 - Weekly on Friday at 09:00:
RRULE:FREQ=WEEKLY;BYDAY=FR;BYHOUR=9;BYMINUTE=0 - Every 24 hours:
RRULE:FREQ=HOURLY;INTERVAL=24;BYMINUTE=0
Task Examples
Daily standup summary
Name:
Prompt: Summarize yesterday's git activity for standup. Include notable commits, files touched, and any risks or follow-ups.
Schedule:
Summarize yesterday's git activityRRULE:FREQ=DAILY;BYHOUR=9;BYMINUTE=0Weekly release notes
Name:
Prompt: Draft weekly release notes from merged PRs. Include links when available and group by area.
Schedule:
Draft weekly release notesRRULE:FREQ=WEEKLY;BYDAY=FR;BYHOUR=9;BYMINUTE=0CI failure triage
Name:
Prompt: Summarize CI failures and flaky tests from the last CI window, group by root cause, and suggest minimal fixes.
Schedule:
Summarize CI failuresRRULE:FREQ=DAILY;BYHOUR=8;BYMINUTE=30Data Model Reference
See for schema and field notes.
references/db.md