Add CLI command typo detection (#34836)#10
Add CLI command typo detection (#34836)#10MitchLewis930 wants to merge 1 commit intopr_040_beforefrom
Conversation
* Add CLI command typo detection * Apply suggestions from code review Co-authored-by: Steven <steven@ceriously.com> * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Steven <steven@ceriously.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| previousRow = currentRow | ||
| } | ||
| return previousRow[previousRow.length - 1] | ||
| } |
There was a problem hiding this comment.
Unused threshold parameter in minDistance function
Low Severity
The threshold parameter in minDistance is accepted but never used inside the function body. It's only passed through the recursive call on line 7, but the actual Levenshtein distance calculation (lines 10-28) never references it. The threshold filtering happens in detectTypo after all distances are already computed. This suggests an early-termination optimization was intended but never implemented, leaving dead code that could mislead future developers about how the function behaves.


PR_040
Note
Low Risk
Small, additive CLI error-handling change with integration tests; main risk is false-positive suggestions in the ENOENT path causing earlier exits for edge-case directory names.
Overview
Improves
nextCLI UX by detecting mistyped subcommands and suggesting the closest valid command (e.g.next buidl��next build) instead of only reporting an invalid directory.This exports the CLI
commandsmap for reuse, adds a small edit-distance baseddetectTypohelper, wires it intogetProjectDirto emit a targeted error + exit when a typo is detected, and adds integration tests covering common misspellings.Written by Cursor Bugbot for commit ed43c03. This will update automatically on new commits. Configure here.