Skip to content

Commit d7f783a

Browse files
committed
feat(docs): auto-generate driftable documentation sections
Eliminate documentation drift by generating content from source code: - configuration.md: env var reference generated from new centralized registry (src/lib/env-registry.ts) using the fragment pattern. Adds 6 previously undocumented env vars (SENTRY_FORCE_ENV_TOKEN, SENTRY_OUTPUT_FORMAT, SENTRY_MAX_PAGINATION_PAGES, SENTRY_INIT, SENTRY_CLI_NO_AUTO_REPAIR, FORCE_COLOR). - contributing.md: project structure tree generated from Stricli route tree (was listing 5 command dirs, now correctly shows 15+). - DEVELOPMENT.md & self-hosted.md: OAuth scopes generated from exported OAUTH_SCOPES array in oauth.ts (fixes missing team:write). - README.md: remove driftable commands table, point to docs site. New infrastructure: - src/lib/env-registry.ts: centralized env var metadata catalog - script/generate-docs-sections.ts: marker-based injection for committed files (GENERATED:START/END named markers) - generate-command-docs.ts extended to produce configuration.md - CI check:docs-sections validates markers aren't stale
1 parent fdd588f commit d7f783a

15 files changed

Lines changed: 834 additions & 363 deletions

.github/workflows/ci.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ jobs:
4343
- 'src/**'
4444
- 'docs/**'
4545
- 'package.json'
46+
- 'README.md'
47+
- 'DEVELOPMENT.md'
4648
- 'script/generate-skill.ts'
4749
- 'script/generate-command-docs.ts'
50+
- 'script/generate-docs-sections.ts'
4851
- 'script/eval-skill.ts'
4952
- 'test/skill-eval/**'
5053
code:
@@ -130,17 +133,26 @@ jobs:
130133
echo "stale=true" >> "$GITHUB_OUTPUT"
131134
echo "Skill files are out of date"
132135
fi
133-
- name: Auto-commit regenerated skill files
134-
if: steps.check-skill.outputs.stale == 'true' && steps.token.outcome == 'success'
136+
- name: Check docs sections
137+
id: check-sections
138+
run: |
139+
if git diff --quiet DEVELOPMENT.md docs/src/content/docs/contributing.md docs/src/content/docs/self-hosted.md; then
140+
echo "Docs sections are up to date"
141+
else
142+
echo "stale=true" >> "$GITHUB_OUTPUT"
143+
echo "Docs sections are out of date"
144+
fi
145+
- name: Auto-commit regenerated files
146+
if: (steps.check-skill.outputs.stale == 'true' || steps.check-sections.outputs.stale == 'true') && steps.token.outcome == 'success'
135147
run: |
136148
git config user.name "github-actions[bot]"
137149
git config user.email "github-actions[bot]@users.noreply.github.com"
138-
git add plugins/sentry-cli/skills/sentry-cli/
139-
git diff --cached --quiet || (git commit -m "chore: regenerate skill files" && git push)
140-
- name: Fail for fork PRs with stale skill files
141-
if: steps.check-skill.outputs.stale == 'true' && steps.token.outcome != 'success'
150+
git add plugins/sentry-cli/skills/sentry-cli/ DEVELOPMENT.md docs/src/content/docs/contributing.md docs/src/content/docs/self-hosted.md
151+
git diff --cached --quiet || (git commit -m "chore: regenerate docs" && git push)
152+
- name: Fail for fork PRs with stale generated files
153+
if: (steps.check-skill.outputs.stale == 'true' || steps.check-sections.outputs.stale == 'true') && steps.token.outcome != 'success'
142154
run: |
143-
echo "::error::Skill files are out of date. Run 'bun run generate:docs' locally and commit the result."
155+
echo "::error::Generated files are out of date. Run 'bun run generate:docs' locally and commit the result."
144156
exit 1
145157
146158
lint:

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ src/generated/
5858
src/sdk.generated.ts
5959
src/sdk.generated.d.cts
6060

61-
# Generated command docs (rebuilt from fragments + CLI introspection)
61+
# Generated docs pages (rebuilt from fragments + CLI introspection / env registry)
6262
docs/src/content/docs/commands/
63+
docs/src/content/docs/configuration.md
6364

6465
# Generated discovery manifest (rebuilt by generate:skill, served via symlinked skill files)
6566
docs/public/.well-known/skills/index.json

AGENTS.md

Lines changed: 61 additions & 56 deletions
Large diffs are not rendered by default.

DEVELOPMENT.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ When creating your Sentry OAuth application:
5959

6060
- **Redirect URI**: Not required for device flow
6161
- **Scopes**: The CLI requests these scopes:
62+
<!-- GENERATED:START oauth-scopes -->
6263
- `project:read`, `project:write`, `project:admin`
6364
- `org:read`
6465
- `event:read`, `event:write`
6566
- `member:read`
66-
- `team:read`
67+
- `team:read`, `team:write`
68+
<!-- GENERATED:END oauth-scopes -->
6769

6870
## Environment Variables
6971

README.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -68,24 +68,7 @@ sentry issue plan PROJ-ABC
6868

6969
## Commands
7070

71-
| Command | Description |
72-
|---------|-------------|
73-
| `sentry auth` | Login, logout, check authentication status |
74-
| `sentry org` | List and view organizations |
75-
| `sentry project` | List, view, create, and delete projects |
76-
| `sentry issue` | List, view, explain, and plan issues |
77-
| `sentry event` | View event details |
78-
| `sentry trace` | List and view distributed traces |
79-
| `sentry span` | List and view spans |
80-
| `sentry log` | List and view logs (with streaming) |
81-
| `sentry dashboard` | List, view, and create dashboards with widgets |
82-
| `sentry sourcemap` | Inject debug IDs and upload sourcemaps |
83-
| `sentry init` | Initialize Sentry in your project |
84-
| `sentry schema` | Browse the Sentry API schema |
85-
| `sentry api` | Make direct API requests |
86-
| `sentry cli` | Upgrade, setup, fix, and send feedback |
87-
88-
For detailed documentation, visit [cli.sentry.dev](https://cli.sentry.dev).
71+
Run `sentry --help` to see all available commands, or browse the [command reference](https://cli.sentry.dev/commands/).
8972

9073
## Configuration
9174

docs/src/content/docs/configuration.md

Lines changed: 0 additions & 252 deletions
This file was deleted.

0 commit comments

Comments
 (0)