{"by":"maxbond","descendants":19,"id":45176401,"kids":[45176982,45179414,45176937,45177690,45178596,45180756,45176820,45176623],"score":73,"text":"Hi HN,<p>Here&#x27;s a tool I wrote for retrying fallible commands. Nothing groundbreaking here, this is a tool that&#x27;s been made many times (and several have been submitted to Show HN). Though this one does have a more comprehensive feature set than most. I hope one or two people will find it useful.<p>I wrote `attempt` for two reasons:<p>- To have a more featureful alternative to `wait-for-it.sh` for use in Docker Compose. Specifically to apply migration scripts to a database that may not be up yet. I wanted to be able to inspect the error messages from my migration tool &amp; retry on connection errors.<p>- To test a hypothesis I had that a good way to make a CLI was to copy the API of a good library (in this case, `tenacity`). I want to write a blog post at some point to discuss this at length, but the tl;dr is that I believe it was a success.<p>Here are some usage examples: <a href=\"https:&#x2F;&#x2F;maxbondabe.github.io&#x2F;attempt&#x2F;usage.html\" rel=\"nofollow\">https:&#x2F;&#x2F;maxbondabe.github.io&#x2F;attempt&#x2F;usage.html</a><p>There may not be much to discuss for such a small tool, but I am open to all feedback and am happy to answer any questions.<p>Cheers,<p>Max","time":1757381848,"title":"Show HN: Attempt – A CLI for retrying fallible commands","type":"story","url":"https://github.com/MaxBondABE/attempt"}