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.0.0
Version published
Weekly downloads
278
67.47%
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 [options] <interval> <command>

Basic examples

loop 30m npm test
loop 1h opencode --prompt '/ob-init'
loop 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
--immediateRun 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 opencode --prompt "search for missing translation text and translate them, 3 maximum" --model "opencode/big-pickle"

Run tests every 30 minutes

loop 30m npm test

Run immediately, then every hour

loop --immediate 1h npm test

Run up to 5 times then stop

loop --max-runs 5 5m npm test

Verbose mode

loop --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

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts