Skip to content

feat: improve unknown command UX with aliases, default routing, and suggestions#635

Open
BYK wants to merge 3 commits intomainfrom
byk/fix-unknown-command-suggestions
Open

feat: improve unknown command UX with aliases, default routing, and suggestions#635
BYK wants to merge 3 commits intomainfrom
byk/fix-unknown-command-suggestions

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 1, 2026

Summary

Addresses CLI-Q3 — 183 events from 85 users hitting unknown commands. Three complementary mechanisms:

  • defaultCommand: "view" on all 8 route groups with a view subcommand — bare IDs route directly (e.g., sentry issue CLI-G5sentry issue view CLI-G5)
  • show alias for view on all route maps, remove alias for delete on project/widget — uses Stricli's native aliases property
  • Synonym suggestion registry for patterns that can't be aliased — mutation commands (issue resolve → suggest sentry api), old sentry-cli commands (cli infosentry auth status), cross-route confusion (issue eventssentry issue view)

Edge cases handled in app.ts

Case Trigger Behavior
A: bare route group sentry issue (no args) Usage hint instead of cryptic parse error
B: multi-arg synonym sentry issue events CLI-AB Stricli parse error + synonym tip
C: single-arg synonym sentry issue resolve Domain error + synonym tip
D: non-defaultCommand routes sentry cli info noCommandRegisteredForInput + synonym tip

Filed follow-up issues

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Telemetry

  • Add performance instrumentation and CLI Performance dashboard by BYK in #625
  • Upgrade Sentry SDK to 10.47.0 and enable runtime metrics by BYK in #622

Other

  • (auth) Show token expiry in days/weeks instead of raw hours by BYK in #620
  • (ci) Add delta patch generation for stable releases by BYK in #618
  • (dashboard) Render text widget markdown content in dashboard view by BYK in #624
  • (traces) Expose custom span attributes and improve agent guidance by BYK in #623
  • Improve unknown command UX with aliases, default routing, and suggestions by BYK in #635

Bug Fixes 🐛

Telemetry

  • Exclude OutputError from Sentry exception capture (CLI-PK) by BYK in #629
  • Derive environment from CLI_VERSION instead of NODE_ENV by BYK in #627

Other

  • (build) Use esbuild for binary bundling to fix minifier collision bug by BYK in #619
  • (ci) Restore GH_TOKEN for gh CLI steps in generate-patches by BYK in #634
  • (init) Prompt for team selection when user belongs to multiple teams by betegon in #621
  • (upgrade) Remove "What's new" header from changelog output by BYK in #626

Internal Changes 🔧

  • (deps) Upgrade @sentry/api from 0.54.0 to 0.94.0 by BYK in #630
  • Remove stale debug-level stderr assertions and fix logger state leak by BYK in #631
  • Regenerate skill files and command docs by github-actions[bot] in e01b2520

🤖 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.
@BYK BYK force-pushed the byk/fix-unknown-command-suggestions branch from 41ae536 to 9873e49 Compare April 2, 2026 00:09
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Codecov Results 📊

129 passed | Total: 129 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 1346 uncovered lines.
✅ Project coverage is 95.55%. Comparing base (base) to head (head).

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.
@BYK BYK marked this pull request as ready for review April 2, 2026 00:40
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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.
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.

1 participant