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.
 
 
 
Andrew Cantino 82f66ca13b Add Homebrew support 3 years ago
ci Include mcfly-bash.sh in releases 3 years ago
docs Add iTerm2 instructions 3 years ago
pkg/brew Add Homebrew support 3 years ago
src Use dirs crate to avoid deprecation warning 3 years ago
.gitignore Remove update.sh 3 years ago
.travis.yml CI Integration 3 years ago
Cargo.lock Use dirs crate to avoid deprecation warning 3 years ago
Cargo.toml Use dirs crate to avoid deprecation warning 3 years ago
HomebrewFormula Add Homebrew support 3 years ago
LICENSE Add MIT license 3 years ago
README.md Update README.md 3 years ago
dev.bash added a dev script that builds and runs a vanilla shell w/ mcfly preloaded 3 years ago
mcfly-bash.sh Add option to delete item from history 3 years ago

README.md

Build Status

McFly - fly through your shell history

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.

screenshot

Features

  • 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.
  • Unicode support throughout.
  • 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.

Prioritization

The key feature of McFly is smart command prioritization. The goal is for the command you want to run to always be one of the suggestions.

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.
  • What commands you typed before the command (e.g., the command's context).
  • How often you run the command.
  • 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
  2. Compile with optimizations
    cargo build --release
    
  3. 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/mcfly-bash.sh to your ~/.bash_profile or ~/.bashrc file.

iTerm2

To avoid McFly's UI messing up your scrollback history in iTerm2, make sure this option is unchecked:

iterm2 UI instructions

Future / Upcoming Features

  • 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?