1
0
Fork
You've already forked pay-respects
0
forked from iff/pay-respects
Command suggestions, command-not-found and thefuck replacement written in Rust
  • Rust 85.1%
  • Shell 11.8%
  • PowerShell 1.2%
  • Nix 1.1%
  • Makefile 0.5%
  • Other 0.2%
2026年03月25日 20:47:53 +01:00
.github deps: update 2026年02月03日 15:18:11 +01:00
core fix: add -NoProfile for PowerShell shell invocations (github #120 ) 2026年03月25日 20:47:53 +01:00
module-request-ai v0.7.12, yanking 0.7.11 2026年02月08日 02:49:46 +01:00
module-runtime-rules fix: keep regex cases 2026年03月03日 01:01:23 +01:00
parser fix: keep regex cases 2026年03月03日 01:01:23 +01:00
rules rules(jj): allow automatic shell syntax conversion 2026年03月03日 01:07:29 +01:00
tests rules: use short arguments for Mac compatibility 2025年05月22日 11:35:15 +02:00
utils fix: add backticks when splitting 2026年03月03日 14:51:12 +01:00
.editorconfig chore: add editorconfig 2025年04月17日 19:43:48 +02:00
.gitignore flake.nix: fix build and make the derivation more maintainable (github #21 ) 2024年12月18日 08:51:48 +01:00
.rustfmt.toml init 2023年07月30日 18:40:18 +02:00
Cargo.lock chore(deps): bump the cargo group across 1 directory with 2 updates (github #119 ) 2026年03月21日 23:15:18 +01:00
Cargo.toml chore: specify "core" as default workspace member (github #29 ) 2025年01月18日 15:46:39 +01:00
CHANGELOG.md v0.7.12, yanking 0.7.11 2026年02月08日 02:49:46 +01:00
config.md docs: layered configuration 2026年02月07日 18:17:37 +01:00
Cross.toml CI: disable icnremental build in cross 2024年12月10日 20:42:36 +01:00
flake.lock build(flake): update nixpkgs input (github #107 ) 2026年02月04日 11:40:29 +01:00
flake.nix build(flake): update nixpkgs input (github #107 ) 2026年02月04日 11:40:29 +01:00
init.fish feat: plugin files for zsh and fish (github #58 ) 2025年06月11日 11:02:20 +02:00
install.sh fix: install.sh in busybox 2025年07月30日 17:50:25 +02:00
LICENSE doc: appending the full license notice 2023年08月09日 00:14:54 +02:00
Makefile chore: update makefile 2025年04月22日 13:57:07 +02:00
modules.md chore: some quality of life changes 2025年04月06日 20:13:18 +02:00
pay-respects.plugin.zsh feat: plugin files for zsh and fish (github #58 ) 2025年06月11日 11:02:20 +02:00
README.md docs: AI disclaimer 2026年02月07日 18:43:39 +01:00
roadmap.md docs: update 2025年04月22日 14:54:02 +02:00
rules.md build: automatically detect rule changes 2026年03月03日 17:22:58 +01:00

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!

showcase

How to Pay Respects

Please follow the instruction for your shell:

Bash / Zsh / Fish

Append the following line to your configuration file (--alias no longer required for v0.7+):

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 (REMOVED after v0.7):

alias f="$(pay-respects bash)"
alias f="$(pay-respects zsh)"
alias f="$(pay-respects fish)"
Nushell

Add the following output to your configuration file:

pay-respects nushell --alias [<alias>]

Or save it as a file:

pay-respects nushell --alias [<alias>] | save -f ~/.pay-respects.nu

and source from your config file:

source ~/.pay-respects.nu
PowerShell

Append the following output to your profile:

pay-respects pwsh --alias [<alias>]

Or directly pipe the output to your profile:

pay-respects pwsh --alias [<alias>] >> $PROFILE
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:

eval $(_PR_SHELL=sh _PR_LAST_COMMAND="git comit" pay-respects)

Following variables are not required, but can be used to reduce unnecessary operations:

  • _PR_ALIAS: A list of aliases to commands. Separated by newlines with zsh-like formatting, e.g. gc=git commit
  • _PR_ERROR_MSG: Error message from the previous command. pay-respects will rerun previous command to get the error message if absent
  • _PR_EXECUTABLES: A space separated list of commands/executables. pay-respects will search for $PATH if absent
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. Empty value disables package search functionality
    • _DEF_PR_PACKAGE_MANAGER: compile-time value

You can specify different modes to run with _PR_MODE:

  • noconfirm: Execute suggestions without confirm
  • echo: Print suggestions to stdout without executing
  • cnf: Used for command not found hook

Example usage with noconfirm:

function ff() {
	(
		export _PR_MODE="noconfirm"
		f
	)
}

You can now Press F to Pay Respects !

Installing

Install from your package manager if available:

Packaging status

Instructions for package managers
OS / Distribution Repository Instructions
Arch Linux AUR paru -S pay-respects (-bin)
Arch Linux (ARM) Arch Linux CN sudo pacman -S pay-respects
MacOS / Any timescam brew install timescam/homebrew-tap/pay-respects
NixOS / Any nixpkgs nix-env -iA nixos.pay-respects

Alternatively, install pre-built binaries from GitHub releases. An install script is available:

curl -sSfL https://raw.githubusercontent.com/iffse/pay-respects/main/install.sh | sh
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, modules are optional

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

Configuration

See configuration.

Rules & Modules

See the following pages:

AI Integration

Disclaimer: You are using AI generated content on your own risk. Please double-check its suggestions before accepting.

AI suggestions should work out of the box with request-ai module installed. You can disable it by setting _PR_AI_DISABLE:

export _PR_AI_DISABLE=''

An API key is included with the source (your distribution might have stripped them out). It should always work unless I can no longer afford this public service or rate limits are reached.

I don't track nor store anything. If it's useful to you, consider making a donation:

AI usages and API configurations

Contributing

Current option to write rules should cover most of the cases. We need more rules, contributions are welcomed!

There's also a roadmap for contribution opportunities.

This project is hosted at various sites, you can choose the one that you feel most comfortable with:

Licenses

  • Binaries: AGPL-3.0
    • Core and modules
  • Libraries: MPL-2.0
    • Parser and utils