Skip to content

docs: add missing command pages for trace, span, sourcemap, repo, trial, schema#569

Merged
BYK merged 10 commits intomainfrom
docs/add-missing-command-pages
Mar 27, 2026
Merged

docs: add missing command pages for trace, span, sourcemap, repo, trial, schema#569
BYK merged 10 commits intomainfrom
docs/add-missing-command-pages

Conversation

@sergical
Copy link
Copy Markdown
Member

Summary

  • Add 6 missing docs pages for commands that were implemented but undocumented on the website
  • Add 7 missing entries to the commands index table (dashboard was also missing)

New pages: trace.md, span.md, sourcemap.md, repo.md, trial.md, schema.md

All content derived from source code docs fields and flag definitions. Format matches existing pages (event.md, log.md, etc.).

Audit findings:

  • SKILL.md was already complete (all commands documented)
  • All reference files exist and are correctly linked
  • Only website docs had gaps

Test plan

  • Verify docs build: cd docs && bun run build
  • Review each page for accuracy against sentry <command> --help

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 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 ✨

Dashboard

  • Add pagination and glob filtering to dashboard list by BYK in #560
  • Add a full chart rendering engine for sentry dashboard view that transforms widget data into rich terminal visualizations. by BYK in #555

Init

  • Propagate sentry-trace headers to wizard API calls by betegon in #567
  • Treat bare slug as new project name when not found by BYK in #554

Other

  • (formatters) Colorize SQL in DB span descriptions by BYK in #546
  • (output) Add Zod schema registration to OutputConfig for self-documenting JSON fields by BYK in #582
  • (telemetry) Report unknown commands to Sentry by BYK in #563
  • Bidirectional cursor pagination (-c next / -c prev) by BYK in #564
  • Add sentry sourcemap inject and sentry sourcemap upload commands by BYK in #547
  • Native debug ID injection and sourcemap upload by BYK in #543

Bug Fixes 🐛

Dashboard

  • Fix table widget rendering and timeseries bar chart width by BYK in #584
  • Validate display types against all datasets by betegon in #577
  • Auto-clamp widget limit instead of erroring by BYK in #573
  • Default issue dataset table columns to ["issue"] by betegon in #570
  • Scale timeseries bar width to fill chart area by BYK in #562
  • Resolve dashboard by ID/slug in addition to title by BYK in #559

Event

  • Detect SHORT-ID/EVENT-ID format in event view by BYK in #574
  • Auto-fallback to org-wide search when event 404s in project by BYK in #575

Other

  • (api) Show meaningful message for network errors instead of '0 Unknown' by BYK in #572
  • (event-view) Auto-redirect issue short IDs in two-arg form (CLI-MP) by BYK in #558
  • (help) Show help when user passes help as positional arg by BYK in #561
  • (issue) Auto-redirect bare org slug to org-all mode in issue list by BYK in #576
  • (log) Use 30d default period and show newest logs first by sergical in #568
  • Reject @-selectors in parseOrgProjectArg with helpful redirect by BYK in #557

Documentation 📚

  • Add missing command pages for trace, span, sourcemap, repo, trial, schema by sergical in #569

Internal Changes 🔧

Coverage

  • Use informational-patch input instead of sed hack by BYK in #544
  • Make checks informational on release branches by BYK in #541

Event

  • Replace "latest" magic string with @latest sentinel constant by BYK in #583
  • Deduplicate span tree building into shared helper by BYK in #581

Other

  • (api) Collapse stats on issue detail endpoints to save 100-300ms by BYK in #551
  • (ci) Upgrade GitHub Actions to Node 24 runtime by BYK in #542
  • (db) DRY up database layer with shared helpers and lint enforcement by BYK in #550
  • (docs) Polish sidebar, header, focus, and code block UX by sergical in #580
  • (issue-list) Use collapse parameter to skip unused Snuba queries by BYK in #545
  • Bump Bun from 1.3.9 to 1.3.11 by BYK in #552
  • Regenerate skill files by github-actions[bot] in ec1ffe28

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/pr-preview/pr-569/

Built to branch gh-pages at 2026-03-27 01:41 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

Codecov Results 📊

126 passed | Total: 126 | 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 1285 uncovered lines.
✅ Project coverage is 95.51%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    95.51%    95.51%        —%
==========================================
  Files          194       194         —
  Lines        28590     28620       +30
  Branches         0         0         —
==========================================
+ Hits         27305     27335       +30
- Misses        1285      1285         —
- Partials         0         0         —

Generated by Codecov Action

@sergical sergical marked this pull request as ready for review March 26, 2026 15:19
@BYK BYK force-pushed the docs/add-missing-command-pages branch from e805f7f to 4a1dc23 Compare March 27, 2026 00:11
sergical and others added 2 commits March 27, 2026 00:13
…al, schema

6 commands were implemented but had no website docs pages.
Also adds dashboard, trace, span, sourcemap, repo, trial, and schema
to the commands index table.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace hand-written command doc pages with auto-generated reference
sections extracted from Stricli route tree introspection. This fixes
pervasive documentation drift: phantom flags (--include, --paginate,
--channel), missing flags (--fresh, --fields, --cursor, --period,
--spans), and missing aliases across all command pages.

Each doc page now has two parts separated by a GENERATED:END marker:
1. Auto-generated reference (args, options tables) — from source code
2. Hand-written custom content (examples, guides) — preserved on regen

New infrastructure:
- script/generate-command-docs.ts: generates reference sections
- script/check-command-docs.ts: CI freshness checker
- src/lib/introspect.ts: add extractPositionals() for arg tables
- CI auto-commits regenerated docs alongside skill files

Also adds extractPositionals() and PositionalInfo type to introspect.ts
for structured positional argument metadata.
@BYK BYK force-pushed the docs/add-missing-command-pages branch from 4a1dc23 to 4ed54da Compare March 27, 2026 00:14
BYK added 2 commits March 27, 2026 00:19
Restore hand-written content that was lost during the migration to
auto-generated reference sections:

- dashboard.md: query/sort shorthand tables, detailed widget examples,
  sample terminal output for list/view/create
- cli.md: release channels table, installation detection table,
  nightly migration note, channel switching examples
- auth.md: OAuth flow walkthrough, self-hosted setup, environment
  variable precedence, auth status sample output
- init.md: experimental warning, features table, target syntax table,
  what the wizard does, supported platforms
- api.md: PUT/DELETE examples, verbose mode, API docs link
- issue.md: explain/plan multi-format examples, behavioral notes
- log.md: full sample output with section dividers, filter examples,
  jq pipe example
- org.md, project.md: sample terminal output
- event.md: Context section in output, open-in-browser example

Also fix non-descriptive <args...> placeholders by adding descriptive
placeholder values to 7 commands (dashboard view/create, widget
add/edit/delete, event view, log view). Updates AGENTS.md to
explicitly ban 'args' as a placeholder value.
BYK added 3 commits March 27, 2026 00:50
The placeholder fix surfaced these commands to the drift detection
test since they now have org-containing placeholders.
- api.md: remove /api/0/ prefix from all examples (endpoints are
  relative to /api/0/ as documented in the arguments table)
- event.md: use full 32-char hex event ID in examples (was 12 chars)
- init.md: fix feature name 'replays' -> 'replay' (singular)
- log.md: fix jq example to use .data[] envelope and .severity field
  (not .level), fix misleading 'trace IDs in brackets' text
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 prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Array positionals unconditionally marked optional produces contradictory docs
    • Updated extractPositionals to respect params.parameter.optional for array positionals instead of hardcoding true, preventing spurious '(optional)' in docs.

Create PR

Or push these changes by commenting:

@cursor push 4bee79d0bf
Preview (4bee79d0bf)
diff --git a/src/lib/introspect.ts b/src/lib/introspect.ts
--- a/src/lib/introspect.ts
+++ b/src/lib/introspect.ts
@@ -231,7 +231,8 @@
       {
         placeholder: `${params.parameter.placeholder ?? "args"}...`,
         brief: params.parameter.brief ?? "",
-        optional: true,
+        // Respect the source definition if provided; default to required (false)
+        optional: params.parameter.optional ?? false,
       },
     ];
   }

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

BYK added 3 commits March 27, 2026 01:21
…al args

The brief text from source code already communicates optionality
(e.g., 'Target (optional) and trace ID (required)'). Appending a
blanket '(optional)' suffix to all array positionals produced
contradictions like 'trace ID (required) (optional)'.
…om route tree

Two root causes for missing skill examples:
1. COMMAND_SECTION_REGEX used \S+ which matched <placeholder> text,
   causing command paths like 'sentry api <endpoint>' instead of
   'sentry api'. Fixed with [^\s<]+ to stop at angle brackets.
2. The regex only matched up to 2 words after 'sentry', missing
   3-word paths like 'sentry dashboard widget add'. Fixed with
   {1,3} quantifier.
3. extractSectionExamples only registered command paths when code
   blocks existed in the section. Fixed to always register paths
   so extractLooseExamples can match custom-section examples.

Also replaced the manual INDEX_ORDER constant in generate-command-docs.ts
with the natural order from extractAllRoutes() (preserves insertion
order from app.ts's buildRouteMap).
…check

Replace fragile regex-based markdown parsing in generate-skill.ts with
marked.lexer() AST walking for robust command heading detection and
code block association. The old COMMAND_SECTION_REGEX was brittle with
positional placeholders in headings and couldn't handle the split
between auto-generated reference sections and hand-written custom
sections.

The new approach:
1. Parses the full document into an AST via marked.lexer()
2. Collects command paths from ### `sentry ...` headings
3. Walks tokens sequentially, associating bash code blocks with
   commands by heading context or content matching

Also adds an examples completeness check to check-skill.ts that
verifies every skill reference file contains at least one Examples
section. This catches cases where doc pages are missing bash code
blocks that the skill generator needs.
@BYK BYK merged commit d88e735 into main Mar 27, 2026
23 checks passed
@BYK BYK deleted the docs/add-missing-command-pages branch March 27, 2026 01:49
BYK added a commit that referenced this pull request Mar 30, 2026
Fix genuine documentation gaps not covered by auto-generation (#569):
- Add SENTRY_AUTH_TOKEN/SENTRY_TOKEN to configuration.md
- Add SENTRY_INSTALL_DIR/SENTRY_NO_CACHE to configuration.md
- Add project:admin scope to DEVELOPMENT.md and self-hosted.md
- Expand README commands table from 6 to 14 entries
- Fix credential storage path (config.db -> cli.db) in auth docs
- Fix SENTRY_AUTH_TOKEN priority label (was marked legacy, is primary)
- Add missing examples for auth logout/refresh/token, project
  create/delete, cli setup
- Align curl install flags (-fsS) between README and docs site

Close automation gap from #569: make generate-skill.ts auto-update
the REFERENCE_FILES array in agent-skills.ts so new command groups
are automatically included in runtime skill installation. Extend
check-skill.ts to detect drift in agent-skills.ts and update CI
auto-commit to include the file.
BYK added a commit that referenced this pull request Mar 30, 2026
Fix genuine documentation gaps not covered by auto-generation (#569):
- Add SENTRY_AUTH_TOKEN/SENTRY_TOKEN to configuration.md
- Add SENTRY_INSTALL_DIR/SENTRY_NO_CACHE to configuration.md
- Add project:admin scope to DEVELOPMENT.md and self-hosted.md
- Expand README commands table from 6 to 14 entries
- Fix credential storage path (config.db -> cli.db) in auth docs
- Fix SENTRY_AUTH_TOKEN priority label (was marked legacy, is primary)
- Add missing examples for auth logout/refresh/token, project
  create/delete, cli setup
- Align curl install flags (-fsS) between README and docs site

Embed skill files at build time instead of fetching from GitHub:
- generate-skill.ts now produces src/generated/skill-content.ts that
  inlines all skill file contents as a Map<string, string>
- agent-skills.ts imports the embedded content and writes it directly
  to ~/.claude/skills/ — no network fetch, no URL construction, no
  REFERENCE_FILES array, no version-pinning logic
- check-skill.ts verifies skill-content.ts stays in sync
- generate:skill chained before build/dev/typecheck in package.json

This eliminates the CLI -> GitHub -> CLI roundtrip where skill files
generated from the source code were fetched back from GitHub at runtime.
BYK added a commit that referenced this pull request Mar 30, 2026
Fix genuine documentation gaps not covered by auto-generation (#569):
- Add SENTRY_AUTH_TOKEN/SENTRY_TOKEN to configuration.md
- Add SENTRY_INSTALL_DIR/SENTRY_NO_CACHE to configuration.md
- Add project:admin scope to DEVELOPMENT.md and self-hosted.md
- Expand README commands table from 6 to 14 entries
- Fix credential storage path (config.db -> cli.db) in auth docs
- Fix SENTRY_AUTH_TOKEN priority label (was marked legacy, is primary)
- Add missing examples for auth logout/refresh/token, project
  create/delete, cli setup
- Align curl install flags (-fsS) between README and docs site

Embed skill files at build time instead of fetching from GitHub:
- generate-skill.ts now produces src/generated/skill-content.ts that
  inlines all skill file contents as a Map<string, string>
- agent-skills.ts imports the embedded content and writes it directly
  to ~/.claude/skills/ — no network fetch, no URL construction, no
  REFERENCE_FILES array, no version-pinning logic
- check-skill.ts verifies skill-content.ts stays in sync
- generate:skill chained before build/dev/typecheck in package.json

This eliminates the CLI -> GitHub -> CLI roundtrip where skill files
generated from the source code were fetched back from GitHub at runtime.
BYK added a commit that referenced this pull request Mar 30, 2026
Fix genuine documentation gaps not covered by auto-generation (#569):
- Add SENTRY_AUTH_TOKEN/SENTRY_TOKEN to configuration.md
- Add SENTRY_INSTALL_DIR/SENTRY_NO_CACHE to configuration.md
- Add project:admin scope to DEVELOPMENT.md and self-hosted.md
- Expand README commands table from 6 to 14 entries
- Fix credential storage path (config.db -> cli.db) in auth docs
- Fix SENTRY_AUTH_TOKEN priority label (was marked legacy, is primary)
- Add missing examples for auth logout/refresh/token, project
  create/delete, cli setup
- Align curl install flags (-fsS) between README and docs site

Embed skill files at build time instead of fetching from GitHub:
- generate-skill.ts now produces src/generated/skill-content.ts that
  inlines all skill file contents as a Map<string, string>
- agent-skills.ts imports the embedded content and writes it directly
  to ~/.claude/skills/ — no network fetch, no URL construction, no
  REFERENCE_FILES array, no version-pinning logic
- check-skill.ts verifies skill-content.ts stays in sync
- generate:skill chained before build/dev/typecheck in package.json

This eliminates the CLI -> GitHub -> CLI roundtrip where skill files
generated from the source code were fetched back from GitHub at runtime.
BYK added a commit that referenced this pull request Mar 30, 2026
Fix genuine documentation gaps not covered by auto-generation (#569):
- Add SENTRY_AUTH_TOKEN/SENTRY_TOKEN to configuration.md
- Add SENTRY_INSTALL_DIR/SENTRY_NO_CACHE to configuration.md
- Add project:admin scope to DEVELOPMENT.md and self-hosted.md
- Expand README commands table from 6 to 14 entries
- Fix credential storage path (config.db -> cli.db) in auth docs
- Fix SENTRY_AUTH_TOKEN priority label (was marked legacy, is primary)
- Add missing examples for auth logout/refresh/token, project
  create/delete, cli setup
- Align curl install flags (-fsS) between README and docs site

Embed skill files at build time instead of fetching from GitHub:
- generate-skill.ts now produces src/generated/skill-content.ts that
  inlines all skill file contents as a Map<string, string>
- agent-skills.ts imports the embedded content and writes it directly
  to ~/.claude/skills/ — no network fetch, no URL construction, no
  REFERENCE_FILES array, no version-pinning logic
- check-skill.ts verifies skill-content.ts stays in sync
- generate:skill chained before build/dev/typecheck in package.json

This eliminates the CLI -> GitHub -> CLI roundtrip where skill files
generated from the source code were fetched back from GitHub at runtime.
BYK added a commit that referenced this pull request Mar 30, 2026
Fix genuine documentation gaps not covered by auto-generation (#569):
- Add SENTRY_AUTH_TOKEN/SENTRY_TOKEN to configuration.md
- Add SENTRY_INSTALL_DIR/SENTRY_NO_CACHE to configuration.md
- Add project:admin scope to DEVELOPMENT.md and self-hosted.md
- Expand README commands table from 6 to 14 entries
- Fix credential storage path (config.db -> cli.db) in auth docs
- Fix SENTRY_AUTH_TOKEN priority label (was marked legacy, is primary)
- Add missing examples for auth logout/refresh/token, project
  create/delete, cli setup
- Align curl install flags (-fsS) between README and docs site

Embed skill files at build time instead of fetching from GitHub:
- generate-skill.ts now produces src/generated/skill-content.ts that
  inlines all skill file contents as a Map<string, string>
- agent-skills.ts imports the embedded content and writes it directly
  to ~/.claude/skills/ — no network fetch, no URL construction, no
  REFERENCE_FILES array, no version-pinning logic
- check-skill.ts verifies skill-content.ts stays in sync
- generate:skill chained before build/dev/typecheck in package.json

This eliminates the CLI -> GitHub -> CLI roundtrip where skill files
generated from the source code were fetched back from GitHub at runtime.
BYK added a commit that referenced this pull request Mar 30, 2026
## Summary

Fix genuine documentation gaps not covered by the auto-generation
infrastructure in #569, and eliminate the CLI → GitHub → CLI roundtrip
for skill file installation.

## Documentation fixes

- **Add `SENTRY_AUTH_TOKEN` and `SENTRY_TOKEN` to `configuration.md`** —
primary CI/CD auth variables were missing from the env vars reference
- **Add `SENTRY_INSTALL_DIR` and `SENTRY_NO_CACHE` to
`configuration.md`** — undocumented env vars
- **Add `project:admin` to OAuth scopes** in `DEVELOPMENT.md` and
`self-hosted.md` — code requests 8 scopes but docs listed only 7;
self-hosted users creating API tokens with the documented scopes would
get permission errors
- **Expand README commands table** from 6 to 14 entries
- **Add missing examples** for `auth logout`, `auth refresh`, `auth
token`, `project create`, `project delete`, `cli setup`
- **Fix `config.db` → `cli.db`** in auth credential storage docs
- **Fix `SENTRY_AUTH_TOKEN` priority label** — was incorrectly marked
"legacy"; it is the primary env var
- **Align curl install flags** (`-fsS`) between README and docs site

## Embed skill files at build time

Previously, `sentry cli setup` fetched skill files from GitHub at
runtime — fetching content that was generated from the CLI's own source
code. This was a roundtrip: the CLI generates skill files from Stricli
introspection, they live in the repo, and then the CLI fetches them back
from GitHub by URL, using a hardcoded `REFERENCE_FILES` array that
required codegen to keep in sync.

Now:
- `generate-skill.ts` produces `src/generated/skill-content.ts` that
inlines all skill file contents (~47KB) as a `Map<string, string>`
- `agent-skills.ts` imports the embedded content and writes it directly
to `~/.claude/skills/` — no network fetch, no URL construction, no
version-pinning logic
- `REFERENCE_FILES` array, `getSkillUrl()`, `fetchSingleFile()`,
`fetchAllSkillFiles()`, `fetchSkillContent()` — all removed
- `generate:skill` is chained before `build`/`dev`/`typecheck`/`test` in
`package.json` (like `generate:sdk`)
- `check-skill.ts` verifies `skill-content.ts` stays in sync with
generated markdown files

Co-authored-by: Burak Yigit Kaya <byk@sentry.io>
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.

3 participants