Skip to content

docs(cli): Move remaining fragment examples into command metadata - #1633

Merged
BYK merged 4 commits into
mainfrom
byk/cli-examples-to-metadata
Oct 23, 2026
Merged

BYK merged 4 commits into
mainfrom
byk/cli-examples-to-metadata

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

The earlier docs.examples migration missed several fragments, and some newer commands added examples back to fragments or fullDescription. This PR moves every remaining Examples section into the owning command's docs.examples, so examples show up the same way in --help, the generated docs pages, and the skill references.

Fragments keep their explanatory prose under topical headings, like search syntax, multiple accounts, release workflow, and debug ID injection. Fragments that only held examples are now empty. Sample-output blocks that were part of the old Examples sections are dropped. The sentry issue route-group help also loses its duplicate Examples: list, because each of those commands already has its own examples.

The skill generator no longer pulls examples out of fragment markdown. Command metadata is now the only source, which removes the heading-to-command matching heuristics in generate-skill.ts and introspect.ts.

Two checks keep examples from coming back:

  • check:fragments (already part of ci:policy) now fails on any Examples heading in a command fragment, ignoring fenced code blocks.
  • A new oxlint rule, sentry-cli/no-examples-in-full-description, fails when a fullDescription in src/commands/** or src/app.ts contains an Examples: / Example: block. Validation/error messages and inline Example: … text are still allowed.

via BYK.

--

View Junior Session in Sentry

Move every remaining "Examples" section from the CLI docs fragments and
command fullDescription strings into each command's docs.examples so
examples render consistently in --help, the generated docs, and the
skill references. Fragments keep their explanatory prose under topical
headings.

The skill generator no longer harvests examples from fragment markdown;
command metadata is the only source.

Add enforcement so examples don't drift back:
- check:fragments rejects Examples headings in command fragments
- sentry-cli/no-examples-in-full-description rejects Examples blocks in
  command and route fullDescription strings

Co-Authored-By: BYK <burak.kaya@sentry.io>
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Oct 23, 2026 5:10pm UTC

Request Review

Comment thread packages/cli/src/commands/cli/defaults.ts
Comment thread packages/cli/src/commands/explore.ts
Remove the leftover `## Examples` block from `sentry cli defaults`
fullDescription (its docs.examples already render in help) and carry the
missing alias, agent-skills, graphics, and `--clear --yes` cases into
docs.examples. Fix the explore UTC-window example to use the supported
`..` range separator.

Extend no-examples-in-full-description to also reject markdown Examples
headings, which is how the defaults block slipped past the rule.
Comment thread packages/cli/script/check-fragments.ts Outdated
Replace regex-based markdown parsing in the doc scripts with the marked
lexer via new helpers in script/markdown.ts:

- check-fragments: find headings (Examples sections, subcommand
  coverage) from lexer tokens instead of stripping fences with regexes
- check-stale-references: blank code blocks with the lexer, keeping line
  numbers aligned so findings no longer need a line lookup
- generate-skill: extract sections, code blocks, and nested headings
  with the lexer. The old section regex treated `# comment` lines in
  bash blocks as headings and cut the Install Script section short, so
  the generated SKILL.md now includes the full install snippet.

The no-examples-in-full-description lint rule now also uses the marked
lexer. A new no-regex-markdown-parsing rule flags regexes that match
markdown headings or code fences in src/ and script/, and AGENTS.md
documents the convention.
Comment thread packages/cli/plugins/sentry-cli/skills/sentry-cli/references/alert.md Outdated
Comment thread packages/cli/plugins/sentry-cli/skills/sentry-cli/references/api.md Outdated
- alert issues edit: use the workflow-native {type, comparison,
  conditionResult} condition shape that the workflows API accepts,
  instead of the legacy class-path id
- api: add -X PUT to the nested-field example; GET sends -F fields as
  query params, so the example never built {options: {sampleRate}}

Both examples were carried over unchanged from the old help text.
@BYK
BYK merged commit 6a611d1 into main Oct 23, 2026
42 of 43 checks passed
@BYK
BYK deleted the byk/cli-examples-to-metadata branch October 23, 2026 20:21
sentry-junior Bot added a commit that referenced this pull request Oct 23, 2026
Resolve conflicts with #1633, which moved the remaining hand-written
examples into `docs.examples`: take main's version of the dashboard
commands and the alert/dashboard fragments, then regenerate the skill
references.

check:doc-examples now covers the migrated examples and flagged:
- `dashboard revisions` and `dashboard restore` examples that pass a bare
  `my-org` (a project lookup); changed to `my-org/`
- examples that start with `sudo` or `NAME=value`, which the check
  misread as the command name; it now skips those prefixes

Co-Authored-By: BYK <burak.kaya@sentry.io>
sentry-junior Bot added a commit that referenced this pull request Oct 23, 2026
#1633 added the `no-regex-markdown-parsing` lint rule. Replace the fenced
block regex with the shared `markdownCodeBlocks` / `blankCodeBlocks`
helpers in script/markdown.ts, which use the same lexer as the docs
renderer.

This branch was previously deployed

1 inactive deployment
Preview — d6dad559 Deployed Oct 23, 2026 by vercel[bot]
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