Skip to content

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
Step-by-step guide: how to use zsh-autosuggestionsInstall, first run, examples, tips and FAQs

How to get it

  1. 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. 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. 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

ProjectStarsTypeLevelUpdatedBest for
zsh-autosuggestions (this)36.2kAppbeginner1.4 years agoPeople who use zsh as their daily terminal shell
autocomplete25.2kOtherintermediate1.5 years agomacOS developers who use zsh, bash or fish and want suggestions for common CLIs
atuin32.2kDev toolbeginner4 days agoDevelopers who work in a terminal and often need to find past commands
inshellisense10.8kDev toolbeginner7 days agoDevelopers who spend a lot of time in the terminal and want suggestions for unfamiliar command options
zoxide40.4kDev toolbeginner4 days agoDevelopers who move between many project folders in a terminal
direnv15.5kDev toolbeginner11 days agoDevelopers 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.