A simple CLI utility to run shell commands with automatic retries on failure.
Project description
retry-cli
A utility to run a shell command a set number of times with automatic retries on failure.
Mainly created as having tools such as pre-commit, format, etc fail once then pass the second time is (to me!) quite annoying. Often they'll fail once, then pass the second time.
Example usage:
uvx --from retry-cli retry --command "pre-commit run --all-files"
Usage
usage: retry [-h] --command COMMAND [--retries RETRIES] [--show-first] [--success-code SUCCESS_CODE]
Run shell command with automatic retries on failure.
Usage Examples:
retry --retries 4 --show-first --command "pre-commit run --all-files"
Useful for auto-formatters and tools like pre-commit, which might fail one or
more times but ultimately pass.
options:
-h, --help show this help message and exit
--command COMMAND The command string to execute.
--retries RETRIES Number of retries after the first attempt (default: 2).
--show-first Show output of the first attempt (default: hidden).
--success-code SUCCESS_CODE
The exit code that indicates success (default: 0).
Installation
Given this is a simple CLI tool it's recommended to use pipx / uvx to run with.
uvx
# PyPI
uvx --from retry-cli retry --command "pre-commit run --all-files"
# GitHub
uvx --from git+https://github.com/geo7/retry-cli.git retry --command "..."
Development
make init # setup project
make test # run tests
make blast # run linting
Release
Manual release process, merge feature into main then:
Run release script:
make release VERSION=0.1.0
Push commit:
git push origin main v0.1.0
Which will trigger GitHub Release workflow.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file retry_cli-0.1.3.tar.gz.
File metadata
- Download URL: retry_cli-0.1.3.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c3411689a91a20179a69dbd6fb38922f09066717fba385ea0a46bfa53375b3b
|
|
| MD5 |
69df25d6606ad1936c0db9b465498784
|
|
| BLAKE2b-256 |
1eacd1da72fcb5742205bd3e2b483f38893d0c858a6bd888ff5a760b4edaa745
|
Provenance
The following attestation bundles were made for retry_cli-0.1.3.tar.gz:
Publisher:
release.yml on geo7/retry-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
retry_cli-0.1.3.tar.gz -
Subject digest:
7c3411689a91a20179a69dbd6fb38922f09066717fba385ea0a46bfa53375b3b - Sigstore transparency entry: 1320772416
- Sigstore integration time:
-
Permalink:
geo7/retry-cli@6d1c5d343cd21aebb355336c0707ded7abee7cad -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/geo7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6d1c5d343cd21aebb355336c0707ded7abee7cad -
Trigger Event:
push
-
Statement type:
File details
Details for the file retry_cli-0.1.3-py3-none-any.whl.
File metadata
- Download URL: retry_cli-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00ea734dffa031888b37846dcdd3438dce95390b61c4a4b25039d0074c0cfb4b
|
|
| MD5 |
b85a86c8d463b1c22a80aba259513e05
|
|
| BLAKE2b-256 |
a781213d256f68aa8421aa0d93a5c9a95018db676a013adefa323fc019a4ccab
|
Provenance
The following attestation bundles were made for retry_cli-0.1.3-py3-none-any.whl:
Publisher:
release.yml on geo7/retry-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
retry_cli-0.1.3-py3-none-any.whl -
Subject digest:
00ea734dffa031888b37846dcdd3438dce95390b61c4a4b25039d0074c0cfb4b - Sigstore transparency entry: 1320772526
- Sigstore integration time:
-
Permalink:
geo7/retry-cli@6d1c5d343cd21aebb355336c0707ded7abee7cad -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/geo7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6d1c5d343cd21aebb355336c0707ded7abee7cad -
Trigger Event:
push
-
Statement type: