Skip to content

Commit e97249f

Browse files
cursor[bot]BYK
andauthored
docs: fix documentation gaps and embed skill files at build time (#606)
## 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>
1 parent dc8684b commit e97249f

File tree

19 files changed

+282
-474
lines changed

19 files changed

+282
-474
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ jobs:
126126
git config user.name "github-actions[bot]"
127127
git config user.email "github-actions[bot]@users.noreply.github.com"
128128
git add plugins/sentry-cli/skills/sentry-cli/ docs/public/.well-known/skills/index.json docs/src/content/docs/commands/
129-
git commit -m "chore: regenerate skill files and command docs"
130-
git push
129+
git diff --cached --quiet || (git commit -m "chore: regenerate skill files and command docs" && git push)
131130
- name: Fail for fork PRs with stale generated files
132131
if: (steps.check-skill.outcome == 'failure' || steps.check-docs.outcome == 'failure') && steps.token.outcome != 'success'
133132
run: |

AGENTS.md

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

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ When creating your Sentry OAuth application:
5959

6060
- **Redirect URI**: Not required for device flow
6161
- **Scopes**: The CLI requests these scopes:
62-
- `project:read`, `project:write`
62+
- `project:read`, `project:write`, `project:admin`
6363
- `org:read`
6464
- `event:read`, `event:write`
6565
- `member:read`

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
### Install Script (Recommended)
2020

2121
```bash
22-
curl -fsSL https://cli.sentry.dev/install | bash
22+
curl https://cli.sentry.dev/install -fsS | bash
2323
```
2424

2525
### Homebrew
@@ -72,10 +72,18 @@ sentry issue plan PROJ-ABC
7272
|---------|-------------|
7373
| `sentry auth` | Login, logout, check authentication status |
7474
| `sentry org` | List and view organizations |
75-
| `sentry project` | List and view projects |
75+
| `sentry project` | List, view, create, and delete projects |
7676
| `sentry issue` | List, view, explain, and plan issues |
7777
| `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 |
7885
| `sentry api` | Make direct API requests |
86+
| `sentry cli` | Upgrade, setup, fix, and send feedback |
7987

8088
For detailed documentation, visit [cli.sentry.dev](https://cli.sentry.dev).
8189

docs/src/content/docs/commands/auth.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,24 @@ SENTRY_URL=https://sentry.example.com sentry auth login --token YOUR_TOKEN
9696

9797
See [Self-Hosted Sentry](../self-hosted/) for details.
9898

99+
### Logout
100+
101+
```bash
102+
sentry auth logout
103+
```
104+
105+
### Refresh token
106+
107+
```bash
108+
sentry auth refresh
109+
```
110+
111+
### Print stored token
112+
113+
```bash
114+
sentry auth token
115+
```
116+
99117
### Check auth status
100118

101119
```bash
@@ -118,14 +136,14 @@ sentry auth whoami
118136

119137
## Credential Storage
120138

121-
Auth tokens are stored in a SQLite database at `~/.sentry/config.db` with restricted file permissions.
139+
Auth tokens are stored in a SQLite database at `~/.sentry/cli.db` with restricted file permissions.
122140

123141
## Environment Variable Precedence
124142

125143
The CLI checks for auth tokens in the following order, using the first one found:
126144

127-
1. `SENTRY_AUTH_TOKEN` environment variable (legacy)
128-
2. `SENTRY_TOKEN` environment variable
129-
3. The stored token in the SQLite database
145+
1. `SENTRY_AUTH_TOKEN` environment variable
146+
2. `SENTRY_TOKEN` environment variable (legacy alias)
147+
3. The stored OAuth token in the SQLite database
130148

131149
When a token comes from an environment variable, the CLI skips expiry checks and automatic refresh.

docs/src/content/docs/commands/cli.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,16 @@ Feedback is sent via Sentry's telemetry system. If telemetry is disabled (`SENTR
144144
```bash
145145
sentry cli fix
146146
```
147+
148+
### Configure shell integration
149+
150+
```bash
151+
# Run full setup (PATH, completions, agent skills)
152+
sentry cli setup
153+
154+
# Skip agent skill installation
155+
sentry cli setup --no-agent-skills
156+
157+
# Skip PATH and completion modifications
158+
sentry cli setup --no-modify-path --no-completions
159+
```

docs/src/content/docs/commands/project.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,26 @@ DSN: https://abc123@sentry.io/123456
117117
# Open project in browser
118118
sentry project view my-org/frontend -w
119119
```
120+
121+
### Create a project
122+
123+
```bash
124+
# Create a new project
125+
sentry project create my-new-app javascript-nextjs
126+
127+
# Create under a specific org and team
128+
sentry project create my-org/my-new-app python --team backend-team
129+
130+
# Preview without creating
131+
sentry project create my-new-app node --dry-run
132+
```
133+
134+
### Delete a project
135+
136+
```bash
137+
# Delete a project (will prompt for confirmation)
138+
sentry project delete my-org/old-project
139+
140+
# Delete without confirmation
141+
sentry project delete my-org/old-project --yes
142+
```

docs/src/content/docs/configuration.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ The Sentry CLI can be configured through environment variables and a local datab
77

88
## Environment Variables
99

10+
### `SENTRY_AUTH_TOKEN`
11+
12+
Authentication token for the Sentry API. This is the primary way to authenticate in CI/CD pipelines and scripts where interactive login is not possible.
13+
14+
```bash
15+
export SENTRY_AUTH_TOKEN=sntrys_YOUR_TOKEN_HERE
16+
```
17+
18+
You can create auth tokens in your [Sentry account settings](https://sentry.io/settings/account/api/auth-tokens/). When set, this takes precedence over any stored OAuth token from `sentry auth login`.
19+
20+
### `SENTRY_TOKEN`
21+
22+
Legacy alias for `SENTRY_AUTH_TOKEN`. If both are set, `SENTRY_AUTH_TOKEN` takes precedence.
23+
1024
### `SENTRY_HOST`
1125

1226
Base URL of your Sentry instance. **Only needed for [self-hosted Sentry](./self-hosted/).** SaaS users (sentry.io) should not set this.
@@ -125,6 +139,22 @@ Disable the automatic update check that runs periodically in the background.
125139
export SENTRY_CLI_NO_UPDATE_CHECK=1
126140
```
127141

142+
### `SENTRY_INSTALL_DIR`
143+
144+
Override the directory where the CLI binary is installed. Used by the install script and `sentry cli upgrade` to control the binary location.
145+
146+
```bash
147+
export SENTRY_INSTALL_DIR=/usr/local/bin
148+
```
149+
150+
### `SENTRY_NO_CACHE`
151+
152+
Disable API response caching. When set, the CLI will not cache API responses and will always make fresh requests.
153+
154+
```bash
155+
export SENTRY_NO_CACHE=1
156+
```
157+
128158
## Global Options
129159

130160
These flags are accepted by every command. They are not shown in individual command `--help` output, but are always available.

docs/src/content/docs/self-hosted.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export SENTRY_CLIENT_ID=your-client-id
4444
If your instance is on an older version or you prefer not to create an OAuth application, you can use an API token instead:
4545

4646
1. Go to **Settings → Developer Settings → Personal Tokens** in your Sentry instance (or visit `https://sentry.example.com/settings/account/api/auth-tokens/new-token/`)
47-
2. Create a new token with the following scopes: `project:read`, `project:write`, `org:read`, `event:read`, `event:write`, `member:read`, `team:read`
47+
2. Create a new token with the following scopes: `project:read`, `project:write`, `project:admin`, `org:read`, `event:read`, `event:write`, `member:read`, `team:read`
4848
3. Pass it to the CLI:
4949

5050
```bash

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,17 @@
7272
"@sentry/node-core@10.44.0": "patches/@sentry%2Fnode-core@10.44.0.patch"
7373
},
7474
"scripts": {
75-
"dev": "bun run generate:schema && bun run generate:sdk && bun run src/bin.ts",
76-
"build": "bun run generate:schema && bun run generate:sdk && bun run script/build.ts --single",
77-
"build:all": "bun run generate:schema && bun run generate:sdk && bun run script/build.ts",
78-
"bundle": "bun run generate:schema && bun run generate:sdk && bun run script/bundle.ts",
79-
"typecheck": "bun run generate:sdk && tsc --noEmit",
75+
"dev": "bun run generate:schema && bun run generate:skill && bun run generate:sdk && bun run src/bin.ts",
76+
"build": "bun run generate:schema && bun run generate:skill && bun run generate:sdk && bun run script/build.ts --single",
77+
"build:all": "bun run generate:schema && bun run generate:skill && bun run generate:sdk && bun run script/build.ts",
78+
"bundle": "bun run generate:schema && bun run generate:skill && bun run generate:sdk && bun run script/bundle.ts",
79+
"typecheck": "bun run generate:skill && bun run generate:sdk && tsc --noEmit",
8080
"lint": "bunx ultracite check",
8181
"lint:fix": "bunx ultracite fix",
8282
"test": "bun run test:unit && bun run test:isolated",
83-
"test:unit": "bun run generate:sdk && bun test --timeout 15000 test/lib test/commands test/types --coverage --coverage-reporter=lcov",
84-
"test:isolated": "bun run generate:sdk && bun test --timeout 15000 test/isolated",
85-
"test:e2e": "bun run generate:sdk && bun test --timeout 15000 test/e2e",
83+
"test:unit": "bun run generate:skill && bun run generate:sdk && bun test --timeout 15000 test/lib test/commands test/types --coverage --coverage-reporter=lcov",
84+
"test:isolated": "bun run generate:skill && bun run generate:sdk && bun test --timeout 15000 test/isolated",
85+
"test:e2e": "bun run generate:skill && bun run generate:sdk && bun test --timeout 15000 test/e2e",
8686
"test:init-eval": "bun test test/init-eval --timeout 600000 --concurrency 6",
8787
"generate:sdk": "bun run script/generate-sdk.ts",
8888
"generate:skill": "bun run script/generate-skill.ts",

0 commit comments

Comments
 (0)