Skip to content

feat: suggest common mistaken subcommands#334

Merged
zeroshade merged 4 commits intocolumnar-tech:mainfrom
amoeba:feat/provide-subcommand-suggestions
Mar 31, 2026
Merged

feat: suggest common mistaken subcommands#334
zeroshade merged 4 commits intocolumnar-tech:mainfrom
amoeba:feat/provide-subcommand-suggestions

Conversation

@amoeba
Copy link
Copy Markdown
Member

@amoeba amoeba commented Mar 27, 2026

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.

@amoeba
Copy link
Copy Markdown
Member Author

amoeba commented Mar 27, 2026

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?

@amoeba amoeba requested review from ianmcook and zeroshade March 27, 2026 17:37
@amoeba amoeba force-pushed the feat/provide-subcommand-suggestions branch from 724e119 to 21a0d6c Compare March 31, 2026 01:11
@amoeba
Copy link
Copy Markdown
Member Author

amoeba commented Mar 31, 2026

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?

@zeroshade zeroshade merged commit b51ef3c into columnar-tech:main Mar 31, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants