Repolode
cantino

cantino/mcfly

A Rust shell history search that replaces Ctrl-R with a context-aware, neural-network-ranked full-screen search.

Stars
7,810
Forks
203
Open issues
136
Last commit
2 months ago

What is it?

McFly replaces the default Ctrl-R reverse history search in your shell with a full-screen search that ranks results using your working directory and the commands you ran recently. Ranking is handled by a small neural network that runs in real time, so the command you want should appear near the top.

McFly records each command's exit status, timestamp, and execution directory in a SQLite database, while still keeping your normal shell history file. Commands can be removed from both stores, and a dump subcommand exports history as JSON or CSV with optional time and regex filters.

The tool supports Zsh, Bash 3+, Fish, and PowerShell 7+, and is installable through Homebrew, MacPorts, WinGet, Zinit, or Cargo. Options such as light mode, Vim key bindings, fuzzy matching, and an ignore pattern are configured through environment variables.

Key features

  • 01Replaces Ctrl-R with a full-screen history search ranked by a small neural network.
  • 02Considers working directory, preceding commands, run frequency, recency, and past exit status.
  • 03Stores exit status, timestamp, and directory in SQLite while keeping the normal shell history file.
  • 04Lets you scrub a command from both the McFly database and shell history files.
  • 05Exports history as JSON or CSV with time and regex filters.

Use cases

  • Finding a long or complex command you ran earlier in the same project directory.
  • Avoiding re-running old failed commands by using exit status in ranking.
  • Exporting shell history for auditing or analysis with regex and date filters.
  • Scrubbing accidentally typed secrets from shell history.

Quick start

  1. 1

    Install mcfly with Homebrew

    brew install mcfly
  2. 2

    Add the init line to the end of your shell config file (Bash shown; Zsh and Fish variants are in the README)

    eval "$(mcfly init bash)"
  3. 3

    Reload your shell config or restart your terminal

    . ~/.bashrc

Things to know

  • The maintainer says they lack time to maintain the project and is seeking co-maintainers.
  • The WinGet install script is not maintained by the project, which cannot vouch for its accuracy or safety.

Topics

FAQ

What is mcfly?
A Rust shell history search that replaces Ctrl-R with a context-aware, neural-network-ranked full-screen search. McFly replaces the default Ctrl-R reverse history search in your shell with a full-screen search that ranks results using your working directory and the commands you ran recently. Ranking is handled by a small neural network that runs in real time, so the command you want should appear near the top.
Is mcfly free to use? What license does it have?
mcfly is open source under the MIT license. Check the license terms before using it in commercial products.
Is mcfly still maintained?
Updated within 6 months. The last commit to mcfly was on Sep 1, 2026.
What can I use mcfly for?
Finding a long or complex command you ran earlier in the same project directory. Avoiding re-running old failed commands by using exit status in ranking. Exporting shell history for auditing or analysis with regex and date filters. Scrubbing accidentally typed secrets from shell history.
How do I install mcfly?
Install mcfly with Homebrew: brew install mcfly Add the init line to the end of your shell config file (Bash shown; Zsh and Fish variants are in the README): eval "$(mcfly init bash)" Reload your shell config or restart your terminal: . ~/.bashrc
Where can I get mcfly?
The source code and installation instructions are on GitHub: https://github.com/cantino/mcfly

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects