Platform Support
native-scheduler supports four backends. The auto backend (default) selects the appropriate one based on the current OS.
launchd (macOS)
The primary backend. Jobs are registered as user-level LaunchAgents (~/Library/LaunchAgents/).
Features supported:
startIntervalSeconds→StartIntervalcalendar→StartCalendarInterval(array of entries)runAtLoad→RunAtLoadstdoutPath/stderrPath→StandardOutPath/StandardErrorPathenable/disablevialaunchctl bootout/launchctl bootstrap
Notes:
- Jobs use the
com.<namespace>.<jobId>naming convention for plist labels - The wrapper runner is materialized as a standalone script alongside the plist
PATH auto-resolution
launchd runs with a minimal PATH (/usr/bin:/bin:/usr/sbin:/sbin) — Homebrew, nvm, pyenv, and other user-installed tools won't be found without explicit configuration.
At upsert time, native-scheduler automatically resolves the user's login shell PATH by running $SHELL -l -c 'printf "%s" "$PATH"' and injects it into both the plist EnvironmentVariables and the wrapper runner environment. This means git, node, python3, and other Homebrew binaries work out of the box.
Override behaviour: If environment.PATH is explicitly set in the job definition, the auto-resolved PATH is skipped entirely — your value is used as-is.
Fallback: If the shell probe fails (timeout or error), the plugin falls back to a safe default that covers most macOS setups:
/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbinsystemd (Linux)
Jobs are registered as user-level systemd service + timer units.
Features supported:
startIntervalSeconds→OnUnitActiveSectimerworkingDirectory→WorkingDirectoryenvironment→Environmentdirectivesenable/disableviasystemctl --user enable/disable
Notes:
- Requires
loginctl enable-lingerfor the user to allow timers to run without an active session calendarentries are not directly mapped — usestartIntervalSecondsfor simple intervalsrunAtLoadis not supported; useOnBootSec=0in the timer if needed
cron
Fallback backend using the user's crontab.
Features supported:
startIntervalSeconds→ best-effort cron expression (rounds to nearest minute)environment→ crontabKEY=VALUElinesenable/disableby commenting/uncommenting the crontab entry
Limitations:
- Minimum interval is 60 seconds (cron granularity)
calendar,runAtLoad,stdoutPath,stderrPath,workingDirectoryare not supported- Job identification uses comment markers in the crontab
Windows Task Scheduler
Jobs are registered via schtasks.exe.
Features supported:
startIntervalSeconds→/SCschedule with/RIrepetition intervalenvironment→ set via wrapper scriptenable/disablevia/ENABLE//DISABLEflags
Limitations:
calendar,runAtLoad,stdoutPath,stderrPathare not directly mapped- Minimum interval granularity is 1 minute
Backend auto-detection
| Platform | Backend |
|---|---|
macOS (darwin) | launchd |
| Linux | systemd (falls back to cron if systemd is unavailable) |
| Windows | windows-task-scheduler |