repeat-cli-command
v1.2.0
Published
A simple CLI tool to run any command multiple times
Readme
Installation
Install the following package:
npm install -D repeat-cli-commandHow to run
npx repeat-cli-command "<command>" [--times=<number>] [--stop-on-error]Options
| Option | Description | Default |
|---|---|---|
| --times=<number> | Number of times to run the command | 1 |
| --stop-on-error | Stop execution on the first failure | false |
| --help, -h | Show help message | - |
Examples
# Run Playwright tests 5 times
npx repeat-cli-command "npx playwright test" --times=5
# Run and stop immediately on the first failure
npx repeat-cli-command "npx playwright test" --times=5 --stop-on-errorNote: If
--timesis omitted, the command runs once. If any execution fails, the process exits with a non-zero exit code — making it safe to use in CI pipelines.
Contributions
Feel free to open a pull request or drop any feature request or bug in the issues.
Please see more details in the contributing doc.
