Skip to content

[DX] Improve command and argument suggestions #3344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bramus opened this issue Sep 16, 2021 · 1 comment
Closed

[DX] Improve command and argument suggestions #3344

bramus opened this issue Sep 16, 2021 · 1 comment
Labels
area: command: deploy area: dx type: feature code contributing to the implementation of a feature and/or user facing functionality

Comments

@bramus
Copy link

bramus commented Sep 16, 2021

It's been a while since I did a manual deploy, so I forgot the command (of course) to do so. I tried guessing it from memory, and while I was happy to see that netlify-cli tried to help me out, the suggestions felt really weird:

$ netlify publish
  > warning publish is not a netlify command.
Did you mean unlink [y/n]

I expected netlify-cli to suggest deploy (the correct command) here, instead of the dangerous unlink

$ netlify push
  > warning push is not a netlify command.
Did you mean api [y/n]

I also expected netlify-cli to suggest deploy (the correct command) here, instead of the unrelated api

$ netlify deploy --production
  > Error: unexpected argument: --production
  > See more help with --help

I expected netlify-cli to suggest using --prod (the correct argument) here.

@bramus bramus added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Sep 16, 2021
@erezrokah
Copy link
Contributor

To add more context - I believe we're using an oclif plugin for that, see https://github.com/oclif/plugin-not-found.
It seems to use Levenshtein distance for guessing the correct command:
https://github.com/oclif/plugin-not-found/blob/d7f5ae83c7f2241e9a8b010f6fe13ece26046663/src/index.ts#L15

There might be a better approach to do it, but I can't think of one without doing more research

@serhalp serhalp closed this as not planned Won't fix, can't repro, duplicate, stale Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: command: deploy area: dx type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

No branches or pull requests

3 participants