# Pay Respects
Typed a wrong command or don't know what to do? Pay Respects will suggest a fix to your console command by simply pressing `F`!
- đ **Blazing fast suggestion**: You won't notice any delay for asking suggestions!
- đ¯ **Accurate results**: Suggestions are verified before being prompted to the user, no `sudo` suggestions when you are using `doas`!
- âī¸ **Easy to write rules**: You don't need to know Rust. The rules are written in a TOML file!
- đŠ **Modular**: TOML not your taste? Add sources using your favorite language with a custom module!
- đ¤ **AI Support**: AI module comes in aid when there is no rule for your error!
- đĒļ **Tiny binary size**: Not even 1MB for core features!

## How to Pay Respects
Please follow the instruction for your shell:
Bash / Zsh / Fish
> Append the following line to your configuration file:
> ```shell
> eval "$(pay-respects bash --alias)"
> eval "$(pay-respects zsh --alias)"
> pay-respects fish --alias | source
> ```
> Arguments:
> - `--alias [alias]`: Alias to a custom key, defaults to `f`
> - `--nocnf`: Disables `command_not_found` handler
> Manual aliasing (**DEPRECATED**, do not use):
> ```shell
> alias f="$(pay-respects bash)"
> alias f="$(pay-respects zsh)"
> alias f="$(pay-respects fish)"
> ```
Nushell
> Add the following output to your configuration file:
> ```shell
> pay-respects nushell --alias [PowerShell
> Append the following to your profile:
> ```pwsh
> pay-respects pwsh --alias [Custom initialization for arbitrary shell
> pay-respects only requires 2 environment variables to function:
>
> - `_PR_SHELL`: The binary name of the current working shell.
> - `_PR_LAST_COMMAND`: The last command.
>
> pay-respects echos back, if applicable, a `cd` command that can be evaluated by the current working shell.
> General example:
> ```shell
> eval $(_PR_SHELL=sh _PR_LAST_COMMAND="git comit" pay-respects)
> ```
Environment variable configurations
> - `_PR_LIB`: Directory of modules, analogous to `PATH`. If not provided, search in `PATH` or compile-time provided value.
> - `_PR_PACKAGE_MANAGER`: Use defined package manager instead of auto-detecting alphabetically
Instructions for package managers
> | OS / Distribution | Repository | Instructions |
> |-------------------|-----------------|----------------------------------|
> | Arch Linux | [AUR] | `paru -S pay-respects` (`-bin`) |
> | Arch Linux | [Arch Linux CN] | `sudo pacman -S pay-respects` |
> | NixOS / *Any* | [nixpkgs] | `nix-env -iA nixos.pay-respects` |
[AUR]: https://aur.archlinux.org/
[Arch Linux CN]: https://github.com/archlinuxcn/repo
[nixpkgs]: https://github.com/NixOS/nixpkgs
Cargo / Compile from source (any OS/architecture supported by Rust)
> This installation requires you to have Cargo (the Rust package manager) installed.
> Install from [crates.io](https://crates.io/), modules are optional
> ```shell
> cargo install pay-respects
> cargo install pay-respects-module-runtime-rules
> cargo install pay-respects-module-request-ai
> ```
> Clone from git and install, suitable for adding custom compile-time rules:
> ```
> git clone --depth 1 https://github.com/iffse/pay-respects
> cd pay-respects
> cargo install --path core
> cargo install --path module-runtime-rules
> cargo install --path module-request-ai
> ```