I’d look at zsh autosuggestions as a possible starting point. It’s based on your history and suggests previous commands based on what you type, but there’s no reason it couldn’t provide a suggestion “immediately”. https://github.com/zsh-users/zsh-autosuggestions