McFly
Replaces ctrl-r shell history search with a full-screen search ranked by a small neural network using directory, prior commands, and exit status.
McFly is a shell history search tool written in Rust. It rebinds ctrl-r in Zsh, Bash (version 3+), Fish, and PowerShell (version 7+) to open a full-screen reverse history search. Results are ranked in real time by a small neural network instead of by recency alone.
To support ranking, McFly records each command's exit status, timestamp, and execution directory in a SQLite database. The ranking takes into account the directory where a command was run, the commands typed before it, how often and how recently it was run, whether you selected it in McFly before, and its historical exit status, so old failed commands rank lower. Your normal shell history file is still maintained, so you can stop using McFly at any time. A built-in action removes a history item from both the McFly database and your shell history files.
Other capabilities include % as a wildcard in searches, Unicode support, optional fuzzy matching (MCFLY_FUZZY), and a vim key scheme (MCFLY_KEY_SCHEME=vim). You can also set a light color scheme, the number of results (MCFLY_RESULTS, default 30), top or bottom interface placement, and result sorting by rank or last run. mcfly dump writes history to stdout as JSON or CSV. It can filter by --since and --before timestamps and by regex with -r. It is aimed at developers and sysadmins who work in the terminal and rely on history recall. The README notes the project is looking for co-maintainers.
Installation
# via Homebrew
brew install mcfly
# via MacPorts
sudo port install mcfly
# via WinGet
winget install AndrewCantino.McFly

Alternatives & related tools
genact
Terminal program that prints fake activity output (compilers, builds, botnets, downloads) to look busy. Runs natively or in a browser via WebAssembly.
vivid
Generates LS_COLORS values from YAML filetype databases and color themes, for ls, tree, fd, bfs, dust and other tools.
atuin
Shell history management with SQLite storage, search interface, and encrypted sync across machines
fish
Interactive command line shell with syntax highlighting, autosuggestions, and tab completions that work without configuration
zoxide
Smart cd replacement that remembers frequently used directories for quick navigation
add a badge to your README
Maintain McFly? Show that it's featured on trmn. The badge links back to this page.
[](https://www.trmn.sh/tools/mcfly?utm_source=badge)<a href="https://www.trmn.sh/tools/mcfly?utm_source=badge"><img src="https://www.trmn.sh/badge/mcfly.svg" alt="Featured on trmn" height="20"></a>