You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for "ghost hints" - a visual completion suggestion that appears as greyed-out or faded text after the user's current input, showing the most likely next completion without requiring the user to press Tab or complete it.
Use Case
This feature improves user experience by providing predictive guidance. As users type commands or arguments, they can see a hint for what cmd2 predicts they might want to complete next, similar to features in:
Fish shell's autosuggestions
IDE autocomplete ghosts
Command-line tools like fzf
Expected Behavior
When a user types a partial command or argument, cmd2 shows a faded/greyed-out suggestion of the most likely completion
The hint appears without interfering with what the user has typed
Users can press a key (Tab) to accept the suggestion
If the suggestion is incorrect, the user can simply continue typing and the hint updates
The feature should be optional and configurable (can be enabled/disabled)
Thanks for feature suggestion! Soon we will start working on our 4.0.0 release and for this the main change is we intend to migrate to using prompt-toolkit for our tab-completion capabilities. prompt-toolkit has good support for auto suggestion capabilities similar to those provided by the fish shell.
I updated Issue #1538 to include investigating adding this capability once we migrate to prompt-toolkit. I'll leave this issue open as well for tracking.
If you have the skill, time, and motivation to help we would be very happy to review a Pull Request.
PR #1553 which adds support for prompt-toolkit also adds a new auto_suggest boolean parameter to cmd2.Cmd. If True, then fish shell style auto-suggestions will be shown based on history. The user can press the right arrow key to accept the auto-suggestion.
PR #1553 which adds support for prompt-toolkit also adds a new auto_suggest boolean parameter to cmd2.Cmd. If True, then fish shell style auto-suggestions will be shown based on history. The user can press the right arrow key to accept the auto-suggestion.
This works best when persistent history is used.
Surely impressive turnaround! Thanks!! I cannot wait to experiment.
@ryanmerolle
Feel free to test it out if you like on the prompt-toolkit branch. Currently we are defaulting auto_suggest to True, so most of the examples under examples/ are using it. We may change that default before release based on testing and feedback. If you test it out, feel free to let us know what you think.
I'm going to close this. This feature will be in our 4.0.0 release once we get that out. We have some more tweaking we need to do before that is ready.
Activity
github-actions commentedon Dec 23, 2025
🤖 Hi @ryanmerolle, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.
github-actions commentedon Dec 23, 2025
🤖 I'm sorry @ryanmerolle, but I was unable to process your request. Please see the logs for more details.
[-]Add ghost hinting / completion feature[/-][+]Add auto suggestion feature[/+]tleonhardt commentedon Dec 23, 2025
@ryanmerolle
Hey Ryan,
Thanks for feature suggestion! Soon we will start working on our 4.0.0 release and for this the main change is we intend to migrate to using prompt-toolkit for our tab-completion capabilities.
prompt-toolkithas good support for auto suggestion capabilities similar to those provided by the fish shell.I updated Issue #1538 to include investigating adding this capability once we migrate to
prompt-toolkit. I'll leave this issue open as well for tracking.If you have the skill, time, and motivation to help we would be very happy to review a Pull Request.
tleonhardt commentedon Jan 25, 2026
PR #1553 which adds support for
prompt-toolkitalso adds a newauto_suggestboolean parameter tocmd2.Cmd. IfTrue, then fish shell style auto-suggestions will be shown based on history. The user can press the right arrow key to accept the auto-suggestion.This works best when persistent history is used.
ryanmerolle commentedon Jan 25, 2026
Surely impressive turnaround! Thanks!! I cannot wait to experiment.
tleonhardt commentedon Jan 26, 2026
@ryanmerolle
Feel free to test it out if you like on the
prompt-toolkitbranch. Currently we are defaultingauto_suggesttoTrue, so most of the examples underexamples/are using it. We may change that default before release based on testing and feedback. If you test it out, feel free to let us know what you think.ryanmerolle commentedon Jan 27, 2026
The feature works as expected. Thanks!
tleonhardt commentedon Feb 4, 2026
I'm going to close this. This feature will be in our 4.0.0 release once we get that out. We have some more tweaking we need to do before that is ready.
ryanmerolle commentedon Feb 5, 2026
I was actually going to close this myself this morning.
I am excited for the v4 release and I appreciate all your work!