Skip to content

feat(commands): rename get commands to view and add -w browser flag#53

Merged
BYK merged 5 commits intomainfrom
feat/rename-get-to-view-with-browser-flag
Jan 23, 2026
Merged

feat(commands): rename get commands to view and add -w browser flag#53
BYK merged 5 commits intomainfrom
feat/rename-get-to-view-with-browser-flag

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Jan 23, 2026

Summary

  • Rename all get commands to view for better UX
  • Add -w / --web flag to open entities in browser with QR code fallback

Changes

Commands Renamed

Old New
sentry org get sentry org view
sentry project get sentry project view
sentry issue get sentry issue view
sentry event get sentry event view

New -w / --web Flag

All view commands now support a -w flag that opens the entity in the browser:

  • Opens browser if available
  • Falls back to displaying URL + QR code (same pattern as sentry auth login)

New Utilities

  • src/lib/sentry-urls.ts - URL builders for Sentry web pages (supports self-hosted via SENTRY_URL env var)
  • openOrShowUrl() helper in src/lib/browser.ts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 23, 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 ✨

  • (commands) Rename get commands to view and add -w browser flag by BYK in #53
  • (issue) Add short ID aliases for multi-project support by BYK in #31

Bug Fixes 🐛

  • (issue) Use org-scoped endpoint for latest event + enhanced display by betegon in #40

Internal Changes 🔧

  • (release) Fix changelog-preview permissions by BYK in #41
  • Rename config folder from .sentry-cli-next to .sentry by BYK in #50

🤖 This preview updates automatically when you update the PR.

Rename all `get` commands to `view` for better UX:
- `sentry org get` → `sentry org view`
- `sentry project get` → `sentry project view`
- `sentry issue get` → `sentry issue view`
- `sentry event get` → `sentry event view`

Add `-w` / `--web` flag to all view commands that opens the entity
in the browser. If browser launch fails (headless environment, etc.),
falls back to displaying the URL with a QR code - reusing the pattern
from `sentry auth login`.

New utilities:
- `src/lib/sentry-urls.ts`: URL builders for Sentry web pages
- `openOrShowUrl()` helper in `src/lib/browser.ts`
@BYK BYK force-pushed the feat/rename-get-to-view-with-browser-flag branch from a4903e4 to 619758c Compare January 23, 2026 14:05
BYK added 2 commits January 23, 2026 14:19
Unify the browser + fallback logic in auth login with view commands:
- Use openOrShowUrl helper instead of inline browser + QR logic
- Remove --qr flag (QR is always shown when browser can't open)
- Only show manual URL/code when browser fails to open
@BYK BYK marked this pull request as ready for review January 23, 2026 14:30
@BYK BYK enabled auto-merge (squash) January 23, 2026 14:30
BYK added 2 commits January 23, 2026 14:37
- Fix tabs to spaces formatting in view commands
- Refactor issue/view.ts to reduce cognitive complexity from 16 to <15
- Refactor project/view.ts to reduce cognitive complexity from 16 to <15
- Fix flag alias syntax (move from individual flags to parameters.aliases)
Rename command references in E2E tests to match the CLI changes:
- issue get → issue view
- event get → event view
- org get → org view
- project get → project view
@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

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

Files with missing lines (18)
File Patch % Lines
human.ts 9.42% ⚠️ 731 Missing
oauth.ts 21.71% ⚠️ 202 Missing
api-client.ts 48.43% ⚠️ 115 Missing
resolver.ts 3.77% ⚠️ 102 Missing
errors.ts 5.94% ⚠️ 95 Missing
fixture.ts 28.74% ⚠️ 62 Missing
api.ts 66.30% ⚠️ 61 Missing
errors.ts 51.61% ⚠️ 60 Missing
config.ts 83.73% ⚠️ 34 Missing
preload.ts 39.02% ⚠️ 25 Missing
detector.ts 87.79% ⚠️ 16 Missing
cache.ts 76.27% ⚠️ 14 Missing
colors.ts 85.42% ⚠️ 7 Missing
index.ts 95.06% ⚠️ 4 Missing
parser.ts 93.75% ⚠️ 4 Missing
env-file.ts 97.17% ⚠️ 3 Missing
alias.ts 96.43% ⚠️ 2 Missing
java.ts 97.22% ⚠️ 1 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    54.90%    54.90%        —%
==========================================
  Files           33        33         —
  Lines         3410      3410         —
  Branches         0         0         —
==========================================
+ Hits          1872      1872         —
- Misses        1538      1538         —
- Partials         0         0         —

Generated by Codecov Action

@BYK BYK merged commit 5d2b8d0 into main Jan 23, 2026
15 checks passed
@BYK BYK deleted the feat/rename-get-to-view-with-browser-flag branch January 23, 2026 14:42
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.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

orgSlug = projectEntry.orgSlug;
issue = await getIssueByShortId(orgSlug, resolvedShortId);
resolved =
aliasResult ?? (await resolveShortSuffixId(issueId, flags, cwd));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Alias fallback bypasses short ID handling for hyphenated IDs

High Severity

The refactored issue ID resolution logic breaks handling of standard short IDs like "CRAFT-G" or "PROJECT-123". The ALIAS_SUFFIX_PATTERN matches any input with a hyphen, so parseAliasSuffix("CRAFT-G") returns {alias: "craft", suffix: "G"}. When the alias "craft" isn't found in the cache, the code falls back to resolveShortSuffixId, which incorrectly tries to expand "CRAFT-G" as a short suffix rather than treating it as a full short ID.

The original code checked if (aliasSuffix && projectEntry), falling through to isShortId() when the alias wasn't in cache. The new code only checks if (aliasSuffix), so the isShortId branch is now unreachable for any hyphenated input.

Fix in Cursor Fix in Web

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