[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-5558":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":16,"starSnapshotCount":16,"syncStatus":34,"lastSyncTime":35,"discoverSource":36},5558,"mcfly","cantino\u002Fmcfly","cantino","Fly through your shell history. Great Scott!","",null,"Rust",7727,198,31,121,0,1,6,20,4,69.9,"MIT License",false,"master",true,[27,28,29,30],"history","rust","search","shell","2026-06-12 04:00:25","> **Seeking co-maintainers**:\n> 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!\n\n![Build Status](https:\u002F\u002Fgithub.com\u002Fcantino\u002Fmcfly\u002Factions\u002Fworkflows\u002Fmean_bean_ci.yml\u002Fbadge.svg)\n[![](https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fv\u002Fmcfly.svg)](https:\u002F\u002Fcrates.io\u002Fcrates\u002Fmcfly)\n\n# McFly - fly through your shell history\n\n\u003Cimg src=\"\u002Fdocs\u002Fscreenshot.png\" alt=\"screenshot\" width=\"400\">\n\nMcFly replaces your default `ctrl-r` shell history search with an intelligent search engine that takes into account\nyour working directory and the context of recently executed commands. McFly's suggestions are prioritized\nin real time with a small neural network.\n\nTL;DR: an upgraded `ctrl-r` where history results make sense for what you're working on right now.\n\n## Features\n\n* Rebinds `ctrl-r` to bring up a full-screen reverse history search prioritized with a small neural network.\n* Augments your shell history to track command exit status, timestamp, and execution directory in a SQLite database.\n* Maintains your normal shell history file as well so that you can stop using McFly whenever you want.\n* Unicode support throughout.\n* Includes a simple action to scrub any history item from the McFly database and your shell history files.\n* Designed to be extensible for other shells in the future.\n* Written in Rust, so it's fast and safe.\n* You can type `%` to match any number of characters when searching.\n* Supports Zsh, Bash (version 3+), and PowerShell (version 7+)\n\n## Prioritization\n\nThe key feature of McFly is smart command prioritization powered by a small neural network that runs\nin real time. The goal is for the command you want to run to always be one of the top suggestions.\n\nWhen suggesting a command, McFly takes into consideration:\n\n* The directory where you ran the command. You're likely to run that command in the same directory in the future.\n* What commands you typed before the command (e.g., the command's execution context).\n* How often you run the command.\n* When you last ran the command.\n* If you've selected the command in McFly before.\n* The command's historical exit status. You probably don't want to run old failed commands.\n\n## Installation\n\n### Install with Homebrew (on macOS or Linux)\n\n1. Install `mcfly`:\n    ```bash\n    brew install mcfly\n    ```\n1. Add the following to the end of your `~\u002F.bashrc`, `~\u002F.zshrc`, or `~\u002F.config\u002Ffish\u002Fconfig.fish` file:\n\n   Bash:\n    ```bash\n    eval \"$(mcfly init bash)\"\n    ```\n\n   Zsh:\n    ```bash\n    eval \"$(mcfly init zsh)\"\n    ```\n\n   Fish:\n    ```bash\n    mcfly init fish | source\n    ```\n1. Run `. ~\u002F.bashrc` \u002F `. ~\u002F.zshrc` \u002F `source ~\u002F.config\u002Ffish\u002Fconfig.fish` or restart your terminal emulator.\n\n#### Uninstalling with Homebrew\n\n1. Remove `mcfly`:\n    ```bash\n    brew uninstall mcfly\n    ```\n1. Remove the lines you added to `~\u002F.bashrc` \u002F `~\u002F.zshrc` \u002F `~\u002F.config\u002Ffish\u002Fconfig.fish`.\n\n### Install with MacPorts (on macOS)\n\n1. Update the ports tree\n    ```bash\n    sudo port selfupdate\n    ```\n1. Install `mcfly`:\n    ```bash\n    sudo port install mcfly\n    ```\n1. Add the following to the end of your `~\u002F.bashrc`, `~\u002F.zshrc`, or `~\u002F.config\u002Ffish\u002Fconfig.fish` file, as appropriate:\n\n   Bash:\n    ```bash\n    eval \"$(mcfly init bash)\"\n    ```\n\n   Zsh:\n    ```bash\n    eval \"$(mcfly init zsh)\"\n    ```\n\n   Fish:\n    ```bash\n    mcfly init fish | source\n    ```\n1. Run `. ~\u002F.bashrc` \u002F `. ~\u002F.zshrc` \u002F `source ~\u002F.config\u002Ffish\u002Fconfig.fish` or restart your terminal emulator.\n\n#### Uninstalling with MacPorts\n\n1. Remove `mcfly`:\n    ```bash\n    sudo port uninstall mcfly\n    ```\n1. Remove the lines you added to `~\u002F.bashrc` \u002F `~\u002F.zshrc` \u002F `~\u002F.config\u002Ffish\u002Fconfig.fish`.\n\n### Install using WinGet on Windows (we do not maintain this install script and cannot vouch for its accuracy or safety)\n\n1. Install `mcfly`:\n   ```shell\n   winget install AndrewCantino.McFly\n   ```\n2. Add the following to your `$PROFILE`:\n   ```shell\n   Invoke-Expression -Command $(mcfly init powershell | Out-String)\n   ```\n3. Restart your terminal\n\n#### Uninstall using Winget\n\n1. Remove `mcfly`:\n   ```shell\n   winget uninstall AndrewCantino.McFly\n   ```\n2. Remove the lines you added to `$PROFILE`.\n\n### Installing using our install script (macOS or Linux)\n\n1. `curl -LSfs https:\u002F\u002Fraw.githubusercontent.com\u002Fcantino\u002Fmcfly\u002Fmaster\u002Fci\u002Finstall.sh | sh -s -- --git cantino\u002Fmcfly` (or, if the current user doesn't have permissions to edit \u002Fusr\u002Flocal\u002Fbin, then use `sudo sh -s`.)\n\n2. Add the following to the end of your `~\u002F.bashrc`, `~\u002F.zshrc`, or `~\u002F.config\u002Ffish\u002Fconfig.fish` file, respectively:\n\n   Bash:\n\n   ```bash\n   eval \"$(mcfly init bash)\"\n   ```\n\n   Zsh:\n\n   ```bash\n   eval \"$(mcfly init zsh)\"\n   ```\n\n   Fish:\n   ```bash\n   mcfly init fish | source\n   ```\n\n3. Run `. ~\u002F.bashrc` \u002F `. ~\u002F.zshrc` \u002F `source ~\u002F.config\u002Ffish\u002Fconfig.fish` or restart your terminal emulator.\n\n### Installing manually from GitHub (macOS or Linux)\n\n1. Download the [latest release from GitHub](https:\u002F\u002Fgithub.com\u002Fcantino\u002Fmcfly\u002Freleases).\n1. Install to a location in your `$PATH`. (For example, you could create a directory at `~\u002Fbin`, copy `mcfly` to this location, and add `export PATH=\"$PATH:$HOME\u002Fbin\"` to your `.bashrc` \u002F `.zshrc`, or run `set -Ua fish_user_paths \"$HOME\u002Fbin\"` for fish.)\n1. Add the following to the end of your `~\u002F.bashrc`, `~\u002F.zshrc`, or `~\u002F.config\u002Ffish\u002Fconfig.fish`, respectively:\n\n   Bash:\n    ```bash\n    eval \"$(mcfly init bash)\"\n    ```\n\n   Zsh:\n    ```bash\n    eval \"$(mcfly init zsh)\"\n    ```\n\n   Fish:\n    ```bash\n    mcfly init fish | source\n    ```\n\n1. Run `. ~\u002F.bashrc` \u002F `. ~\u002F.zshrc` \u002F `source ~\u002F.config\u002Ffish\u002Fconfig.fish` or restart your terminal emulator.\n\n### Install manually from source (macOS, Linux, or Windows)\n\n1. [Install Rust 1.40 or later](https:\u002F\u002Fwww.rust-lang.org\u002Ftools\u002Finstall)\n1. Run `git clone https:\u002F\u002Fgithub.com\u002Fcantino\u002Fmcfly` and `cd mcfly`\n1. Run `cargo install --path .`\n1. Ensure `~\u002F.cargo\u002Fbin` is in your `$PATH`.\n1. Add the following to the end of your `~\u002F.bashrc`, `~\u002F.zshrc`, `~\u002F.config\u002Ffish\u002Fconfig.fish`, or powershell `$PROFILE`, respectively:\n\n   Bash:\n    ```bash\n    eval \"$(mcfly init bash)\"\n    ```\n\n   Zsh:\n    ```bash\n    eval \"$(mcfly init zsh)\"\n    ```\n\n   Fish:\n    ```bash\n    mcfly init fish | source\n    ```\n\n    Powershell Core (pwsh)\n    ```powershell\n    Invoke-Expression -Command $(mcfly init powershell | out-string)\n    ```\n\n1. Run `. ~\u002F.bashrc` \u002F `. ~\u002F.zshrc` \u002F `source ~\u002F.config\u002Ffish\u002Fconfig.fish` \u002F `. $PROFILE` or restart your terminal emulator.\n\n### Install by [Zinit](https:\u002F\u002Fgithub.com\u002Fzdharma-continuum\u002Fzinit)\n\n* Add below code to your zshrc.\n\n    ```zsh\n    zinit ice lucid wait\"0a\" from\"gh-r\" as\"program\" atload'eval \"$(mcfly init zsh)\"'\n    zinit light cantino\u002Fmcfly\n    ```\n* It will download mcfly and install for you.\n* `$(mcfly init zsh)` will be executed after prompt\n\n## iTerm2\n\nTo avoid McFly's UI messing up your scrollback history in iTerm2, make sure this option is unchecked:\n\n\u003Cimg src=\"\u002Fdocs\u002Fiterm2.jpeg\" alt=\"iterm2 UI instructions\">\n\n## Dump history\n\nMcFly can dump the command history into *stdout*.\n\nFor example:\n```bash\nmcfly dump --since '2023-01-01' --before '2023-09-12 09:15:30'\n```\nwill dump the command run between *2023-01-01 00:00:00.0* to *2023-09-12 09:15:30*(**exclusive**) as **json**.\nYou can specify **csv** as dump format via `--format csv` as well.\n\nEach item in dumped commands has the following fields:\n* `cmd`: The run command.\n* `when_run`: The time when the command ran in your local timezone.\n\nYou can dump all the commands history without any arguments:\n```bash\nmcfly dump\n```\n\n### Timestamp format\n\nMcFly parses timestamps via `chrono-systemd-time`, a non-strict implementation of [systemd.time](https:\u002F\u002Fwww.freedesktop.org\u002Fsoftware\u002Fsystemd\u002Fman\u002Fsystemd.time.html), with the following exceptions:\n* time units **must** accompany all time span values.\n* time zone suffixes are **not** supported.\n* weekday prefixes are **not** supported.\n\nMcFly users simply need to understand **specifying timezone in timestamp isn't allowed**.\nMcFly will always use your **local timezone**.\n\nFor more details, please refer to the [`chrono-systemd-time` documentation](https:\u002F\u002Fdocs.rs\u002Fchrono-systemd-time\u002Flatest\u002Fchrono_systemd_time\u002F).\n\n### Regex\n*Dump* supports filtering commands with regex.\nThe regex syntax follows [crate regex](https:\u002F\u002Fdocs.rs\u002Fregex\u002Flatest\u002Fregex\u002F#syntax).\n\nFor example:\n```bash\nmcfly dump -r '^cargo run'\n```\nwill dump all command prefixes with `cargo run`.\n\nYou can use `-r\u002F--regex` and time options at the same time.\n\nFor example:\n```bash\nmcfly dump -r '^cargo run' --since '2023-09-12 09:15:30'\n```\nwill dump all command prefixes with `cargo run` ran since *2023-09-12 09:15:30*.\n\n## Settings\nA number of settings can be set via environment variables. To set a setting you should add the following snippets to your `~\u002F.bashrc` \u002F `~\u002F.zshrc` \u002F `~\u002F.config\u002Ffish\u002Fconfig.fish`.\n\n[Color settings](https:\u002F\u002Fgithub.com\u002Fcantino\u002Fmcfly\u002Fblob\u002Fb54adb65e1567887fe430188324c09553431eb7c\u002Fsrc\u002Fsettings.rs#L508) can be set in a config file, which will be in `~\u002F.mcfly` if it exists, otherwise in `$XDG_DATA_DIR\u002Fmcfly`. On MacOS, this would be `~\u002FLibrary\u002FApplication Support\u002FMcFly\u002Fconfig.toml`.\n\n### Light Mode\nTo swap the color scheme for use in a light terminal, set the environment variable `MCFLY_LIGHT`.\n\nbash \u002F zsh:\n```bash\nexport MCFLY_LIGHT=TRUE\n```\n\nfish:\n```bash\nset -gx MCFLY_LIGHT TRUE\n```\n\npowershell:\n```powershell\n$env:MCFLY_LIGHT = \"TRUE\"\n```\n\nTip: on macOS you can use the following snippet for color scheme to be configured based on system-wide settings:\n\nbash \u002F zsh:\n```bash\nif [[ \"$(defaults read -g AppleInterfaceStyle 2&>\u002Fdev\u002Fnull)\" != \"Dark\" ]]; then\n    export MCFLY_LIGHT=TRUE\nfi\n```\n\n### VIM Key Scheme\nBy default Mcfly uses an `emacs` inspired key scheme. If you would like to switch to the `vim` inspired key scheme, set the environment variable `MCFLY_KEY_SCHEME`.\n\nbash \u002F zsh:\n```bash\nexport MCFLY_KEY_SCHEME=vim\n```\n\nfish:\n```bash\nset -gx MCFLY_KEY_SCHEME vim\n```\n\npowershell:\n```powershell\n$env:MCFLY_KEY_SCHEME=\"vim\"\n```\n\n### Fuzzy Searching\nTo enable fuzzy searching, set `MCFLY_FUZZY` to an integer. 0 is off; higher numbers weight toward shorter matches. Values in the 2-5 range get good results so far; try a few and [report what works best for you](https:\u002F\u002Fgithub.com\u002Fcantino\u002Fmcfly\u002Fissues\u002F183)!\n\nbash \u002F zsh:\n```bash\nexport MCFLY_FUZZY=2\n```\n\nfish:\n```bash\nset -gx MCFLY_FUZZY 2\n```\n\npowershell:\n```powershell\n$env:MCFLY_FUZZY=2\n```\n\n### Results Count\nTo change the maximum number of results shown, set `MCFLY_RESULTS` (default: 30).\n\nbash \u002F zsh:\n```bash\nexport MCFLY_RESULTS=50\n```\n\nfish:\n```bash\nset -gx MCFLY_RESULTS 50\n```\n\npowershell:\n```powershell\n$env:MCFLY_RESULTS=50\n```\n\n### Delete without confirmation\nTo delete without confirmation, set `MCFLY_DELETE_WITHOUT_CONFIRM` to true.\n\nbash \u002F zsh:\n```bash\nexport MCFLY_DELETE_WITHOUT_CONFIRM=true\n```\n\nfish:\n```bash\nset -gx MCFLY_DELETE_WITHOUT_CONFIRM true\n```\n\npowershell:\n```powershell\n$env:MCFLY_DELETE_WITHOUT_CONFIRM=\"true\"\n```\n\n### Interface view\nTo change interface view, set `MCFLY_INTERFACE_VIEW` (default: `TOP`).\nAvailable options: `TOP` and `BOTTOM`\n\nbash \u002F zsh:\n```bash\nexport MCFLY_INTERFACE_VIEW=BOTTOM\n```\n\nfish:\n```bash\nset -gx MCFLY_INTERFACE_VIEW BOTTOM\n```\n\npowershell:\n```powershell\n$env:MCFLY_INTERFACE_VIEW=\"BOTTOM\"\n```\n\n### Disable menu interface\nTo disable the menu interface, set the environment variable `MCFLY_DISABLE_MENU`.\n\nbash \u002F zsh:\n```bash\nexport MCFLY_DISABLE_MENU=TRUE\n```\n\nfish:\n```bash\nset -gx MCFLY_DISABLE_MENU TRUE\n```\n\npowershell:\n```powershell\n$env:MCFLY_DISABLE_MENU=true\n ```\n\n### Results sorting\nTo change the sorting of results shown, set `MCFLY_RESULTS_SORT` (default: RANK).\nPossible values `RANK` and `LAST_RUN`\n\nbash \u002F zsh:\n```bash\nexport MCFLY_RESULTS_SORT=LAST_RUN\n```\n\nfish:\n```bash\nset -gx MCFLY_RESULTS_SORT LAST_RUN\n```\n\npowershell:\n```powershell\n$env:MCFLY_RESULTS_SORT=\"LAST_RUN\"\n ```\n\n### Custom Prompt\nTo change the prompt, set `MCFLY_PROMPT` (default: `$`).\n\nbash \u002F zsh:\n```bash\nexport MCFLY_PROMPT=\"❯\"\n```\n\nfish:\n```bash\nset -gx MCFLY_PROMPT \"❯\"\n```\n\npowershell:\n```powershell\n$env:MCFLY_PROMPT=\">\"\n ```\n\nNote that only single-character-prompts are allowed. setting `MCFLY_PROMPT` to `\"\u003Cstr>\"` will reset it to the default prompt.\n\n### Database Location\n\nMcFly stores its SQLite database in the standard location for the OS. On OS X, this is in `~\u002FLibrary\u002FApplication Support\u002FMcFly`, on Linux it is in `$XDG_DATA_DIR\u002Fmcfly\u002Fhistory.db` (default would be `~\u002F.local\u002Fshare\u002Fmcfly\u002Fhistory.db`), and on Windows, it is `%LOCALAPPDATA%\\McFly\\data\\history.db`. For legacy support, if `~\u002F.mcfly\u002F` exists, it is used instead.\n\n### Slow startup\n\nIf you have a very large history database and you notice that McFly launches slowly, you can set `MCFLY_HISTORY_LIMIT` to something like 10000 to limit how many records are considered when searching. In this example, McFly would search only the latest 10,000 entries.\n\n### Bash TIOCSTI\n\nStarting with Linux kernel version 6.2, some systems have disabled TIOCSTI (which McFly previously used to write the selected command). McFly works around this issue by using two \"dummy\" keybindings, which default to `ctrl-x 1` and `ctrl-x 2`. If you are using either of these for another purpose, you can set the `MCFLY_BASH_SEARCH_KEYBINDING` and `MCFLY_BASH_ACCEPT_LINE_KEYBINDING`, respectively, to something you are not using. If you would prefer to use the legacy TIOCSTI behavior, you can enable it by setting the `sysctl` variable `dev.tty.legacy_tiocsti` to `1` on your system and set the `MCFLY_BASH_USE_TIOCSTI` bash variable to `1`.\n\n## HISTTIMEFORMAT\n\nMcFly currently doesn't parse or use `HISTTIMEFORMAT`.\n\n## Possible Future Features\n\n* Add a screencast to README.\n* Learn common command options and autocomplete them in the suggestion UI?\n* Sort command line args when coming up with the template matching string.\n* Possible prioritization improvements:\n   * Cross validation & explicit training set selection.\n   * Learn command embeddings\n\n## Development\n\n### Contributing\n\nContributions and bug fixes are encouraged! However, we may not merge PRs that increase complexity significantly beyond what is already required to maintain the project. If you're in doubt, feel free to open an issue and ask.\n\n### Running tests\n\n`cargo test`\n\n### Releasing (notes for @cantino)\n\n1. Edit `Cargo.toml` and bump the version.\n1. Edit CHANGELOG.txt\n1. Run `cargo clippy` and `cargo fmt`.\n1. Recompile (`cargo build`) and test (`cargo test`)\n1. `git add -p`\n1. `git ci -m 'Bumping to vx.x.x'`\n1. `git tag vx.x.x`\n1. `git push origin head --tags`\n1. Let the build finish.\n1. Edit the new Release on Github.\n1. `cargo publish`\n1. TBD: update homebrew-core Formula at https:\u002F\u002Fgithub.com\u002FHomebrew\u002Fhomebrew-core\u002Fblob\u002Fmaster\u002FFormula\u002Fm\u002Fmcfly.rb\n\nOld:\n1. Edit `pkg\u002Fbrew\u002Fmcfly.rb` and update the version and SHAs. (`shasum -a 256 ...`)\n1. Edit `..\u002Fhomebrew-mcfly\u002Fpkg\u002Fbrew\u002Fmcfly.rb` too.\n  1. `cp pkg\u002Fbrew\u002Fmcfly.rb ..\u002Fhomebrew-mcfly\u002Fpkg\u002Fbrew\u002Fmcfly.rb`\n  1. Compare with `diff ..\u002Fhomebrew-mcfly\u002Fpkg\u002Fbrew\u002Fmcfly.rb ..\u002Fmcfly\u002Fpkg\u002Fbrew\u002Fmcfly.rb ; diff ..\u002Fhomebrew-mcfly\u002FHomebrewFormula\u002Fmcfly.rb ..\u002Fmcfly\u002FHomebrewFormula\u002Fmcfly.rb`\n1. `git add -p && git ci -m 'Update homebrew' && git push`\n1. `cd ..\u002Fhomebrew-mcfly && git add -p && git ci -m 'Update homebrew' && git push && cd ..\u002Fmcfly`\n","McFly 是一个用于增强 shell 历史记录搜索体验的工具。它通过一个小规模的神经网络实时优先级排序，结合工作目录和最近执行命令的上下文来智能推荐历史命令。该工具使用 Rust 语言编写，确保了高效性和安全性，并支持 Unicode 和多种 shell 环境如 Zsh、Bash（版本3+）及 PowerShell（版本7+）。McFly 适合需要频繁查阅和重复使用终端命令的开发者或系统管理员，在日常工作中能够显著提高查找特定历史命令的速度与准确性。",2,"2026-06-11 03:03:56","top_language"]