
zsh-autosuggestions
Shows gray command suggestions from your history as you type in zsh.
- Stars
- 36.2k
- Forks
- 1.9k
- Licence
- MIT
- Language
- Shell
- Last update
- 1.4 years ago
- Type
- App
No commits in over a year — check for forks or alternatives before adopting.
What it is
zsh-autosuggestions is a plugin for the zsh shell that suggests commands while you type, based on your command history and tab completions. The suggestion appears after the cursor in muted gray, and you can accept it with a key press. It is inspired by the autosuggestion feature of the Fish shell.
- Re-run a long command from history by pressing the right arrow key to accept the gray suggestion
- Partially accept a suggestion word by word using the forward-word widget
- Limit suggestions to certain history patterns, for example hiding cd commands with ZSH_AUTOSUGGEST_HISTORY_IGNORE
Great for
- People who use zsh as their daily terminal shell
- Users who often repeat long or complex commands
- Anyone who wants Fish-style suggestions without switching shells
Not ideal for
- Users of bash, Fish, or other shells, since it only works with zsh (requires zsh v4.3.11 or later)
- People who prefer no visual changes to their prompt or terminal display
How to get it
- 1
See the README
You'll need: Zsh v4.3.11 or later
Clone the repository
git clone https://github.com/zsh-users/zsh-autosuggestions.git - 2
Run it
- Install the plugin following INSTALL.md in the repository
- Open a new zsh session
- Type the start of a previously used command and look for the gray suggestion
- Press the right arrow or End key to accept the suggestion
- 3
Get the most out of it
- Set ZSH_AUTOSUGGEST_STRATEGY to (history completion) to fall back to completion when history has no match
- Use ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE to change the suggestion color or style
- Set ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE to 20 to avoid suggestions when pasting large text
- Bind autosuggest-execute or autosuggest-toggle to keys of your choice with bindkey
Downloads
Strengths
- Simple, focused behavior that fits into existing zsh setups
- Configurable suggestion sources, colors, and key bindings
- Widely used, with an MIT license and active repository activity
Trade-offs
- Only works with zsh, not other shells
- Some terminal color settings, such as certain iTerm2 setups, can make suggestions invisible, per the README
- Suggestion quality depends on your history and configured strategy
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| zsh-autosuggestions (this) | 36.2k | App | beginner | 1.4 years ago | People who use zsh as their daily terminal shell |
| autocomplete | 25.2k | Other | intermediate | 1.5 years ago | macOS developers who use zsh, bash or fish and want suggestions for common CLIs |
| atuin | 32.2k | Dev tool | beginner | 4 days ago | Developers who work in a terminal and often need to find past commands |
| inshellisense | 10.8k | Dev tool | beginner | 7 days ago | Developers who spend a lot of time in the terminal and want suggestions for unfamiliar command options |
| zoxide | 40.4k | Dev tool | beginner | 4 days ago | Developers who move between many project folders in a terminal |
| direnv | 15.5k | Dev tool | beginner | 11 days ago | Developers who juggle several projects with different environment variables |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.