feat(platform): add sentry platform list command - #1366
Merged
Conversation
`sentry project create <name>` (missing platform) shows a curated "Common platforms" table but never told users how to see the full set of 113 valid identifiers. Add `sentry project platforms` (supports --search and --json) and point the error message at it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Move `sentry project platforms` to `sentry platform list`, matching the CLI's existing list-only noun convention (same shape as `team`/`repo`): a top-level route group with a single `list` subcommand, plus a `sentry platforms` plural shortcut wired the same way `app.ts` wires `repos`/`teams`. Platforms are validated for project creation but aren't project-scoped data, so they don't belong nested under `project`. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
sentry project platforms commandsentry platform list command
check:fragments requires every top-level route to have a docs fragment at apps/cli-docs/src/fragments/commands/<route>.md — the new `platform` route was missing one, failing the "Validate generated files" CI job. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
betegon
marked this pull request as ready for review
August 6, 2026 10:18
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.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ae8653c. Configure here.
Extracting renderPlatformGrid() into platforms.ts pulled static imports of formatters/markdown.js, formatters/table.js, and formatters/text-table.js into a module that complete.ts's shell-completion fast path statically imports for VALID_PLATFORMS/COMMON_PLATFORMS. Every `__complete` invocation was transitively loading chalk/marked/cli-highlight/ string-width/wrap-ansi — deps that fast path is explicitly designed to avoid (per its own file header: "no Stricli boot ... minimal startup time"). Flagged by Bugbot. Move renderPlatformGrid() to a new lib/platform-grid.ts that only project/create.ts and platform/list.ts import; platforms.ts goes back to importing just fuzzy.js's levenshtein, matching its pre-#1366 shape. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Commit 1f3deb0 (the original "add sentry project platforms command" commit) deleted the root AGENTS.md as an unrelated side effect of a .lore.md update in that same commit. Restore its content verbatim from main. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
betegon
enabled auto-merge (squash)
August 6, 2026 17:58
5 tasks
BYK
pushed a commit
that referenced
this pull request
Aug 11, 2026
…ons, dataset list (#1400) ## Documentation Audit Report (2026-08-10) Weekly automated audit of the Sentry CLI repository comparing documentation against implementation. --- ## Changes in This PR ### 1. AGENTS.md — Zod → Valibot migration drift (HIGH IMPACT) PR #1389 (merged 2026-08-07) removed all remaining Zod usage and migrated to Valibot. However, AGENTS.md was not updated, leaving AI agents with incorrect guidance that would produce non-compiling code. **Fixed:** - Renamed "Zod Schemas for Validation" → "Valibot Schemas for Validation" - Rewrote code examples to use the Valibot API (`object`, `string`, `optional`, `InferOutput`, `safeParse`) - Fixed import example from `import { z } from "zod"` → `import { object, string, optional } from "valibot"` - Fixed stale import path `../../lib/config.js` → `../../lib/db/auth.js` for `getAuthToken` - Updated architecture description ("TypeScript types and Zod schemas" → "Valibot schemas") - Updated "No Runtime Dependencies" rule ("redundant Zod schemas" → "redundant Valibot schemas") ### 2. Version pin examples — 0.40.0 → 0.42.2 The latest release is 0.42.2 (three minor versions ahead of the documented pin). **Fixed in:** - `apps/cli-docs/src/content/docs/getting-started.mdx` — `SENTRY_VERSION=0.40.0` → `0.42.2` - `packages/cli/install` — help text and examples updated from `0.40.0` → `0.42.2` ### 3. agent-guidance.md — Stale dashboard dataset list The documented dataset list used internal API names (`tracemetrics`, `error-events`) instead of user-facing aliases. Also missing `transactions` alias. **Fixed:** Updated to show user-facing names: `spans` (default), `errors`, `transactions`, `metrics`, `issue`, `logs`. --- ## Full Gap Report ### A. Undocumented or missing commands/subcommands **No gaps.** All commands in `src/commands/` have corresponding doc fragments in `apps/cli-docs/src/fragments/commands/`. Command docs are auto-generated from code metadata + fragments, so coverage is inherently complete. The new `platform` command (#1366) already has its fragment. ### B. Undocumented flags **No gaps.** Non-hidden flags are auto-generated into Options tables by the doc generator (`script/generate-command-docs.ts`). This was verified by checking the generated output for recent additions. ### C. Missing usage examples All command groups have bash examples in their fragments. Lower-priority gaps: - `sentry help --json` (new in #1337) has no dedicated example in the help fragment (only available via `--help`) - `sentry cli fix` fragment exists but is minimal ### D. Stale descriptions **No gaps found.** The `brief` strings in code match the generated doc descriptions. ### E. Missing route mappings in skill generator **Not applicable.** `ROUTE_TO_REFERENCE` was removed in favor of automatic 1:1 mapping via `groupRoutesByReference()`. All routes are automatically covered. ### F. Installation / distribution gaps | Gap | Source | Doc | |-----|--------|-----| | Install script `--no-modify-path` / `--no-completions` flags | `packages/cli/install` | Not in `getting-started.mdx` (available via `--help`) | | Two install URLs coexist: `cli.sentry.dev/install` vs `sentry.io/get-cli/` | redirect config | Not documented (redirect is transparent) | | **Version pin examples stale (0.40.0)** | install script, getting-started.mdx | **Fixed in this PR** | ### G. Undocumented environment variables **No gaps.** `configuration.md` is generated from `src/lib/env-registry.ts`, which is the single source of truth. Internal-only variables (`SENTRY_PIPELINE`, `SENTRY_MONITOR_SLUG`, etc.) are intentionally excluded. ### H. Auth / self-hosted gaps **No new gaps.** Self-hosted docs (26.1.0+ OAuth requirement, `SENTRY_CLIENT_ID`, trust anchors) are accurate. The new `sentry auth` smart default (login when logged out, status when logged in, PR #1380) is already documented in the auth fragment. ### I. Plugin/skills gaps Low-priority items (unchanged from prior audit): - `agent-skills.ts` only installs to `.claude` and `.agents` directories — other detected agents (Windsurf, Copilot, etc.) are detected for telemetry only, not skill installation - This is technically accurate in `agentic-usage.md` ("Skills are also refreshed... skill files are embedded in the binary") but could be clearer about which agents get auto-installed skills vs. which are only detected ### J. README / DEVELOPMENT.md drift | Gap | Source | Doc | |-----|--------|-----| | **AGENTS.md references Zod throughout** | `src/types/` uses Valibot after #1389 | **Fixed in this PR** | | AGENTS.md import example uses stale path `lib/config.js` | `getAuthToken` is in `lib/db/auth.js` | **Fixed in this PR** | --- ## Top 5 Most Impactful Fixes (Prioritized) 1. **✅ AGENTS.md Zod → Valibot** — AI agents will write non-compiling code using `import { z } from "zod"` because AGENTS.md instructs them to. This causes immediate build failures for any AI-assisted contribution. 2. **✅ Version pin examples** — Users following the install docs will pin to a version 3 releases behind, potentially missing security fixes and new features. 3. **✅ Dashboard dataset aliases** — Agents using the documented `tracemetrics` or `error-events` names work, but the user-facing aliases (`metrics`, `errors`) are more discoverable and match `--help` output. 4. **Low priority: `--no-modify-path` / `--no-completions` installer flags** — Power users in CI/Docker may want these, but they're available via `--help` on the script itself. 5. **Low priority: Skill install target clarification** — Only `.claude` and `.agents` get auto-installed skills; other agents are detected for telemetry only. This is technically correct in the docs but could be made more explicit. <div><a href="https://cursor.com/agents/bc-e1379371-9ad9-4d53-8665-bb60c5e961e0?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/automations/8b0c0f35-da5e-409d-984c-5e39518ffb8a"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/view-automation-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/view-automation-light.png"><img alt="View Automation" width="141" height="28" src="https://cursor.com/assets/images/view-automation-dark.png"></picture></a> </div> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Miguel Betegón <miguelbetegongarcia@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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
sentry project create <name>with no platform shows a curated "Common platforms" table (26 entries) but never told users how to see the full set of valid identifiers.sentry platform list— lists all 113 valid Sentry platform identifiers (VALID_PLATFORMS), with--search <term>substring filtering and--jsonoutput. Purely local/static data,auth: false. Plus thesentry platformsplural shortcut, following the CLI's existing list-only noun convention (same shape asteam/repo, wired intoapp.tsthe same way).platformGrid()increate.ts) intolib/platforms.tsasrenderPlatformGrid()so both the error message and the new command use the same rendering.buildPlatformError()now adds:Run 'sentry platform list' to see all valid platform identifiers.right after the curated table.(This started as a nested
sentry project platformscommand, then got promoted to a top-levelplatformnoun to match the aesthetic of other list-only command groups — see commit history.)Test plan
test/commands/platform/list.test.ts(default list,--json,--search,--search --json, no-match exits non-zero)test/commands/project/create.test.tsupdated with an assertion for the new hint linepnpm exec tsc --noEmit— no new errors (pre-existing baseline errors unrelated to this change, verified viagit stashdiff)pnpm run lint— cleansentry platform list,sentry platforms(shortcut, identical output),sentry platform list --search go,sentry platform --help,sentry project create cli, and a no-match searchvitest run: confirmed pre-existing e2e timeout flakiness (org/project/feedback/multiregion/telemetry-exit) reproduces identically onmainwith no changes — unrelated to this diff🤖 Generated with Claude Code