You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.9 KiB

4 years ago
[![Build Status](](
4 years ago
# McFly - fly through your shell history
4 years ago
4 years ago
> NOTE: This open source project is pre-alpha. It works-- I'm using it every day-- but I haven't trained the prioritization linear perceptron yet because I'm still gathering training data, so the ordering is suboptimal.
4 years ago
<img src="/docs/screenshot.png" alt="screenshot" width="400">
4 years ago
## Features
4 years ago
4 years ago
* Rebinds `CTRL-R` to bring up a full-screen reverse history search with very smart prioritization.
* Augments your shell history to track return status, timestamp, and execution directory.
4 years ago
* Unicode support throughout.
4 years ago
* Also writes to your existing shell history file so you can stop using McFly whenever you want.
* Simple command to scrub a history item from the database and shell history.
* Designed to be extensible in the future for other shells.
* Written in Rust, so it's fast and reliable.
4 years ago
## Prioritization
The key feature of McFly is smart command prioritization. The goal is for the command you want
4 years ago
to run to always be one of the suggestions.
4 years ago
When suggesting a command, McFly takes into consideration:
* The directory where you ran the command. You're more likely to run the same command in the same directory in the future.
4 years ago
* What commands you typed before the command (e.g., the command's context).
4 years ago
* How often you run the command.
4 years ago
* When you last ran the command.
* The command's historical exit status. You probably don't want to run old failed commands.
## Installation
### Compile it yourself
1. [Install Rust 1.29 or later](
1. Compile with optimizations
4 years ago
cargo build --release
1. Copy `./target/release/mcfly` into a location in your `$PATH`. (For example, you could create a directory at `~/bin`
and add `export PATH="$PATH:$HOME/bin"` to your `.bash_profile`.)
### Enable in your shell
#### Bash
Add `. /path/to/this/repository/` to your `~/.bash_profile` or `~/.bashrc` file.
4 years ago
## iTerm2
To avoid McFly's UI messing up your scrollback history in iTerm2, make sure this option is unchecked:
<img src="/docs/iterm2.jpeg" alt="iterm2 UI instructions">
## Future / Upcoming Features
4 years ago
* Add screencast to README.
* Add keyboard shortcut to delete something from the history / make it not get suggested.
* Better prioritization:
* Finish training the linear perceptron after gathering more selection data.
* Learn embeddings per template and use to predict the next embedding, then do approximate nearest neighbor lookup?
* Could train by predicting whether or not one command should follow another and doing gradient descent.
* Learn common command options and autocomplete them in the suggestion UI?
* Sort command line args when coming up with the template matching string.
* Allow suggesting of the last command seen if it's been a while.
* Detect folder renames?