Sign In

loop-task

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loop-task

A cross-platform CLI that repeatedly executes a shell command at a human-readable interval

Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
99
-62.36%
Maintainers
1
Weekly downloads
 
Created
Source

loop-task

A cross-platform CLI that repeatedly executes a shell command at a human-readable interval.

Inspired by agent loops, but intentionally simple.

Installation

npm install -g loop-task

Or use directly with npx:

npx loop-task 30m npm test

Usage

loop-task [options] <interval> <command>

Basic examples

loop-task 30m npm test
loop-task 1h opencode --prompt '/ob-init'
loop-task 1d node sync.js

With npx

npx loop-task 30m npm test
npx loop-task 1h opencode --prompt '/ob-init'

Options

Options must come before the interval:

OptionDescription
--nowRun immediately before waiting
--max-runs <n>Stop after N executions
--verboseShow execution details
-h, --helpDisplay help
-V, --versionDisplay version

Examples

Agent workflows

npx loop-task 30m --now -- opencode run "search for missing translation text and translate them, 3 maximum" --model "opencode/big-pickle"

Run tests every 30 minutes

loop-task 30m npm test

Run immediately, then every hour

loop-task --now 1h npm test

Run up to 5 times then stop

loop-task --max-runs 5 5m npm test

Verbose mode

loop-task --verbose 30m npm test

Shows start/end timestamps, exit code, execution duration, and next scheduled run.

Supported intervals

FormatDescription
10s10 seconds
5m5 minutes
1h1 hour
1d1 day
1w1 week

Behavior

  • No overlapping: waits for the command to finish before starting the next interval
  • Resilient: continues looping even if a command exits with a non-zero code
  • Graceful shutdown: finishes current execution on Ctrl+C, then exits cleanly

Development

pnpm install
pnpm run build
pnpm run test
pnpm run lint

License

MIT

Keywords

cli

FAQs

Package last updated on 10 Jun 2026

Related posts