-
Notifications
You must be signed in to change notification settings - Fork 0
Key Features
Beyond basic scheduling, anvil gives you several knobs to turn.
Lower number = higher priority. Task p0 runs before p1, p1 before p2, etc.
anvil add -p 0 -s "*/5 * * * *" "Critical: alert if errors exceed threshold"
anvil add -p 5 -s "0 9 * * 1" "Weekly: audit dependencies"Automatically retry failed tasks with exponential backoff:
---
schedule: "*/30 * * * *"
retry: 3
retry_delay: 2m
---Retries at 2m, 4m, 8m intervals.
Skip the LLM call when there is nothing to do:
---
schedule: "*/30 * * * *"
pre_check: "gh issue list --state open --label untriaged | grep -q ."
---
Triage untriaged GitHub issuesThe task only runs if the pre-check exits successfully.
Run shell commands after success or failure:
---
schedule: "*/30 * * * *"
on_success: "echo 'done' >> /tmp/anvil.log"
on_failure: "curl -X POST https://slack.example.com/webhook -d '{\"text\":\"Task failed\"}'"
---Pre-approve specific tools:
allowed_tools:
- Bash(gh:*) # only gh subcommands
- Read
- WriteOr skip all permission prompts:
skip_permissions: trueLink tasks together with depends_on:
---
schedule: "0 * * * *"
depends_on:
- fetch-data
---
# Runs after fetch-data completesRun anvil task pipeline to visualize dependencies.
Monitor and control task dispatch delays:
---
schedule: "*/30 * * * *"
sla:
max_delay: 5m
strict: true
on_sla_violation: "echo 'SLA missed'"
---With strict: true, the task is skipped if it would miss the SLA window.
Restrict tasks to specific times:
---
schedule: "*/30 * * * *"
allowed_window:
start: "09:00"
end: "18:00"
days: "1-5"
---Only runs during business hours on weekdays.
Persist state between runs:
---
schedule: "*/30 * * * *"
checkpoint: true
---Emit checkpoint data during execution:
##anvil:checkpoint {"last_processed_id": 42}
On the next run, the daemon injects this as ANVIL_CHECKPOINT_DATA.
Organize tasks with labels:
---
schedule: "*/30 * * * *"
labels:
- triage
- github
---Filter with anvil task ls --label triage.
Pause non-critical tasks during certain hours:
quiet_hours:
enabled: true
start: "22:00"
end: "07:00"
exclude_priority: 0Only p0 tasks run during quiet hours by default.
Get notified for task events:
webhooks:
slack:
url: "https://hooks.slack.com/services/xxx"
events: ["success", "failure", "start", "timeout"]Native notifications for task events:
notifications:
enabled: true
on_failure: true
on_success: falseWorks on macOS, Linux, and Windows.