Your shell history, smarter and faster.
Bayesh is your personal shell assistant, designed to make your command-line experience smoother and more efficient. It learns from your shell history and suggests commands you’ve used before. Powered by fzf, Bayesh brings a sleek and intuitive UI to your terminal.
- Save Time: Stop retyping or searching for commands you’ve already used.
- Stay Focused: Let Bayesh handle the repetitive stuff while you focus on what matters.
- Privacy First: Bayesh only learns from your history—no external data, no surprises. Your data stays with you and is never uploaded anywhere.
- Zsh First, Bash Friendly: While optimized for Z-shell (zsh), Bayesh works great with bash too.
-
Install Dependencies:
Ensure you have the following installed: -
Install Bayesh:
Run this snippet in your shell:git clone https://github.com/mads-bisgaard/bayesh.git ~/.bayesh/bayesh ~/.bayesh/bayesh/install.sh "$(basename "$SHELL")"
Bayesh is triggered by hitting Ctrl-e
in your shell.
If you’re using tmux, you’ll love this:
- Toggle the fzf pane with
Ctrl-<up arrow>
andCtrl-<down arrow>
. - Select a suggestion with
Ctrl-<right arrow>
.
Think of Bayesh as the auto-suggestion feature on your smartphone—but for your terminal. It’s like having a personal assistant that remembers everything you’ve done and helps you do it faster.
- No Guesswork: Bayesh only suggests commands you’ve actually used.
- Quick Learning: It starts being useful after just a short learning phase.
- Customizable: Works seamlessly with your shell setup.
Bayesh relies on your shell’s history behavior. To get the best experience:
-
For Bash Users:
Add this to your~/.bashrc
:export HISTCONTROL=
-
For Zsh Users:
Add this to your~/.zshrc
:unsetopt HIST_IGNORE_DUPS
Test your setup by running history -1
twice. If the two lines are different (timestamps or event numbers), you’re good to go!
Bayesh draws inspiration from:
- autojump, z, and zoxide
- The incredible fzf
- Peter Norvig's legendary blogpost on building a spelling corrector
Want to contribute? Whether it's fixing a bug, suggesting a feature, or improving documentation, your help is very much appreciated.
- Fork the repository.
- Create a new branch for your changes.
- Submit a pull request with a clear description of your changes.
Feel free to open an issue if you have questions or need guidance. Let's make Bayesh even better together!
Bayesian statistics applied to your bash history.
Give Bayesh a try today and make your shell history work for you! 🎉