McFly — Fly Through Your Shell History with Context-Aware Search
McFly replaces the default Ctrl-R reverse search in bash/zsh/fish with a neural-ranked, context-aware history finder that considers directory, exit status, and recency.
Instalación lista para agent
Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.
npx -y tokrepo@latest install bc4f7f6d-389d-11f1-9bc6-00163e2b0d79 --target codexEjecutar después de confirmar el plan con dry-run.
What it is
McFly replaces the default Ctrl-R reverse history search in bash, zsh, and fish with a context-aware, neural-ranked search. Instead of simple substring matching, McFly considers your current working directory, the exit status of previous commands, the time of day, and how recently you used each command to rank results.
McFly is for developers and sysadmins who run many commands across multiple projects and want their shell history to surface the right command in the right context.
The project is actively maintained with regular releases and a growing user community. Documentation covers common use cases, and the open-source nature means you can inspect the source code, contribute fixes, and adapt the tool to your specific requirements.
How it saves time or tokens
Default shell history search shows the most recent match regardless of context. If you run git push in 20 different repositories, Ctrl-R always shows the last one. McFly ranks the git push from your current directory higher because it understands context. This eliminates scrolling through irrelevant matches and reduces typo-driven re-runs.
How to use
- Install McFly via brew, cargo, or your package manager.
- Add the shell integration to your profile (bash, zsh, or fish).
- Press Ctrl-R to search with McFly instead of the default history search.
Example
# Install McFly
brew install mcfly
# Add to .zshrc
eval "$(mcfly init zsh)"
# Add to .bashrc
eval "$(mcfly init bash)"
# Add to fish config
mcfly init fish | source
# Usage: press Ctrl-R and start typing
# McFly ranks results by:
# - Current directory context
# - Command exit status (successful commands rank higher)
# - Recency and frequency
# - Time of day patterns
Related on TokRepo
- AI Tools for Coding -- Developer tools and shell utilities
- Featured Workflows -- Top workflows on TokRepo
Common pitfalls
- McFly stores its database in
~/.mcfly/. If you use multiple machines, history is not shared automatically. Each machine maintains its own context database. - The initial history import from
.bash_historyor.zsh_historylacks context metadata (directory, exit status). Context-aware ranking improves over time as McFly records new commands. - McFly intercepts Ctrl-R. If you prefer the default behavior in some sessions, set
MCFLY_DISABLE=1before sourcing the init script.
Before adopting this tool, evaluate whether it fits your team's existing workflow. Read the official documentation thoroughly, and start with a small proof-of-concept rather than a full migration. Community forums, GitHub issues, and Stack Overflow are valuable resources when you encounter edge cases not covered in the documentation.
Preguntas frecuentes
McFly uses a small neural network trained on your shell usage patterns. It considers the current working directory, command exit status (preferring successful commands), recency, frequency, and time-of-day patterns to rank results.
McFly supports bash, zsh, and fish. Each shell has a dedicated init command that sets up the Ctrl-R keybinding and command tracking.
No. McFly maintains its own SQLite database alongside your regular shell history. Your .bash_history or .zsh_history file is not modified. McFly imports existing history on first run.
Yes. Use mcfly search to find commands and delete them from the McFly database. You can also set MCFLY_HISTORY_LIMIT to cap the number of stored commands.
Yes. McFly is written in Rust, which gives it fast startup time and low memory usage. The neural ranking model is lightweight and runs in milliseconds.
Referencias (3)
- McFly GitHub— McFly is a context-aware shell history search tool
- McFly README— Neural-ranked results considering directory, exit status, and recency
- Rust Language— Rust-based CLI tool design
Relacionados en TokRepo
Discusión
Activos relacionados
Pomerium — Identity-Aware Zero Trust Access Proxy
Pomerium is an open source reverse proxy that provides secure, identity-aware access to internal applications without a VPN, implementing BeyondCorp-style zero trust networking with SSO integration.
mitmproxy — The Interactive HTTPS Proxy for Debugging and Reverse Engineering
mitmproxy is a free, open-source interactive HTTP/HTTPS/HTTP2/WebSocket proxy for developers, researchers, and security professionals. Inspect, modify, replay, and replay traffic on the fly — from the terminal, a web UI, or Python scripts.
Turbopuffer — Serverless Vector DB for AI Search
Serverless vector database built for AI search at scale. Turbopuffer offers sub-millisecond queries, automatic scaling, and pay-per-query pricing with zero infrastructure.
Datasette — Explore SQLite Data as Web UI + JSON API
Datasette turns any SQLite database into a browseable web UI + JSON API in one command. Publish to Vercel/Fly.io. Faceted + full-text search.