feat: suggest common mistaken subcommands#334
Merged
zeroshade merged 4 commits intocolumnar-tech:mainfrom Mar 31, 2026
Merged
Conversation
Member
Author
|
Happy to take ideas on the look of this, $ ./dbc list
Usage: dbc [--quiet] <command> [<args>]
error: invalid subcommand: list. Did you mean: dbc search? |
zeroshade
reviewed
Mar 27, 2026
This reverts commit ee8fe46.
724e119 to
21a0d6c
Compare
Member
Author
|
I'd like to put the change for printing help text from stdout to stderr in another PR so I addressed just the newline. @zeroshade did you have any thoughts on the look or wording? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a way for dbc to suggest commands when the user enters a command
that doesn't exist. It adds a hook to our argument parser's error handler to
augment the error message with a suggestion.
I started with list -> search because I notice that users and/or AI agents like
to hallucinate 'dbc list' and I think this will help by at least reducing the
number of turns it takes for the agent to learn about dbc search.
We might consider a fuzzy suggestion feature (saerch -> search) like other CLI
tools use as a follow-on to this.