feat: improve unknown command UX with aliases, default routing, and suggestions#635
Open
feat: improve unknown command UX with aliases, default routing, and suggestions#635
Conversation
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Telemetry
Other
Bug Fixes 🐛Telemetry
Other
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
…uggestions Address CLI-Q3 (183 events, 85 users) by adding three complementary mechanisms for handling unrecognized commands: - Add `defaultCommand: "view"` to all 8 route groups so bare IDs route directly (e.g., `sentry issue CLI-G5` → `sentry issue view`) - Add `show` as alias for `view` on all route maps, `remove` for `delete` on project and widget routes - Add synonym suggestion registry for mutation commands, old sentry-cli commands, and cross-route confusion patterns Three edge cases handled in app.ts: - Case A: bare route group (`sentry issue`) → usage hint - Case B: multi-arg synonym (`sentry issue events CLI-AB`) → tip - Case C: single-arg synonym (`sentry issue resolve`) → tip appended to domain error Filed #632 (issue events) and #633 (event list) for missing commands.
41ae536 to
9873e49
Compare
Contributor
Codecov Results 📊✅ 129 passed | Total: 129 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 1346 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 95.54% 95.55% +0.01%
==========================================
Files 204 205 +1
Lines 30112 30271 +159
Branches 0 0 —
==========================================
+ Hits 28770 28925 +155
- Misses 1342 1346 +4
- Partials 0 0 —Generated by Codecov Action |
Replace the hardcoded ROUTES_WITH_DEFAULT_VIEW set with runtime derivation using getDefaultCommand() from the Stricli route map. No manual list to maintain when adding new route groups.
Contributor
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.
Move the synonym check before Sentry.captureException() so that known user mistakes like `sentry issue resolve` don't create noise in our Sentry project. Extract formatSynonymError() helper to keep complexity under Biome's limit.
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.

Summary
Addresses CLI-Q3 — 183 events from 85 users hitting unknown commands. Three complementary mechanisms:
defaultCommand: "view"on all 8 route groups with aviewsubcommand — bare IDs route directly (e.g.,sentry issue CLI-G5→sentry issue view CLI-G5)showalias forviewon all route maps,removealias fordeleteon project/widget — uses Stricli's nativealiasespropertyissue resolve→ suggestsentry api), old sentry-cli commands (cli info→sentry auth status), cross-route confusion (issue events→sentry issue view)Edge cases handled in
app.tssentry issue(no args)sentry issue events CLI-ABsentry issue resolvesentry cli infonoCommandRegisteredForInput+ synonym tipFiled follow-up issues
sentry issue eventscommand to list events for an issue #632 —sentry issue eventscommandsentry event listcommand +eventsplural alias #633 —sentry event list+eventsplural alias