A CLI tool to repeat commands with a delay
- Rust 81.3%
- Just 18.7%
repeat-cli
A CLI tool to repeatedly run a command with a delay between executions.
Installation
cargo install repeat-cli
Usage
repeat [OPTIONS] -- <COMMAND>...
Options
| Option | Environment Variable | Description |
|---|---|---|
--delay-secs <N> |
REPEAT_DELAY_SECS |
Delay in seconds (stacks with --delay-mins) |
--delay-mins <N> |
REPEAT_DELAY_MINS |
Delay in minutes (stacks with --delay-secs) |
--until-success |
UNTIL_SUCCESS |
Stop when command exits 0 |
--until-failure |
UNTIL_FAILURE |
Stop when command exits non-zero |
--until-exit-code <N> |
UNTIL_EXIT_CODE |
Stop when command exits with specific code |
--count <N> |
Maximum iterations | |
--no-countdown |
NO_COUNTDOWN |
Hide countdown display |
--no-progress |
NO_PROGRESS |
Hide progress bar |
Default delay is 30 seconds if not specified.
Examples
# Run a health check every minute until it succeeds
repeat --delay-mins 1 --until-success -- curl -f http://localhost:8080/health
# Run a flaky test 10 times with 5 second delay
repeat --delay-secs 5 --count 10 -- cargo test
# Poll until a process exits
repeat --delay-secs 2 --until-failure -- pgrep myprocess
Press Ctrl+C to stop early.
License
MIT