Skip to Content
tloop

Overview

Run shell commands on a schedule on your Mac, through launchd.

tloop runs a shell command on a schedule on macOS. You give it a command and an interval, and it writes a launchd job for it. launchd is the scheduler built into macOS, so your tasks keep running after a restart, and every run writes its own log file.

tloop has no background process of its own. launchd starts each run, and your shell runs the command.

Quick start

You need macOS, Bun to run tloop, and Node 24 with pnpm to install it. tloop isn't on npm yet, so install it from source:

git clone https://github.com/zakiego/tloop && cd tloop
pnpm install
bun link

bun link adds the tloop command to Bun's global bin folder. Now add a task that checks free disk space every 15 minutes:

tloop add --name disk-check --cmd "df -h /" --interval 15m
✓ Task added and started
  ID:       k3x9qa
  Name:     disk-check
  Interval: every 15min
  Cmd:      df -h /

Your ID will be different: it's six random letters and digits, and every other command takes it. The task runs once right away, so its first log is already there:

tloop logs k3x9qa

Next

  • Commands: every command and its flags.
  • Schedules: intervals, and keeping a task inside certain hours.
  • Logs: what each run writes and where.
  • How it works: the files tloop writes and what launchd does with them.
  • Troubleshooting: a task that doesn't run or can't find a command.

On this page