Tutorial2026-03-13

Scheduled Local AI Jobs on macOS with launchd

Build a local-first AI job scheduler on macOS using launchd, from sync and plists to AI jobs, WatchPaths, and dashboards.

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

  1. Your First Job — Init the project, create your first job, see it register with launchd.
  2. Anatomy of a Job — What's inside a job directory — the schedule file and the run script.
  3. Parse a Schedule File — Read a schedule file, handle all three types, write tests.
  4. Generate a Plist — Turn a JobDefinition into valid plist XML that launchd can consume.
  5. Register with launchd — installJob: write the plist, bootout the old, bootstrap the new, enable it.
  6. Declarative Sync — syncAllJobs: discover desired state, diff against installed, converge.
  7. Your First AI Job — A job that calls an LLM to do real work. Choose your provider.
  8. WatchPaths: Reactive AI — A job triggered by filesystem changes. Drop a file, AI processes it.
  9. Logs, Errors, and Debugging — Where logs go, what to do when jobs fail, how to diagnose.
  10. Hardening — Idempotent sync, error recovery, safe-to-repeat patterns.
  11. Dashboard — See your jobs at a glance. Choose how you want to see them.

Lesson sequence

Build it step by step

  1. 4 branches
  2. 3 branches
  3. Lesson 10

    Hardening

  4. Lesson 11

    Dashboard

    5 branches

Companions

Bring the skill along

  • launchd-ai-scheduler

    Build a local-first AI job scheduler on macOS using launchd. This skill guides you through 11 lessons, adapting to your choices. Say "teach me" to start, or ask any question about the project.

    companion/SKILL.md