Scheduling local AI jobs on your own machine turns a clever prompt into a durable system. This tutorial walks straight through the working pattern: jobs as directories, launchd as the scheduler, and tiny scripts you can actually evolve.
You will build the manager, ship a real AI job, wire up reactive WatchPaths workflows, and then choose the dashboard surface that fits how you work.
Lesson outline
- Your First Job — Init the project, create your first job, see it register with launchd.
- Anatomy of a Job — What's inside a job directory — the schedule file and the run script.
- Parse a Schedule File — Read a schedule file, handle all three types, write tests.
- Generate a Plist — Turn a JobDefinition into valid plist XML that launchd can consume.
- Register with launchd — installJob: write the plist, bootout the old, bootstrap the new, enable it.
- Declarative Sync — syncAllJobs: discover desired state, diff against installed, converge.
- Your First AI Job — A job that calls an LLM to do real work. Choose your provider.
- WatchPaths: Reactive AI — A job triggered by filesystem changes. Drop a file, AI processes it.
- Logs, Errors, and Debugging — Where logs go, what to do when jobs fail, how to diagnose.
- Hardening — Idempotent sync, error recovery, safe-to-repeat patterns.
- Dashboard — See your jobs at a glance. Choose how you want to see them.