An excerpt from the repository, fetched Nov 13, 2026.
Read the project’s introduction
Seeking co-maintainers:
I don't have much time to maintain this project these days. If someone would like to jump in and become a co-maintainer, it would be appreciated!
McFly - fly through your shell history
McFly replaces your default ctrl-r shell history search with an intelligent search engine that takes into account
your working directory and the context of recently executed commands. McFly's suggestions are prioritized
in real time with a small neural network.
TL;DR: an upgraded ctrl-r where history results make sense for what you're working on right now.
Features
Rebinds ctrl-r to bring up a full-screen reverse history search prioritized with a small neural network.
Augments your shell history to track command exit status, timestamp, and execution directory in a SQLite database.
Maintains your normal shell history file as well so that you can stop using McFly whenever you want.
Unicode support throughout.
Includes a simple action to scrub any history item from the McFly database and your shell history files.
Designed to be extensible for other shells in the future.
Written in Rust, so it's fast and safe.
You can type % to match any number of characters when searching.
Supports Zsh, Bash (version 3+), and PowerShell (version 7+)
Prioritization
The key feature of McFly is smart command prioritization powered by a small neural network that runs
in real time. The goal is for the command you want to run to always be one of the top suggestions.
When suggesting a command, McFly takes into consideration:
The directory where you ran the command. You're likely to run that command in the same directory in the future.
What commands you typed before the command (e.g., the command's execution context).
How often you run the command.
When you last ran the command.
If you've selected the command in McFly before.
The command's historical exit status. You probably don't want to run old failed commands.
Installation
Install with Homebrew (on macOS or Linux)
Install mcfly:
brew install mcfly
Add the following to the end of your ~/.bashrc, ~/.zshrc, or ~/.config/fish/config.fish file:
Bash:
eval "$(mcfly init bash)"
Zsh:
eval "$(mcfly init zsh)"
Fish:
mcfly init fish | source
Run . ~/.bashrc / . ~/.zshrc / source ~/.config/fish/config.fish or restart your terminal emulator.
Uninstalling with Homebrew
Remove mcfly:
brew uninstall mcfly
Remove the lines you added to ~/.bashrc / ~/.zshrc / ~/.config/fish/config.fish.
Install with MacPorts (on macOS)
Update the ports tree
sudo port selfupdate
Install mcfly:
sudo port install mcfly
Add the following to the end of your ~/.bashrc, ~/.zshrc, or ~/.config/fish/config.fish file, as appropriate:
Bash:
eval "$(mcfly init bash)"
Zsh:
eval "$(mcfly init zsh)"
Fish:
mcfly init fish | source
Run . ~/.bashrc / . ~/.zshrc / source ~/.config/fish/config.fish or restart your terminal emulator.
Uninstalling with MacPorts
Remove mcfly:
sudo port uninstall mcfly
Remove the lines you added to ~/.bashrc / ~/.zshrc / ~/.config/fish/config.fish.
Install using WinGet on Windows (we do not maintain this install script and cannot vouch for its accuracy or safety)
Install mcfly:
winget install AndrewCantino.McFly
Add the following to your $PROFILE:
Invoke-Expression -Command $(mcfly init powershell | Out-String)
Restart your terminal
Uninstall using Winget
Remove mcfly:
winget uninstall AndrewCantino.McFly
Remove the lines you added to $PROFILE.
Installing using our install script (macOS or Linux)
curl -LSfs https://raw.githubusercontent.com/cantino/mcfly/master/ci/install.sh | sh -s -- --git cantino/mcfly (or, if the current user doesn't have permissions to edit /usr/local/bin, then use sudo sh -s.)
Add the following to the end of your ~/.bashrc, ~/.zshrc, or ~/.config/fish/config.fish file, respectively:
Bash:
eval "$(mcfly init bash)"
Zsh:
eval "$(mcfly init zsh)"
Fish:
mcfly init fish | source
Run . ~/.bashrc / . ~/.zshrc / source ~/.config/fish/config.fish or restart your terminal emulator.
Installing manually from GitHub (macOS or Linux)
Download the latest release from GitHub.
Install to a location in your $PATH. (For example, you could create a directory at ~/bin, copy mcfly to this location, and add export PATH="$PATH:$HOME/bin" to your .bashrc / .zshrc, or run set -Ua fish_user_paths "$HOME/bin" for fish.)
Add the following to the end of your ~/.bashrc, ~/.zshrc, or ~/.config/fish/config.fish, respectively:
Bash:
eval "$(mcfly init bash)"
Zsh:
eval "$(mcfly init zsh)"
Fish:
mcfly init fish | source
Run . ~/.bashrc / . ~/.zshrc / source ~/.config/fish/config.fish or restart your terminal emulator.
Install manually from source (macOS, Linux, or Windows)
Install Rust 1.40 or later
Run git clone https://github.com/cantino/mcfly and cd mcfly
Run cargo install --path .
Ensure ~/.cargo/bin is in your $PATH.
Add the following to the end of your ~/.bashrc, ~/.zshrc, ~/.config/fish/config.fish, or powershell $PROFILE, respectively:
Bash:
eval "$(mcfly init bash)"
Zsh:
eval "$(mcfly init zsh)"
Fish:
mcfly init fish | source
Powershell Core (pwsh)
Invoke-Expression -Command $(mcfly init powershell | out-string)
Run . ~/.bashrc / . ~/.zshrc / source ~/.config/fish/config.fish / . $PROFILE or restart your terminal emulator.
Install by Zinit
Add below code to your zshrc.
zinit ice lucid wait"0a" from"gh-r" as"program" atload'eval "$(mcfly init zsh)"'
zinit light cantino/mcfly
It will download mcfly and install for you.
$(mcfly init zsh) will be executed after prompt
iTerm2
To avoid McFly's UI messing up your scrollback history in iTerm2, make sure this option is unchecked:
Dump history
McFly can dump the command history into stdout.
For example:
mcfly dump --since '2023-01-01' --before '2023-09-12 09:15:30'
will dump the command run between 2023-01-01 00:00:00.0 to 2023-09-12 09:15:30(exclusive) as json.
You can specify csv as dump format via --format csv as well.
Each item in dumped commands has the followi
Read the full README on GitHub