Crates.io | ohcrab |
lib.rs | ohcrab |
version | 0.7.5 |
source | src |
created_at | 2023-10-13 13:40:51.946192 |
updated_at | 2024-05-31 12:40:16.13095 |
description | Fix your command line magically |
homepage | |
repository | https://github.com/luizvbo/oh-crab |
max_upload_size | |
id | 1002317 |
size | 1,017,461 |
ohcrab
is a port of the well known CLI tool
thefuck
to our beloved Rust language.
Currently, there are two methods of installation:
See below how to install using any of these methods.
Follow these steps to download and install the package using the pre-compiled binaries for your OS and architecture:
The binaries are available in the Assets section from the release page. Download the binary according to your system:
After downloading the binary, you need to make it executable. Use the following command:
chmod +x <BINARY_NAME>
Replace <BINARY_NAME>
with the name of your downloaded binary file.
We recommend moving the binary to the /opt directory and renaming it to
ohcrab
. Use the following command:
sudo mv <BINARY_NAME> /opt/ohcrab
Finally, create a symbolic link to the binary from a directory that's in your PATH, like /usr/local/bin. Use the following command:
sudo ln -s /opt/<BINARY_NAME> /usr/local/bin/
Now, you should be able to run your program from the terminal by typing
ohcrab
.
Proceed to adding ohcrab to your environment to finalize the installation.
For now, it is only possible to install ohcrab
through cargo
. If you don't
have cargo installed, you can install it following the instructions from
https://doc.rust-lang.org/cargo/getting-started/installation.html.
You can install ohcrab
using cargo
:
cargo install ohcrab
In order for ohcrab
to work in your terminal, you need to export the correct
function for your shell. Currently, we support bash
and zsh
. Copy and paste
the respective command to your terminal:
bash
, use:eval $(ohcrab --shell bash)
zsh
, use:eval $(ohcrab --shell zsh)
NOTE: In order to load ohcrab
every time you open a terminal, add the
eval
command above to your .bash_profile, .bashrc, .zshrc or other startup
script.
The commands above use the default alias (crab
) to call ohcrab
from your
terminal. Feel free to use your own alias by passing --alias NEW_ALIAS
to use
your NEW_ALIAS
instead. For example, in case you want to use shinycrab
as
your alias in zsh
, use
eval $(ohcrab --shell zsh --alias shinycrab)
In the terminal, after typing the wrong command, type crab
(or the alias you
chose in during the Exporting ohcrab
step). It will show
a menu to choose the correct command from.
If you like ohcrab
and/or want to learn rust
, you can contribute by adding
new rules or improving the crate.
sudo
supportohcrab
shell
function is generated.