Show HN: pay-respects – RIP command errors and keep yourself in the flow

github.com

2 points by iffse 17 hours ago

`pay-respects` is a command-line utility written in Rust that tries to fix the previous command, by simply pressing `F`. (From the meme "Press F to pay respects").

Don't let Rust scares you. You don't even need to know how to code in order to add a new rule for suggesting fixes. Even with zero-compromises to performance, as they can be evaluated to Rust code during compilation.

Rules can be added at runtime if you don't want to recompile. The entire system is even modular, allowing to write rules in any languages that are most comfortable to you.

You can still get potential fixes even when there is no rule for the specific case you are facing thanks to the AI integration (API key included so you can try it out of the box).

The project started long ago when in a group chat people complained about the speed of `thefuck` (myself included). Although `thefuck` is the very first pioneer for tools like this, it's very slow (slower than typing `sudo !!`) and creates weird suggestions lately, making it completely useless.

At the end of that day, I ended up with a prototype with procedural macros to generate rules from a TOML file. I took this approach as I don't want to compromise performance, nor I want to make it hard to contribute because Rust is "hard" and takes time to write the code due to its verbose nature.

Less than a week, the project is basically done, supporting all major shells and solves all situations that I used to run into. It worked so well that there wasn't a single commit or bug report for more than a year.

You might ask why I am promoting this project now. Apparently `thefuck` stopped working some months ago with new Python versions and no maintainer is working to fix it. Many people who searched for an alternative have reached to my project. The tool itself works well, and people asked me to package into the distribution they use. That is not easy for me, as I don't have access to their upstream, nor I have the social network to contact respective package maintainers.

At the time of writing, `pay-respects` is not the first project that tries to substitute `thefuck`, nor the last one. But rather a unique one that stands out from all others because the approach is different from the ground up. (To be honest, I didn't even bother to study other projects before creating the project. There were only "speed" and "ease" in my mind).