diff --git a/packages/cli/AGENTS.md b/packages/cli/AGENTS.md index dc077ace6..5fb0eb025 100644 --- a/packages/cli/AGENTS.md +++ b/packages/cli/AGENTS.md @@ -509,7 +509,8 @@ All command docs and skill files are generated via `pnpm run generate:docs` (whi - **Command docs** (`apps/cli-docs/src/content/docs/commands/*.md`) and the configuration page (`apps/cli-docs/src/content/docs/configuration.md`) are **gitignored** and generated from CLI metadata + hand-written fragments in `apps/cli-docs/src/fragments/` (paths live in `script/paths.ts`). - **Skill files** (`plugins/sentry-cli/skills/sentry-cli/`) are **committed** (consumed by external plugin systems) and auto-committed by CI when stale. -- **Examples belong to the command**: add them to `docs.examples` (`{ description, command }[]`, see `src/commands/agent-conversation/list.ts`). They render in `--help`, the generated docs, and the skill references. Don't hand-write an `Examples:` block in `fullDescription` or an Examples heading in a fragment; the `sentry-cli/no-examples-in-full-description` lint rule and `pnpm run check:fragments` reject both. +- **Examples belong to the command**: add them to `docs.examples` (`{ description, command }[]`, see `src/commands/agent-conversation/list.ts`). They render in `--help`, the generated docs, and the skill references. Don't hand-write examples in `fullDescription` (an `Examples:` block, or indented `sentry …` lines under any label) or an Examples heading in a fragment; the `sentry-cli/no-examples-in-full-description` lint rule and `pnpm run check:fragments` reject both. +- **Target syntax belongs to the positional**: describe accepted target forms in the positional `brief` (use `ORG_ALL_TARGET_BRIEF` or `PROJECT_TARGET_BRIEF` from `src/lib/list-command.ts` for `[/][]` targets), not in a `Target patterns:` block. The brief renders in `--help`, the generated docs, and the skill references. - Use fragments in `apps/cli-docs/src/fragments/commands/` only for prose the command metadata can't carry: guides, permissions, caveats. - `pnpm run check:fragments` also rejects any shell code block in a fragment that runs a `sentry` command, whatever its heading. For a real workflow, sample output, or cross-command guide, put `` on the line directly above the block. - `pnpm run check:fragments` validates fragment ↔ route consistency. diff --git a/packages/cli/lint-rules/cli-oxlint-plugin.js b/packages/cli/lint-rules/cli-oxlint-plugin.js index bfde0f783..bcc220a4d 100644 --- a/packages/cli/lint-rules/cli-oxlint-plugin.js +++ b/packages/cli/lint-rules/cli-oxlint-plugin.js @@ -106,8 +106,14 @@ function staticText(node) { /** Matches a heading or label line that opens an Examples section. */ const EXAMPLES_LABEL_RE = /^examples?:?$/i; -/** Whether help text has an Examples heading or an `Examples:` label line. */ +/** Matches an indented `sentry …` usage line, whatever label sits above it. */ +const EXAMPLE_LINE_RE = /^[ \t]+sentry\s/; + +/** Whether help text has an Examples section or free-text example lines. */ function hasExamplesSection(text) { + if (text.split("\n").some((line) => EXAMPLE_LINE_RE.test(line))) { + return true; + } return marked .lexer(text) .some((token) => diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/agent-conversation.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/agent-conversation.md index 74cdee03d..6ace28ee2 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/agent-conversation.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/agent-conversation.md @@ -15,6 +15,12 @@ List and view agent conversations List recent agent conversations +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | <org>/ (all projects), <org>/<project>, or <project> (search) | + **Flags:** - `-n, --limit - Number of conversations (1-1000) - (default: "25")` - `-q, --query - Any matching span selects its conversation; totals include all spans in selected projects and time range` @@ -90,6 +96,12 @@ sentry agent-conversation list my-org/my-project -c next View an agent conversation transcript +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[/]` | Organization slug (optional) and conversation ID | + **Flags:** - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/alert.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/alert.md index 153864da0..e5af865c7 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/alert.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/alert.md @@ -15,6 +15,12 @@ Manage Sentry alert rules List issue alert rules +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | <org>/ (all projects), <org>/<project>, or <project> (search) | + **Flags:** - `-w, --web - Open in browser` - `-n, --limit - Maximum number of issue alert rules to list - (default: "25")` @@ -25,17 +31,32 @@ List issue alert rules **Examples:** ```bash +# List issue alert rules (project auto-detected) +sentry alert issues list + # List issue alert rules for a project sentry alert issues list my-org/my-project # Filter rules by name sentry alert issues list my-org/my-project --query "spike" + +# List issue alert rules for all projects in an organization +sentry alert issues list my-org/ + +# Find a project across organizations +sentry alert issues list frontend ``` ### `sentry alert issues view ` View an issue alert rule +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Issue alert rule ID or name | + **Flags:** - `-w, --web - Open issue alert rules page in browser` @@ -56,6 +77,12 @@ sentry alert issues view my-org/my-project/'Error Spike' Create an issue alert rule +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | <org>/<project>, auto-detected project, or <project> (search) | + **Flags:** - `--name - Rule name` - `-c, --condition ... - Condition object JSON (repeatable, or pass one JSON array)` @@ -83,6 +110,12 @@ Delete an issue alert rule **Destructive:** This command deletes data or makes changes that can't easily be undone. Use `--dry-run` to preview the changes first. Confirm with the user before running it. +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Rule id or name (same as view) | + **Flags:** - `-y, --yes - Skip confirmation prompt` - `-f, --force - Force the operation without confirmation` @@ -105,6 +138,12 @@ sentry alert issues delete my-org/my-project/12345 --dry-run Edit an issue alert rule +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Rule id or name (same as view) | + **Flags:** - `--name - New rule name` - `--status - Rule status: active or disabled` @@ -136,6 +175,12 @@ sentry alert issues edit my-org/my-project/12345 --condition '{"type":"first_see List metric alert rules +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | <org>/, <org>/<project> (project ignored), or <project> (search) | + **Flags:** - `-w, --web - Open in browser` - `-n, --limit - Maximum number of metric alert rules to list - (default: "25")` @@ -146,14 +191,26 @@ List metric alert rules **Examples:** ```bash +# List metric alert rules (organization auto-detected) +sentry alert metrics list + # List metric alert rules for an organization sentry alert metrics list my-org/ + +# Fetch the next page +sentry alert metrics list my-org/ -c next ``` ### `sentry alert metrics view ` View a metric alert rule +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Metric alert rule ID or name | + **Flags:** - `-w, --web - Open metric alert rules page in browser` @@ -174,6 +231,12 @@ sentry alert metrics view my-org/'P95 latency alert' Create a metric alert rule +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Target project or organization | + **Flags:** - `--name - Rule name` - `--query - Metric query filter string` @@ -203,6 +266,12 @@ Delete a metric alert rule **Destructive:** This command deletes data or makes changes that can't easily be undone. Use `--dry-run` to preview the changes first. Confirm with the user before running it. +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Rule id or name (same as view) | + **Flags:** - `-y, --yes - Skip confirmation prompt` - `-f, --force - Force the operation without confirmation` @@ -222,6 +291,12 @@ sentry alert metrics delete my-org/'P95 alert' --yes Edit a metric alert rule +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Rule id or name (same as view) | + **Flags:** - `--name - New rule name` - `--status - active or disabled` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/api.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/api.md index a10382895..b907d639a 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/api.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/api.md @@ -15,6 +15,12 @@ Make an authenticated API request Make an authenticated API request +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | API endpoint relative to /api/0/, or an absolute HTTP(S) URL | + **Flags:** - `-X, --method - The HTTP method for the request - (default: "GET")` - `-d, --data - Inline JSON body for the request (like curl -d)` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/auth.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/auth.md index 374b97f1d..d5b08c9e8 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/auth.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/auth.md @@ -26,6 +26,12 @@ sentry auth list Authenticate with Sentry +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | Email of the account to add or log in to again (<email>:<server> also sets --url); the login is refused if you approve it as someone else | + **Flags:** - `--token - Authenticate using an API token instead of OAuth` - `--timeout - Timeout for OAuth flow in seconds (default: 900) - (default: "900")` @@ -69,6 +75,12 @@ sentry auth login jane@example.com:sentry.example.com Log out of Sentry +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Accounts to log out of (email, username, user ID, or account ID; comma-separated), or 'all' | + **Flags:** - `--url - Only match accounts on this server (disambiguates the same email on several servers)` @@ -141,6 +153,12 @@ sentry auth status --show-token Switch the active account +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | Email, username, user ID, or account ID to switch to | + **Flags:** - `--url - Only consider accounts on this server (disambiguates the same email on several servers)` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/build.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/build.md index 9b6c2b80c..03c4befa2 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/build.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/build.md @@ -15,6 +15,12 @@ Manage mobile build artifacts Upload builds to a project +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Path(s) to the build(s) to upload (APK, AAB, IPA, or XCArchive) | + **Flags:** - `--build-configuration - Build configuration for the upload (defaults to the current version)` - `--release-notes - Release notes for the build` @@ -60,6 +66,12 @@ sentry build upload ./app.aab --head-sha "$GIT_SHA" --pr-number 42 --base-ref ma Download a build artifact +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | ID of the build to download | + **Flags:** - `-o, --output - Output path (default: preprod_artifact_. in the current directory)` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/cli.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/cli.md index 04f564458..f74c96834 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/cli.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/cli.md @@ -15,6 +15,12 @@ CLI-related commands Print the shell completion script +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | Shell to generate completions for (bash, zsh, or fish) | + **Examples:** ```bash @@ -35,6 +41,12 @@ sentry cli completion fish > ~/.config/fish/completions/sentry.fish View and manage default settings +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Setting key and optional value | + **Flags:** - `--clear - Clear the specified default, or all defaults if no key is given` - `-y, --yes - Skip confirmation prompt` @@ -87,6 +99,12 @@ sentry cli defaults --clear --yes Send feedback about the CLI +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Your feedback message | + **Examples:** ```bash @@ -210,6 +228,12 @@ sentry cli uninstall Update the Sentry CLI to the latest version +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | Specific version (e.g. 0.5.0), or "nightly"/"stable" to switch channel; omit to update within current channel | + **Flags:** - `--check - Check for updates without installing` - `--force - Force upgrade even if already on the latest version` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/code-mappings.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/code-mappings.md index 890f1a51e..45ec25eda 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/code-mappings.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/code-mappings.md @@ -15,6 +15,12 @@ Manage code mappings for stack trace linking Upload code mappings for stack trace linking +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Path to the code mappings JSON file | + **Flags:** - `--repo - Repository name (e.g., owner/repo). Auto-detected from git remote if omitted.` - `--default-branch - Default branch name. Auto-detected from git remote HEAD if omitted.` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/dart-symbol-map.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/dart-symbol-map.md index 0a5c91ae4..1d2b37e0c 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/dart-symbol-map.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/dart-symbol-map.md @@ -15,6 +15,12 @@ Work with Dart/Flutter symbol maps Upload a Dart/Flutter symbol map to Sentry +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Path to the dart symbol map JSON file | + **Flags:** - `-d, --debug-id - Debug ID (UUID) from the companion native debug file` - `--no-upload - Validate the file without uploading (dry-run)` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/dashboard.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/dashboard.md index 425023b19..3926700ca 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/dashboard.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/dashboard.md @@ -15,6 +15,12 @@ Manage Sentry dashboards List dashboards +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org/project>] [<name-glob>] | + **Flags:** - `-w, --web - Open in browser` - `-n, --limit - Maximum number of dashboards to list - (default: "25")` @@ -56,6 +62,12 @@ sentry dashboard list -w View a dashboard +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org/project>] <dashboard-id-or-title> | + **Flags:** - `-w, --web - Open in browser` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` @@ -102,6 +114,12 @@ sentry dashboard view 12345 -w Create a dashboard +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org/project>] <title> | + **Examples:** ```bash @@ -119,6 +137,12 @@ sentry dashboard create my-org/my-project 'My Dashboard' Add a widget to a dashboard +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org/project>] <dashboard> <title> | + **Flags:** - `-d, --display - Display type (big_number, line, area, bar, table, stacked_area, top_n, text, categorical_bar, details, wheel, rage_and_dead_clicks, server_tree, agents_traces_table)` - `--dataset - Widget dataset (default: spans). Accepts canonical names and API synonyms: spans, error-events/errors, tracemetrics/metrics, logs, issue` @@ -150,12 +174,27 @@ sentry dashboard widget add 'My Dashboard' "Top Endpoints" --display table --que # Bar chart with a search filter sentry dashboard widget add 'My Dashboard' "Slow Requests" --display bar --query p95:span.duration --where "span.op:http.client" --group-by span.description + +# P95 latency KPI +sentry dashboard widget add 'My Dashboard' "P95" --display big_number --query p95:span.duration + +# Throughput KPI +sentry dashboard widget add 'My Dashboard' "Throughput" --display big_number --query epm + +# Custom metric percentiles from the tracemetrics dataset +sentry dashboard widget add 'My Dashboard' "Latency" --display line --dataset tracemetrics --query "p50(value,completion.duration_ms,distribution,none)" --query "p90(value,completion.duration_ms,distribution,none)" ``` ### `sentry dashboard widget edit ` Edit a widget in a dashboard +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org/project>] <dashboard-id-or-title> | + **Flags:** - `-i, --index - Widget index (0-based)` - `-t, --title - Widget title to match` @@ -194,6 +233,12 @@ Delete a widget from a dashboard **Destructive:** This command deletes data or makes changes that can't easily be undone. Use `--dry-run` to preview the changes first. Confirm with the user before running it. +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org/project>] <dashboard-id-or-title> | + **Flags:** - `-i, --index - Widget index (0-based)` - `-t, --title - Widget title to match` @@ -218,6 +263,12 @@ sentry dashboard widget delete 12345 --index 0 --dry-run List dashboard revisions +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org/project>] <dashboard-id-or-title> | + **Flags:** - `-n, --limit - Maximum number of revisions to list - (default: "25")` - `-c, --cursor - Navigate pages: "next", "prev", "first" (or raw cursor string)` @@ -245,6 +296,12 @@ sentry dashboard revisions my-org/ 12345 --json Restore a dashboard revision +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org/project>] <dashboard-id-or-title> | + **Flags:** - `-r, --revision - Revision ID to restore` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/debug-files.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/debug-files.md index dff599fa3..0f583f726 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/debug-files.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/debug-files.md @@ -15,6 +15,12 @@ Work with debug information files Inspect a debug information file +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Path to the debug information file | + **Examples:** ```bash @@ -32,6 +38,12 @@ sentry debug-files check ./app.pdb --json Locate debug files for given debug identifiers +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Debug identifier(s) to search for | + **Flags:** - `-t, --type ... - Only consider debug files of the given type (repeatable). Default: all` - `--no-well-known - Do not look for debug files in well-known locations` @@ -55,6 +67,12 @@ sentry debug-files find --no-cwd --no-well-known -p /symbols --json Upload debug information files to Sentry +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Files or directories to scan for debug information files | + **Flags:** - `-t, --type ... - Only upload files of this type (repeatable): dsym, elf, pe, pdb, portablepdb, wasm, breakpad, sourcebundle, jvm` - `--id ... - Only upload the object with this debug id (repeatable)` @@ -99,12 +117,21 @@ sentry debug-files upload ./build --il2cpp-mapping --include-sources # Preview what would be uploaded (no credentials needed) sentry debug-files upload ./build --no-upload + +# Scan Xcode's DerivedData without uploading +sentry debug-files upload --derived-data --no-upload ``` ### `sentry debug-files print-sources ` List the source files a debug file references +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Path to the debug information file | + **Examples:** ```bash @@ -119,6 +146,12 @@ sentry debug-files print-sources ./app.pdb --json Bundle a debug file's source files for source context +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Path to the debug information file | + **Flags:** - `-o, --output - Output path for the source bundle ZIP (default: .src.zip)` @@ -136,6 +169,12 @@ sentry debug-files bundle-sources ./app.pdb --output ./app.src.zip Create a JVM source bundle for source context +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Directory containing JVM source files | + **Flags:** - `-o, --output - Output directory for the bundle ZIP` - `-d, --debug-id - Debug ID (UUID) to stamp on the bundle` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/docs.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/docs.md index 32cbb70e0..561de75d0 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/docs.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/docs.md @@ -15,6 +15,12 @@ Search and query current Sentry documentation Find Sentry documentation pages by keyword +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Documentation keywords | + **Flags:** - `-n, --limit - Maximum matches to return (1-20) - (default: "8")` @@ -35,6 +41,12 @@ sentry docs list "source maps" --json Ask a cited question about Sentry documentation +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Natural-language docs question | + **Examples:** ```bash diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/dsn.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/dsn.md index 5180797aa..ac82e92c4 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/dsn.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/dsn.md @@ -15,6 +15,12 @@ Find Sentry DSNs List DSNs +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | <org>/ (all projects), <org>/<project>, or <project> (search) | + **Flags:** - `-n, --limit - Maximum number of DSNs to list - (default: "25")` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/event.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/event.md index 173514763..9d12fbdc8 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/event.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/event.md @@ -15,6 +15,12 @@ View, list, and send Sentry events View details of one or more events +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/<project>] <event-id> [<event-id>...] - Target (optional) and one or more event IDs | + **Flags:** - `-w, --web - Open in browser` - `--spans - Span tree depth limit (number, "all" for unlimited, "no" to disable) - (default: "3")` @@ -77,12 +83,24 @@ sentry event view abc123def456abc123def456abc12345 -w # Download an attachment listed by --json (with sentry api) sentry api 'https://sentry.io/api/0/projects/my-org/my-project/events/EVENT_ID/attachments/ATTACHMENT_ID/?download=1' > screenshot.png + +# View an event in an explicit project +sentry event view my-org/my-project abc123def456abc123def456abc12345 + +# View several events, finding the project across organizations +sentry event view my-project abc123def456abc123def456abc12345 def456abc123def456abc123def45678 ``` ### `sentry event list ` List events for an issue +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Issue: @latest, @most_frequent, <org>/ID, <org>/<project>#ID, <project>-suffix, ID, or suffix | + **Flags:** - `-n, --limit - Number of events (1-1000) - (default: "25")` - `-q, --query - Search query (Sentry search syntax)` @@ -146,6 +164,12 @@ sentry event list PROJ-ABC --json Send a Sentry event +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Optional DSN/project target followed by JSON event file path(s) | + **Flags:** - `-m, --message ... - Event message (repeat for multi-line)` - `-a, --message-arg ... - Arguments for message template (repeat for multiple)` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/explore.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/explore.md index 66adbc780..c3f4ff8de 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/explore.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/explore.md @@ -15,6 +15,12 @@ Query aggregate event data (Explore) Query aggregate event data (Explore) +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | <org>/ (all projects), <org>/<project>, or <project> (search) | + **Flags:** - `-F, --field ... - API field or aggregate (repeatable). E.g., title, "count()", "p50(span.duration)"` - `-m, --metric - Metric name for --dataset metrics. Auto-resolves type/unit via API.` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/feedback.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/feedback.md index 07bd9fe76..1da586aad 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/feedback.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/feedback.md @@ -15,6 +15,12 @@ Manage User Feedback List and search User Feedback +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | <org>/ (all projects), <org>/<project>, or <project> (search) | + **Flags:** - `--status - Mailbox: unresolved, resolved, spam, or all - (default: "unresolved")` - `-n, --limit - Number of feedback items (1-1000) - (default: "25")` @@ -83,6 +89,12 @@ sentry feedback list my-org/frontend --query "message:*checkout*" View a User Feedback item +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Feedback: @latest, numeric ID, short ID, <org>/SHORT-ID, or <org>/<project>/<suffix> | + **Flags:** - `-w, --web - Open in browser` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` @@ -148,6 +160,12 @@ sentry feedback view my-org/FRONTEND-2SDJ --web Mark User Feedback as resolved +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Feedback: @latest, numeric ID, short ID, <org>/SHORT-ID, or <org>/<project>/<suffix> | + **JSON Fields** (use `--json --fields` to select specific fields): | Field | Type | Description | @@ -196,6 +214,12 @@ sentry feedback resolve my-org/FRONTEND-2SDJ --json --fields id,shortId,status Return User Feedback to the inbox +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Feedback: @latest, numeric ID, short ID, <org>/SHORT-ID, or <org>/<project>/<suffix> | + **JSON Fields** (use `--json --fields` to select specific fields): | Field | Type | Description | @@ -247,6 +271,12 @@ sentry feedback unresolve FRONTEND-2SDJ --json --fields id,shortId,status Mark User Feedback as spam +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Feedback: @latest, numeric ID, short ID, <org>/SHORT-ID, or <org>/<project>/<suffix> | + **JSON Fields** (use `--json --fields` to select specific fields): | Field | Type | Description | diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/init.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/init.md index f29278ccc..291551707 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/init.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/init.md @@ -15,6 +15,13 @@ Initialize Sentry in your project (experimental) Initialize Sentry in your project (experimental) +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | <org>/<project>, <org>/, <project>, or a directory path | +| `[]` | Project directory (default: current directory) | + **Flags:** - `-y, --yes - Accept non-interactive defaults (requires --features outside a TTY)` - `-n, --dry-run - Show what would happen without making changes` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/integration.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/integration.md index 3a40c3e63..ffbd0f7f2 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/integration.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/integration.md @@ -15,6 +15,12 @@ Work with Sentry integrations List installed integrations +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | <org>/ (all projects), <org>/<project>, or <project> (search) | + **Flags:** - `-n, --limit - Maximum number of integrations to list - (default: "25")` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` @@ -54,6 +60,12 @@ Remove an installed integration **Destructive:** This command deletes data or makes changes that can't easily be undone. Use `--dry-run` to preview the changes first. Confirm with the user before running it. +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/]<integration-id> - Integration to remove | + **Flags:** - `-y, --yes - Skip confirmation prompt` - `-f, --force - Force the operation without confirmation` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/issue.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/issue.md index 09cf58f50..ebd25f996 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/issue.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/issue.md @@ -15,6 +15,12 @@ Manage Sentry issues List issues in a project +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | <org>/ (all projects), <org>/<project>, or <project> (search) | + **Flags:** - `-q, --query - Search query (Sentry syntax, implicit AND, no OR operator)` - `-n, --limit - Maximum number of issues to list - (default: "25")` @@ -51,6 +57,9 @@ List issues in a project **Examples:** ```bash +# List issues (project auto-detected) +sentry issue list + # List issues in a specific project sentry issue list my-org/frontend @@ -86,6 +95,12 @@ sentry issue list --query "browser:[Chrome,Firefox]" List events for a specific issue +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Issue: @latest, @most_frequent, <org>/ID, <org>/<project>#ID, <project>-suffix, ID, or suffix | + **Flags:** - `-n, --limit - Number of events (1-1000) - (default: "25")` - `-q, --query - Search query (Sentry search syntax)` @@ -143,6 +158,12 @@ sentry issue events FRONT-ABC --json Analyze one or more issues using Seer AI +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | One or more issue IDs | + **Flags:** - `--force - Force new analysis even if one exists` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` @@ -176,6 +197,12 @@ sentry issue explain 123456789 --json Generate a solution plan using Seer AI +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Issue: @latest, @most_frequent, <org>/ID, <org>/<project>#ID, <project>-suffix, ID, or suffix | + **Flags:** - `--force - Force new plan even if one exists` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` @@ -200,6 +227,12 @@ sentry issue plan 123456789 --force View details of one or more issues +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | One or more issue IDs | + **Flags:** - `-w, --web - Open in browser` - `--force - Allow --web to open more than 5 issues` @@ -278,6 +311,12 @@ sentry issue view FRONT-ABC --json | jq '.event.entries[] | select(.type == "exc Mark an issue as resolved +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Issue: @latest, @most_frequent, <org>/ID, <org>/<project>#ID, <project>-suffix, ID, or suffix | + **Flags:** - `-i, --in - Resolve in a release, next release, or commit ('' | '@next' | '@commit' | '@commit:@')` @@ -310,6 +349,12 @@ sentry issue resolve my-org/CLI-G5 Reopen a resolved issue +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Issue: @latest, @most_frequent, <org>/ID, <org>/<project>#ID, <project>-suffix, ID, or suffix | + **Examples:** ```bash @@ -327,6 +372,12 @@ sentry issue unresolve my-org/CLI-G5 Archive (ignore) an issue +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Issue: @latest, @most_frequent, <org>/ID, <org>/<project>#ID, <project>-suffix, ID, or suffix | + **Flags:** - `-u, --until - Condition for unarchival: forever, auto, 30m, 10x, 10u, 10x/5m, etc.` @@ -373,6 +424,12 @@ Merge 2+ issues into a single canonical group **Destructive:** This command deletes data or makes changes that can't easily be undone. Confirm with the user before running it. +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Issue IDs to merge (2 or more required) | + **Flags:** - `-i, --into - Prefer this issue as the canonical parent (included in the merge if not already listed)` @@ -396,6 +453,13 @@ sentry issue merge cli-k9 cli-15h --into cli-k9 Link an existing external issue +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Issue: @latest, @most_frequent, <org>/ID, <org>/<project>#ID, <project>-suffix, ID, or suffix | +| `` | URL of an existing tracker issue or GitHub pull request | + **Flags:** - `--integration - Native integration ID, when multiple installations match` - `--app - Sentry App slug (automatically detected for Linear URLs)` @@ -430,6 +494,13 @@ Unlink an external issue **Destructive:** This command deletes data or makes changes that can't easily be undone. Use `--dry-run` to preview the changes first. Confirm with the user before running it. +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Issue: @latest, @most_frequent, <org>/ID, <org>/<project>#ID, <project>-suffix, ID, or suffix | +| `` | URL of an existing tracker issue or GitHub pull request | + **Flags:** - `--integration - Native integration ID, when multiple installations match` - `--app - Sentry App slug (automatically detected for Linear URLs)` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/local.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/local.md index e045731d1..a83885f26 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/local.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/local.md @@ -36,18 +36,42 @@ Restart the Local control-plane daemon List retained envelopes for a Local session +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Session ID or unique name | + ### `sentry local envelope view ` View a raw Local envelope +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Session and envelope ID | + ### `sentry local event list ` List decoded events for a Local session +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Session ID or unique name | + ### `sentry local event view ` View a decoded Local event +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Session and event ID | + ### `sentry local serve` Start the local dev server and tail events @@ -92,6 +116,12 @@ sentry local --open Create a Local telemetry session +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Optional session label | + **Flags:** - `--clientId - Idempotency key for retried agent session creation` - `--host - Loopback host - (default: "localhost")` @@ -102,6 +132,12 @@ Create a Local telemetry session View or change session envelope retention +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Session ID or unique name | + **Flags:** - `--max-envelopes - Maximum envelopes retained by this receiver or session` @@ -113,18 +149,42 @@ List Local telemetry sessions View a Local telemetry session +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Session ID or unique name | + ### `sentry local session close ` Close a Local telemetry session +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Session ID or unique name | + ### `sentry local session reset ` Clear a Local telemetry session +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Session ID or unique name | + ### `sentry local run ` Run a command with the local dev server enabled +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Command to run | + **Flags:** - `-p, --port - Port for the local server (default 8969) - (default: "8969")` - `--host - Hostname for the local server (default localhost) - (default: "localhost")` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/log.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/log.md index 5493fde94..9cef1010b 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/log.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/log.md @@ -15,6 +15,12 @@ View Sentry logs List logs from a project +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/[<project>/]]<trace-id>, <org>/<project>, or <project> | + **Flags:** - `-n, --limit - Number of log entries (1-1000) - (default: "100")` - `-q, --query - Filter query (e.g., "severity:error", "project:backend", "project:[a,b]")` @@ -66,12 +72,21 @@ sentry log list my-org/backend -f -q 'severity:error' # Filter JSON output with jq sentry log list --json | jq '.data[] | select(.severity == "error")' + +# Filter by trace in an explicit organization +sentry log list my-org/abc123def456abc123def456abc12345 ``` ### `sentry log view ` View details of one or more log entries +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/<project>] <log-id> [<log-id>...] - Target (optional) and one or more log IDs | + **Flags:** - `-w, --web - Open in browser` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` @@ -87,6 +102,9 @@ sentry log view my-org/backend 968c763c740cfda8b6728f27fb9e9b01 # Open in the browser sentry log view 968c763c740cfda8b6728f27fb9e9b01 -w + +# Find a project across organizations +sentry log view backend 968c763c740cfda8b6728f27fb9e9b01 ``` All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/monitor.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/monitor.md index bd56732ae..a29f1ed39 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/monitor.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/monitor.md @@ -15,6 +15,12 @@ Work with Sentry cron monitors Wrap a command with cron monitor check-ins +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Monitor slug followed by the command to run | + **Flags:** - `--dsn - DSN to send check-ins to (overrides SENTRY_DSN env var)` - `-e, --environment - Environment of the monitor - (default: "production")` @@ -42,6 +48,12 @@ sentry monitor run nightly-job -s "0 0 * * *" --max-runtime 30 --timezone UTC -- List cron monitors +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | <org>/ (all projects), <org>/<project>, or <project> (search) | + **Flags:** - `-n, --limit - Maximum number of monitors to list - (default: "25")` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/org.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/org.md index cfb1b424d..3c9dafe86 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/org.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/org.md @@ -15,6 +15,12 @@ Work with Sentry organizations List organizations +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | Only list organizations whose slug or name fuzzy-matches this text or matches this glob | + **Flags:** - `-n, --limit - Maximum number of organizations to list - (default: "25")` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` @@ -46,6 +52,12 @@ sentry org list --json View details of an organization +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | Organization slug (optional if auto-detected) | + **Flags:** - `-w, --web - Open in browser` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/proguard.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/proguard.md index 8da0b3234..909563796 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/proguard.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/proguard.md @@ -15,6 +15,12 @@ Work with ProGuard/R8 mapping files Upload ProGuard/R8 mapping files to Sentry +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Paths to ProGuard/R8 mapping files | + **Flags:** - `--uuid - Force a specific UUID instead of computing from file content (only valid with a single file)` - `--no-upload - Compute and print UUIDs without uploading (dry-run)` @@ -34,12 +40,21 @@ sentry proguard upload mapping.txt --no-upload # Fail if no mapping files are found (useful in CI) sentry proguard upload ./mapping/ --require-one + +# Upload with an explicit UUID +sentry proguard upload mapping.txt --uuid 5db7294d-87fc-5726-a5c0-4a90679657a5 ``` ### `sentry proguard uuid ` Compute the UUID for a ProGuard mapping file +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Path to the ProGuard mapping file | + **Examples:** ```bash diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/project.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/project.md index 651a059b0..10d7e297e 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/project.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/project.md @@ -15,6 +15,12 @@ Work with Sentry projects Create one or more projects +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[/]:...` | One or more project name and platform pairs | + **Flags:** - `-t, --team - Team to create the project under` - `-n, --dry-run - Show what would happen without making changes` @@ -44,6 +50,12 @@ Delete a project **Destructive:** This command deletes data or makes changes that can't easily be undone. Use `--dry-run` to preview the changes first. Confirm with the user before running it. +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | <org>/<project> or <project> (search across orgs) | + **Flags:** - `-y, --yes - Skip confirmation prompt` - `-f, --force - Force the operation without confirmation` @@ -66,6 +78,12 @@ sentry project delete my-org/old-project --dry-run List projects +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | <org>/ (all projects), <org>/<project>, or <project> (search) | + **Flags:** - `-n, --limit - Maximum number of projects to list - (default: "25")` - `-p, --platform - Filter by platform (e.g., javascript, python)` @@ -75,6 +93,9 @@ List projects **Examples:** ```bash +# List projects (organization auto-detected) +sentry project list + # List all projects in an organization sentry project list my-org/ @@ -83,12 +104,30 @@ sentry project list my-org/frontend,backend # Filter by platform sentry project list my-org/ --platform javascript + +# Find a project across organizations +sentry project list frontend + +# Fetch the next page +sentry project list my-org/ -c next + +# Show more results +sentry project list my-org/ --limit 50 + +# Output as JSON +sentry project list my-org/ --json ``` ### `sentry project view []` View details of a project +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | <org>/<project> or <project> (search) | + **Flags:** - `-w, --web - Open in browser` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` @@ -96,11 +135,17 @@ View details of a project **Examples:** ```bash +# View the auto-detected project +sentry project view + # View project details sentry project view my-org/frontend # Open the project in the browser sentry project view my-org/frontend -w + +# Find a project across organizations +sentry project view frontend ``` All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/react-native.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/react-native.md index 0bd9a1e86..16325349b 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/react-native.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/react-native.md @@ -37,6 +37,12 @@ sentry react-native gradle --bundle index.android.bundle --sourcemap index.andro Upload React Native sourcemaps (Xcode build step) +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Extra arguments passed to the build script | + **Flags:** - `-f, --force - Run even in a debug configuration` - `--allow-fetch - Fetch sourcemaps from the packager on simulator builds` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/release.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/release.md index b87e02333..a4a1dc732 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/release.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/release.md @@ -15,6 +15,12 @@ Work with Sentry releases List releases with adoption and health metrics +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | <org>/ (all projects), <org>/<project>, or <project> (search) | + **Flags:** - `-n, --limit - Maximum number of releases to list - (default: "25")` - `-s, --sort - Sort: date, sessions, users, crash_free_sessions (cfs), crash_free_users (cfu) - (default: "date")` @@ -47,12 +53,21 @@ sentry release list --period 7d # Output as JSON sentry release list --json + +# Fetch the next page +sentry release list my-org/ -c next ``` ### `sentry release view ` View release details with health metrics +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/]<version> - Release version to view | + **Flags:** - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` @@ -76,6 +91,12 @@ sentry release view 1.0.0 --json Create a release +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/]<version> - Release version to create | + **Flags:** - `-p, --project - Associate with project(s), comma-separated` - `--finalize - Immediately finalize the release (set dateReleased)` @@ -99,7 +120,7 @@ sentry release create 1.0.0 --finalize sentry release create 1.0.0 --project proj-a,proj-b # Create a release from a proposed version -sentry release create $(sentry release propose-version) +sentry release create "$(sentry release propose-version --json | jq -r .version)" # Set the release ref and URL sentry release create 1.0.0 --ref main --url https://github.com/org/repo/releases/tag/1.0.0 @@ -112,6 +133,12 @@ sentry release create 1.0.0 --dry-run Finalize a release +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/]<version> - Release version to finalize | + **Flags:** - `--released - Custom release timestamp (ISO 8601). Defaults to now.` - `--url - URL for the release` @@ -139,6 +166,12 @@ Delete a release **Destructive:** This command deletes data or makes changes that can't easily be undone. Use `--dry-run` to preview the changes first. Confirm with the user before running it. +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/]<version> - Release version to delete | + **Flags:** - `-y, --yes - Skip confirmation prompt` - `-f, --force - Force the operation without confirmation` @@ -161,6 +194,12 @@ sentry release delete my-org/1.0.0 --dry-run Archive a release +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/]<version> - Release version to archive | + **Flags:** - `-n, --dry-run - Show what would happen without making changes` @@ -181,6 +220,12 @@ sentry release archive my-org/1.0.0 --dry-run Restore an archived release +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/]<version> - Release version to restore | + **Flags:** - `-n, --dry-run - Show what would happen without making changes` @@ -201,6 +246,14 @@ sentry release restore 1.0.0 --dry-run Create a deploy for a release +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/]<version> - Release version | +| `` | Deploy environment (e.g. production) | +| `[]` | Optional deploy name (quote multi-word names, e.g. "Deploy #42") | + **Flags:** - `--url - URL for the deploy` - `--started - Deploy start time (ISO 8601)` @@ -231,6 +284,12 @@ sentry release deploy 1.0.0 production --dry-run List deploys for a release +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/]<version> - Release version | + **Examples:** ```bash @@ -248,6 +307,12 @@ sentry release deploys 1.0.0 --json Set commits for a release +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/]<version> - Release version | + **Flags:** - `--auto - Auto-discover commits via repository integration (needs local git checkout)` - `--local - Read commits from local git history` @@ -294,6 +359,9 @@ sentry release propose-version # Output as JSON sentry release propose-version --json + +# Create a release named after the proposed version +sentry release create "$(sentry release propose-version --json | jq -r .version)" ``` All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/replay.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/replay.md index b9a9c63d6..e6464fff2 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/replay.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/replay.md @@ -15,6 +15,12 @@ Search and inspect Session Replays List recent Session Replays +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | <org>/ (all projects), <org>/<project>, or <project> (search) | + **Flags:** - `-n, --limit - Number of replays (1-1000) - (default: "25")` - `-q, --query - Search query (Sentry replay search syntax)` @@ -92,12 +98,21 @@ sentry replay list my-org/frontend -c prev # Output as JSON sentry replay list my-org/frontend --json + +# Find a project across organizations +sentry replay list frontend ``` ### `sentry replay view ` View a Session Replay +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/<project>] <replay-id or trace-id> or <replay-url> | + **Flags:** - `-w, --web - Open in browser` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` @@ -169,6 +184,12 @@ sentry replay view my-org/346789a703f6454384f1de473b8b9fcc --web Download a Session Replay as rrweb JSON +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/<project>] <replay-id or trace-id> or <replay-url> | + **Flags:** - `-o, --output - Output path (default: .rrweb.json in the current directory)` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/repo.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/repo.md index 55a7e17ec..05a97e221 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/repo.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/repo.md @@ -15,6 +15,12 @@ Work with Sentry repositories List repositories +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | <org>/ (all projects), <org>/<project>, or <project> (search) | + **Flags:** - `-n, --limit - Maximum number of repositories to list - (default: "25")` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/schema.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/schema.md index 4d4f4abb8..79724f8f2 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/schema.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/schema.md @@ -15,6 +15,12 @@ Browse the Sentry API schema Browse the Sentry API schema +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Resource, exact operation ID, or METHOD /path | + **Flags:** - `--all - Show all endpoints in a flat list` - `-q, --search - Search endpoints by keyword` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/snapshots.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/snapshots.md index d52b90e44..d23bb0396 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/snapshots.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/snapshots.md @@ -15,6 +15,13 @@ Manage and compare snapshots Compare two directories of snapshot images +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Path to the baseline image directory | +| `` | Path to the head image directory | + **Flags:** - `-o, --output - Directory for diff mask images (default: ./diff-output/)` - `--threshold - Pixel color difference threshold (0.0-1.0) - (default: "0.01")` @@ -30,6 +37,9 @@ sentry snapshots diff ./baseline ./head # Exit non-zero if any images changed, with a custom threshold sentry snapshots diff ./baseline ./head --fail-on-diff --threshold 0.02 + +# Write diff masks to a directory +sentry snapshots diff ./baseline ./head --output ./diffs/ ``` ### `sentry snapshots download` @@ -59,6 +69,12 @@ sentry snapshots download --app-id my-app --output ./baseline/ Upload snapshots to a project +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Path to the folder containing images to upload | + **Flags:** - `--app-id - The application identifier` - `--diff-threshold - Only report an image as changed when its difference exceeds this fraction (0.0–1.0, e.g. 0.01 = 1%)` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/sourcemap.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/sourcemap.md index ac4e07050..667784cdc 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/sourcemap.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/sourcemap.md @@ -15,6 +15,12 @@ Manage sourcemaps Inject debug IDs into JavaScript files and sourcemaps +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Directory to scan for JS + sourcemap pairs | + **Flags:** - `--ext - Comma-separated file extensions to process (default: .js,.cjs,.mjs)` - `--ignore - Comma-separated glob patterns to exclude (gitignore-style)` @@ -33,12 +39,21 @@ sentry sourcemap inject ./dist --dry-run # Only process specific extensions sentry sourcemap inject ./build --ext .js,.mjs + +# Allow a directory with no sourcemaps +sentry sourcemap inject ./maybe-empty --allow-empty ``` ### `sentry sourcemap upload ` Upload sourcemaps to Sentry +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Directory containing sourcemaps | + **Flags:** - `--release - Release version to associate with the upload` - `--dist - Distribution identifier to disambiguate builds within a release` @@ -65,12 +80,27 @@ sentry sourcemap upload ./dist --url-prefix '~/static/js/' # Don't fail when no sourcemaps are found sentry sourcemap upload ./dist --allow-empty + +# Set a release and distribution +sentry sourcemap upload ./dist --release 1.0.0 --dist 12345 + +# Upload without rewriting sourcemaps +sentry sourcemap upload ./dist --no-rewrite + +# Only upload some extensions +sentry sourcemap upload ./dist --ext .js,.mjs ``` ### `sentry sourcemap resolve ` Resolve and report sourcemap linkage for JavaScript files +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Directory to scan for JS files | + **Flags:** - `--ext - Comma-separated file extensions to process (default: .js,.cjs,.mjs)` - `--ignore - Comma-separated glob patterns to exclude (gitignore-style)` @@ -84,6 +114,9 @@ sentry sourcemap resolve ./dist # Output as JSON sentry sourcemap resolve ./dist --json + +# Only scan some extensions +sentry sourcemap resolve ./build --ext .js,.mjs ``` All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/span.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/span.md index dc1b07242..a13fa3684 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/span.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/span.md @@ -15,6 +15,12 @@ List and view spans in projects or traces List spans in a project or trace +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/<project>] or [<org>/<project>/]<trace-id> | + **Flags:** - `-n, --limit - Number of spans (<=1000) - (default: "25")` - `-q, --query - Filter spans (e.g., "op:db", "project:backend", "project:[cli,api]")` @@ -63,12 +69,27 @@ sentry span list abc123def456abc123def456abc12345 -q "project:[cli-server,api]" # Fetch the next page sentry span list -c next + +# List spans in an explicit project +sentry span list my-org/cli-server + +# Find a project across organizations, then list a trace +sentry span list cli-server abc123def456abc123def456abc12345 + +# Fetch the next page of a trace +sentry span list abc123def456abc123def456abc12345 -c next ``` ### `sentry span view ` View details of specific spans +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/<project>/]<trace-id> <span-id> [<span-id>...] - Trace ID and one or more span IDs | + **Flags:** - `--spans - Span tree depth limit (number, "all" for unlimited, "no" to disable) - (default: "3")` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/team.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/team.md index 8de6462e6..261434a9e 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/team.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/team.md @@ -15,6 +15,12 @@ Work with Sentry teams List teams +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | <org>/ (all projects), <org>/<project>, or <project> (search) | + **Flags:** - `-n, --limit - Maximum number of teams to list - (default: "25")` - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/trace.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/trace.md index 10da3d987..969764622 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/trace.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/trace.md @@ -15,6 +15,12 @@ View distributed traces List recent traces in a project +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | <org>/<project> or <project> (search) | + **Flags:** - `-n, --limit - Number of traces (1-1000) - (default: "25")` - `-q, --query - Search query (Sentry search syntax)` @@ -51,12 +57,21 @@ sentry trace list -q "transaction:GET /api/users" --period 24h # Fetch the next page sentry trace list my-org/backend -c next + +# Find a project across organizations +sentry trace list backend ``` ### `sentry trace view ` View details of a specific trace +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/<project>/]<trace-id> - Target (optional) and trace ID (required) | + **Flags:** - `-w, --web - Open in browser` - `--full - Fetch full span attributes (auto-enabled with --json)` @@ -80,12 +95,21 @@ sentry trace view PROJ-123 # Open the trace in the browser sentry trace view abc123def456abc123def456abc12345 -w + +# Find a project across organizations +sentry trace view cli-server abc123def456abc123def456abc12345 ``` ### `sentry trace logs ` View logs associated with a trace +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | [<org>/[<project>/]]<trace-id> - Optional org/project and required trace ID | + **Flags:** - `-w, --web - Open trace in browser` - `-t, --period - Time range: "7d", "2024-01-01..2024-02-01", ">=2024-01-01" - (default: "14d")` @@ -114,6 +138,9 @@ sentry trace logs -q 'severity:error' abc123def456abc123def456abc12345 # Output as JSON sentry trace logs --json abc123def456abc123def456abc12345 + +# Logs for a trace in an explicit organization +sentry trace logs my-org/abc123def456abc123def456abc12345 ``` All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags. diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/trial.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/trial.md index a9e9c20e1..64bab02e0 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/trial.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/trial.md @@ -15,6 +15,12 @@ Manage product trials List product trials +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `[]` | Organization slug (auto-detected if omitted) | + **JSON Fields** (use `--json --fields` to select specific fields): | Field | Type | Description | @@ -45,6 +51,13 @@ Start a product trial **Destructive:** This command deletes data or makes changes that can't easily be undone. Confirm with the user before running it. +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Trial name (seer, replays, performance, spans, profiling, logs, monitors, uptime, plan) | +| `[]` | Organization slug (auto-detected if omitted) | + **Examples:** ```bash diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/wasm-split.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/wasm-split.md index d8b7b15d3..fa8ba54e4 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/wasm-split.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/wasm-split.md @@ -15,6 +15,12 @@ Add build ids to WebAssembly modules and split out debug data Add build ids to WebAssembly modules and split out debug data +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Path to the wasm file | + **Flags:** - `-o, --out - Path to the output wasm file (default: modify input in place)` - `-d, --debug-out - Path to the output debug wasm file (default: debug data stays in the input)` diff --git a/packages/cli/script/generate-skill.ts b/packages/cli/script/generate-skill.ts index 3850e6445..e077a2069 100644 --- a/packages/cli/script/generate-skill.ts +++ b/packages/cli/script/generate-skill.ts @@ -25,6 +25,7 @@ import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs"; import { access, readFile, writeFile } from "node:fs/promises"; import { + formatCommandArguments, formatCommandExamples, formatDestructiveNotice, } from "./generate-skill-markdown.js"; @@ -360,6 +361,10 @@ function generateFullCommandDoc(cmd: CommandInfo): string { ); } + if (cmd.positionals.length > 0) { + lines.push("", formatCommandArguments(cmd.positionals)); + } + const visibleFlags = getVisibleFlags(cmd); if (visibleFlags.length > 0) { lines.push(""); diff --git a/packages/cli/src/commands/agent-conversation/list.ts b/packages/cli/src/commands/agent-conversation/list.ts index b03c4a0ef..3c915269a 100644 --- a/packages/cli/src/commands/agent-conversation/list.ts +++ b/packages/cli/src/commands/agent-conversation/list.ts @@ -133,11 +133,6 @@ export const listCommand = buildListCommand("agent-conversation", { "Sort by one canonical conversation.* field. Prefix the field with - for descending order. " + "The default is -conversation.age, and conversation ID ascending breaks ties. " + "conversation.timeSpan measures elapsed time; conversation.generationDuration sums model call duration.\n\n" + - "Target patterns:\n" + - " sentry agent-conversation list # Auto-detect organization\n" + - " sentry agent-conversation list / # All projects in an organization\n" + - " sentry agent-conversation list / # One project\n" + - " sentry agent-conversation list # Find project across organizations\n\n" + targetPatternExplanation(), examples: [ { diff --git a/packages/cli/src/commands/alert/issues/list.ts b/packages/cli/src/commands/alert/issues/list.ts index da2e1cec4..7fc6c3d83 100644 --- a/packages/cli/src/commands/alert/issues/list.ts +++ b/packages/cli/src/commands/alert/issues/list.ts @@ -497,15 +497,14 @@ export const listCommand = buildListCommand("alert issues", { fullDescription: "List issue alert rules for one or more Sentry projects.\n\n" + "Issue alerts trigger notifications when error events match conditions.\n\n" + - "Target patterns:\n" + - " sentry alert issues list # auto-detect from DSN or config\n" + - " sentry alert issues list / # explicit org and project\n" + - " sentry alert issues list / # all projects in org\n" + - " sentry alert issues list # find project across all orgs\n\n" + `${targetPatternExplanation()}\n\n` + "In monorepos with multiple Sentry projects, shows alert rules from all detected projects.\n\n" + "Use --cursor / -c next / -c prev to paginate through larger result sets.", examples: [ + { + description: "List issue alert rules (project auto-detected)", + command: "sentry alert issues list", + }, { description: "List issue alert rules for a project", command: "sentry alert issues list my-org/my-project", @@ -514,6 +513,15 @@ export const listCommand = buildListCommand("alert issues", { description: "Filter rules by name", command: 'sentry alert issues list my-org/my-project --query "spike"', }, + { + description: + "List issue alert rules for all projects in an organization", + command: "sentry alert issues list my-org/", + }, + { + description: "Find a project across organizations", + command: "sentry alert issues list frontend", + }, ], }, output: { diff --git a/packages/cli/src/commands/alert/metrics/list.ts b/packages/cli/src/commands/alert/metrics/list.ts index c21d94e5a..a8e90a208 100644 --- a/packages/cli/src/commands/alert/metrics/list.ts +++ b/packages/cli/src/commands/alert/metrics/list.ts @@ -497,19 +497,22 @@ export const listCommand = buildListCommand("alert metrics", { fullDescription: "List metric alert rules for one or more Sentry organizations.\n\n" + "Metric alerts trigger notifications when a metric query crosses a threshold.\n\n" + - "Target patterns:\n" + - " sentry alert metrics list # auto-detect from DSN or config\n" + - " sentry alert metrics list / # explicit org (paginated)\n" + - " sentry alert metrics list / # explicit org (project ignored)\n" + - " sentry alert metrics list # find project across all orgs\n\n" + `${targetPatternExplanation()}\n\n` + "Metric alert rules are org-scoped; the project part is ignored when provided.\n\n" + "Use --cursor / -c next / -c prev to paginate through larger result sets.", examples: [ + { + description: "List metric alert rules (organization auto-detected)", + command: "sentry alert metrics list", + }, { description: "List metric alert rules for an organization", command: "sentry alert metrics list my-org/", }, + { + description: "Fetch the next page", + command: "sentry alert metrics list my-org/ -c next", + }, ], }, output: { diff --git a/packages/cli/src/commands/build/download.ts b/packages/cli/src/commands/build/download.ts index df827141e..a5ea67fa8 100644 --- a/packages/cli/src/commands/build/download.ts +++ b/packages/cli/src/commands/build/download.ts @@ -55,10 +55,7 @@ export const downloadCommand = buildCommand({ "Download a mobile build artifact (APK or IPA) previously uploaded to " + "Sentry's preprod system for size analysis. The build is resolved by " + "ID within the organization; the artifact is streamed to a local file.\n\n" + - "This feature only works with Sentry SaaS.\n\n" + - "Usage:\n" + - " sentry build download 1234567890\n" + - " sentry build download 1234567890 --output ./app.ipa", + "This feature only works with Sentry SaaS.", examples: [ { description: "Download a build artifact by ID", diff --git a/packages/cli/src/commands/code-mappings/upload.ts b/packages/cli/src/commands/code-mappings/upload.ts index 0face558c..2c550dc61 100644 --- a/packages/cli/src/commands/code-mappings/upload.ts +++ b/packages/cli/src/commands/code-mappings/upload.ts @@ -174,11 +174,6 @@ export const uploadCommand = buildCommand({ "and stack trace linking.\n\n" + "The input file must be a JSON array of objects with `stackRoot` and " + "`sourceRoot` fields.\n\n" + - "Usage:\n" + - " sentry code-mappings upload mappings.json\n" + - " sentry code-mappings upload mappings.json --repo owner/repo\n" + - " sentry code-mappings upload mappings.json --repo owner/repo --default-branch develop\n" + - " sentry code-mappings upload mappings.json --json\n\n" + "Requires an Organization Token with `org:ci` scope.", examples: [ { diff --git a/packages/cli/src/commands/dart-symbol-map/upload.ts b/packages/cli/src/commands/dart-symbol-map/upload.ts index c09ed485c..521167747 100644 --- a/packages/cli/src/commands/dart-symbol-map/upload.ts +++ b/packages/cli/src/commands/dart-symbol-map/upload.ts @@ -167,10 +167,6 @@ export const uploadCommand = buildCommand({ "A debug ID (--debug-id) is required to associate the map with its " + "companion native debug file (dSYM/ELF). The sentry-dart-plugin " + "extracts this automatically.\n\n" + - "Usage:\n" + - " sentry dart-symbol-map upload --debug-id mapping.json\n" + - " sentry dart-symbol-map upload --debug-id mapping.json --no-upload\n" + - " sentry dart-symbol-map upload --debug-id mapping.json --json\n\n" + "Supported on Sentry SaaS and self-hosted >= 25.8.0.", examples: [ { diff --git a/packages/cli/src/commands/dashboard/create.ts b/packages/cli/src/commands/dashboard/create.ts index 6fa32d468..1f669dd4f 100644 --- a/packages/cli/src/commands/dashboard/create.ts +++ b/packages/cli/src/commands/dashboard/create.ts @@ -143,8 +143,7 @@ export const createCommand = buildCommand({ brief: "Create a dashboard", fullDescription: "Create a new Sentry dashboard.\n\n" + - "Add widgets after creation with:\n" + - ' sentry dashboard widget add "My Widget" --display line --query count', + "Add widgets after creation with `sentry dashboard widget add`.", examples: [ { description: "Create a dashboard (organization auto-detected)", diff --git a/packages/cli/src/commands/dashboard/widget/add.ts b/packages/cli/src/commands/dashboard/widget/add.ts index 72ac87233..2f5d8d95b 100644 --- a/packages/cli/src/commands/dashboard/widget/add.ts +++ b/packages/cli/src/commands/dashboard/widget/add.ts @@ -117,6 +117,21 @@ export const addCommand = buildCommand({ command: 'sentry dashboard widget add \'My Dashboard\' "Slow Requests" --display bar --query p95:span.duration --where "span.op:http.client" --group-by span.description', }, + { + description: "P95 latency KPI", + command: + "sentry dashboard widget add 'My Dashboard' \"P95\" --display big_number --query p95:span.duration", + }, + { + description: "Throughput KPI", + command: + "sentry dashboard widget add 'My Dashboard' \"Throughput\" --display big_number --query epm", + }, + { + description: "Custom metric percentiles from the tracemetrics dataset", + command: + 'sentry dashboard widget add \'My Dashboard\' "Latency" --display line --dataset tracemetrics --query "p50(value,completion.duration_ms,distribution,none)" --query "p90(value,completion.duration_ms,distribution,none)"', + }, ], }, output: { diff --git a/packages/cli/src/commands/dashboard/widget/index.ts b/packages/cli/src/commands/dashboard/widget/index.ts index db6803ce3..17c08f41d 100644 --- a/packages/cli/src/commands/dashboard/widget/index.ts +++ b/packages/cli/src/commands/dashboard/widget/index.ts @@ -44,23 +44,8 @@ export const widgetRoute = buildRouteMap({ " - metric_name: name passed to Sentry.metrics.distribution/gauge/count\n" + " - metric_type: distribution, gauge, counter, set\n" + " - unit: none (if unspecified), byte, second, millisecond, ratio, etc.\n\n" + - "Row-filling examples:\n" + - " # 3 KPIs (2+2+2 = 6)\n" + - ' sentry dashboard widget add "Error Count" --display big_number --query count\n' + - ' sentry dashboard widget add "P95" --display big_number --query p95:span.duration\n' + - ' sentry dashboard widget add "Throughput" --display big_number --query epm\n\n' + - " # 2 charts (3+3 = 6)\n" + - ' sentry dashboard widget add "Errors" --display line --query count\n' + - ' sentry dashboard widget add "Latency" --display line --query p95:span.duration\n\n' + - " # Full-width table (6 = 6)\n" + - ' sentry dashboard widget add "Top Endpoints" --display table \\\n' + - " --query count --query p95:span.duration --group-by transaction \\\n" + - " --sort -count --limit 10\n\n" + - " # Custom metrics (tracemetrics dataset)\n" + - ' sentry dashboard widget add "Latency" --display line \\\n' + - " --dataset tracemetrics \\\n" + - ' --query "p50(value,completion.duration_ms,distribution,none)" \\\n' + - ' --query "p90(value,completion.duration_ms,distribution,none)"\n\n' + + "For example, three big_number widgets (2+2+2), two line charts (3+3),\n" + + "or one table (6) fill a row.\n\n" + "Commands:\n" + " add Add a widget to a dashboard\n" + " edit Edit a widget in a dashboard\n" + diff --git a/packages/cli/src/commands/debug-files/bundle-sources.ts b/packages/cli/src/commands/debug-files/bundle-sources.ts index be984d812..25351ae5b 100644 --- a/packages/cli/src/commands/debug-files/bundle-sources.ts +++ b/packages/cli/src/commands/debug-files/bundle-sources.ts @@ -79,9 +79,6 @@ export const bundleSourcesCommand = buildCommand({ "this is normally run on the build machine right after compiling. " + "Referenced files that are not present locally are skipped. The format " + "is auto-detected, and this command makes no network requests.\n\n" + - "Usage:\n" + - " sentry debug-files bundle-sources ./libexample.so\n" + - " sentry debug-files bundle-sources ./app.pdb -o ./app.src.zip\n\n" + "Exits non-zero if no referenced source files are found on disk.", examples: [ { diff --git a/packages/cli/src/commands/debug-files/check.ts b/packages/cli/src/commands/debug-files/check.ts index dc592d8c9..69a445eda 100644 --- a/packages/cli/src/commands/debug-files/check.ts +++ b/packages/cli/src/commands/debug-files/check.ts @@ -120,10 +120,6 @@ export const checkCommand = buildCommand({ "PE/PDB, Portable PDB, WebAssembly, Breakpad, and source bundles.\n\n" + "The format is auto-detected. This command is local-only and makes no " + "network requests.\n\n" + - "Usage:\n" + - " sentry debug-files check ./libexample.so\n" + - " sentry debug-files check MyApp.dSYM/Contents/Resources/DWARF/MyApp\n" + - " sentry debug-files check ./app.pdb --json\n\n" + "Exits non-zero if the file is not usable for symbolication.", examples: [ { diff --git a/packages/cli/src/commands/debug-files/find.ts b/packages/cli/src/commands/debug-files/find.ts index 594fd021f..cfa1b7089 100644 --- a/packages/cli/src/commands/debug-files/find.ts +++ b/packages/cli/src/commands/debug-files/find.ts @@ -115,11 +115,7 @@ export const findCommand = buildCommand({ "Searches Xcode's DerivedData (for dSYMs), the current directory, and " + "any extra `--path` directories, matching each file's embedded debug id " + "against the requested ids. Local-only — no API calls.\n\n" + - "Exits non-zero if any id could not be located.\n\n" + - "Usage:\n" + - " sentry debug-files find [...]\n" + - " sentry debug-files find --type dsym --path ./build\n" + - " sentry debug-files find --no-cwd --no-well-known -p /symbols", + "Exits non-zero if any id could not be located.", examples: [ { description: "Locate debug files for a debug identifier on disk", diff --git a/packages/cli/src/commands/debug-files/print-sources.ts b/packages/cli/src/commands/debug-files/print-sources.ts index b2e2a3206..c27ce4495 100644 --- a/packages/cli/src/commands/debug-files/print-sources.ts +++ b/packages/cli/src/commands/debug-files/print-sources.ts @@ -110,10 +110,7 @@ export const printSourcesCommand = buildCommand({ "checking what `bundle-sources` would include. Supports Mach-O/dSYM, " + "ELF, PE/PDB, Portable PDB, and Breakpad.\n\n" + "The format is auto-detected. This command is local-only and makes no " + - "network requests.\n\n" + - "Usage:\n" + - " sentry debug-files print-sources ./libexample.so\n" + - " sentry debug-files print-sources ./app.pdb --json", + "network requests.", examples: [ { description: diff --git a/packages/cli/src/commands/debug-files/upload.ts b/packages/cli/src/commands/debug-files/upload.ts index 06c127858..3911f7233 100644 --- a/packages/cli/src/commands/debug-files/upload.ts +++ b/packages/cli/src/commands/debug-files/upload.ts @@ -547,14 +547,6 @@ export const uploadCommand = buildCommand({ "from each file's referenced generated C++ sources and uploaded as " + "separate il2cpp debug files; combine with --include-sources to also " + "bundle the referenced C# source files.\n\n" + - "Usage:\n" + - " sentry debug-files upload ./build\n" + - " sentry debug-files upload ./symbols.zip\n" + - " sentry debug-files upload ./libexample.so --include-sources\n" + - " sentry debug-files upload ./dsyms --type dsym --wait\n" + - " sentry debug-files upload ./build --il2cpp-mapping --include-sources\n" + - " sentry debug-files upload --derived-data --no-upload\n" + - " sentry debug-files upload ./build --no-zips --no-upload\n\n" + "BCSymbolMap resolution (legacy --symbol-maps) is not supported: it " + "only applies to Apple Bitcode, which Apple has deprecated. Use the " + "legacy Rust sentry-cli if you still need it.", @@ -599,6 +591,10 @@ export const uploadCommand = buildCommand({ description: "Preview what would be uploaded (no credentials needed)", command: "sentry debug-files upload ./build --no-upload", }, + { + description: "Scan Xcode's DerivedData without uploading", + command: "sentry debug-files upload --derived-data --no-upload", + }, ], }, output: { diff --git a/packages/cli/src/commands/event/view.ts b/packages/cli/src/commands/event/view.ts index 3ada70a40..cd234f051 100644 --- a/packages/cli/src/commands/event/view.ts +++ b/packages/cli/src/commands/event/view.ts @@ -1169,15 +1169,10 @@ export const viewCommand = buildCommand({ brief: "View details of one or more events", fullDescription: "View detailed information about Sentry events by their IDs.\n\n" + - "Target specification:\n" + - " sentry event view # auto-detect from DSN or config\n" + - " sentry event view / [...] # explicit org and project\n" + - " sentry event view [...] # find project across all orgs\n\n" + "Multiple event IDs can be passed as separate arguments or newline-separated\n" + "within a single argument (handy when piping from other commands).\n\n" + "Attachment metadata (id, name, size, mimetype, download URL) is included when available.\n" + - "Download bytes with:\n" + - ' sentry api "" > file', + "Download the bytes with `sentry api` and the attachment's download URL.", examples: [ { description: "View an event", @@ -1193,6 +1188,17 @@ export const viewCommand = buildCommand({ command: "sentry api 'https://sentry.io/api/0/projects/my-org/my-project/events/EVENT_ID/attachments/ATTACHMENT_ID/?download=1' > screenshot.png", }, + { + description: "View an event in an explicit project", + command: + "sentry event view my-org/my-project abc123def456abc123def456abc12345", + }, + { + description: + "View several events, finding the project across organizations", + command: + "sentry event view my-project abc123def456abc123def456abc12345 def456abc123def456abc123def45678", + }, ], }, output: { diff --git a/packages/cli/src/commands/explore.ts b/packages/cli/src/commands/explore.ts index add55320f..8fd2dcc83 100644 --- a/packages/cli/src/commands/explore.ts +++ b/packages/cli/src/commands/explore.ts @@ -35,8 +35,10 @@ import { appendSortHint, buildListCommand, LIST_MAX_LIMIT, + ORG_ALL_TARGET_BRIEF, PERIOD_ALIASES, paginationHint, + targetPatternExplanation, } from "../lib/list-command.js"; import { logger } from "../lib/logger.js"; import { resolveMetricField } from "../lib/metrics-transform.js"; @@ -604,15 +606,8 @@ export const exploreCommand = buildListCommand("explore", { " metrics Custom metrics (tracemetrics format)\n" + " logs Log entries\n" + " replays Session replay search\n\n" + - "Targets:\n" + - " / Filter by project (auto-adds project: to query)\n" + - " / All projects in org\n" + - " Bare slug — searches across orgs\n" + - " (omitted) Auto-detect from DSN/config\n\n" + - "Metrics (auto mode — resolves type/unit automatically):\n" + - " sentry explore my-org/ -m llm.token_usage --dataset metrics\n" + - " sentry explore my-org/seer -F gen_ai.request.model -m llm.token_usage --dataset metrics --period 7d\n" + - " sentry explore my-org/ -m cache.hit_rate --agg avg --dataset metrics", + "A / target adds project: to the query. " + + targetPatternExplanation(), examples: [ { description: "Top errors in the last 24 hours, scoped to a project", @@ -698,8 +693,7 @@ export const exploreCommand = buildListCommand("explore", { parameters: [ { placeholder: "target", - brief: - "Target: /, /, or . Auto-detected if omitted.", + brief: ORG_ALL_TARGET_BRIEF, parse: orgOptionalTarget, optional: true as const, }, diff --git a/packages/cli/src/commands/feedback/list.ts b/packages/cli/src/commands/feedback/list.ts index 1f2224937..cb6bf1985 100644 --- a/packages/cli/src/commands/feedback/list.ts +++ b/packages/cli/src/commands/feedback/list.ts @@ -26,6 +26,7 @@ import { LIST_DEFAULT_LIMIT, LIST_MAX_LIMIT, LIST_MIN_LIMIT, + ORG_ALL_TARGET_BRIEF, PERIOD_ALIASES, paginationHint, targetPatternExplanation, @@ -136,11 +137,6 @@ export const listCommand = buildListCommand("feedback", { brief: "List and search User Feedback", fullDescription: "List modern User Feedback captured by Sentry. Feedback is queried from the issue index with a mandatory category filter.\n\n" + - "Target patterns:\n" + - " sentry feedback list # auto-detect organization\n" + - " sentry feedback list / # all projects in an organization\n" + - " sentry feedback list / # one project\n" + - " sentry feedback list # find project across organizations\n\n" + `${targetPatternExplanation()}\n\n` + "Mailboxes:\n" + " unresolved Inbox feedback (default)\n" + @@ -195,7 +191,7 @@ export const listCommand = buildListCommand("feedback", { parameters: [ { placeholder: "org/project", - brief: "/, /, or (search)", + brief: ORG_ALL_TARGET_BRIEF, parse: orgOptionalTarget, optional: true, }, diff --git a/packages/cli/src/commands/integration/list.ts b/packages/cli/src/commands/integration/list.ts index 6fb77833f..f0dc99cb8 100644 --- a/packages/cli/src/commands/integration/list.ts +++ b/packages/cli/src/commands/integration/list.ts @@ -58,14 +58,6 @@ const docs: OrgListCommandDocs = { fullDescription: "List integrations installed on an organization (GitHub, GitLab, Slack, Jira, ...).\n\n" + "Includes integrations that are disabled or pending deletion.\n\n" + - "Target specification:\n" + - " sentry integration list # auto-detect from DSN or config\n" + - " sentry integration list / # list all integrations in org (paginated)\n" + - " sentry integration list / # list integrations in org (project context)\n" + - " sentry integration list # list integrations in org\n\n" + - "Pagination:\n" + - " sentry integration list / -c next # fetch next page\n" + - " sentry integration list / -c prev # fetch previous page\n\n" + "Alias: `sentry integrations` → `sentry integration list`", examples: [ { diff --git a/packages/cli/src/commands/issue/list.ts b/packages/cli/src/commands/issue/list.ts index a8251f4b5..e8b826a52 100644 --- a/packages/cli/src/commands/issue/list.ts +++ b/packages/cli/src/commands/issue/list.ts @@ -1604,12 +1604,6 @@ export const listCommand = buildListCommand("issue", { brief: "List issues in a project", fullDescription: "List issues from Sentry projects.\n\n" + - "Target patterns:\n" + - " sentry issue list # auto-detect from DSN or config\n" + - " sentry issue list / # explicit org and project\n" + - " sentry issue list /a,b # several projects in the same org\n" + - " sentry issue list / # all projects in org (trailing / required)\n" + - " sentry issue list # find project across all orgs\n\n" + `${targetPatternExplanation()}\n\n` + "In monorepos with multiple Sentry projects, shows issues from all detected projects.\n\n" + "The --limit flag specifies the total number of issues to display (max 1000). " + @@ -1630,6 +1624,10 @@ export const listCommand = buildListCommand("issue", { " Docs: https://docs.sentry.io/concepts/search/\n\n" + "Alias: `sentry issues` → `sentry issue list`", examples: [ + { + description: "List issues (project auto-detected)", + command: "sentry issue list", + }, { description: "List issues in a specific project", command: "sentry issue list my-org/frontend", diff --git a/packages/cli/src/commands/log/list.ts b/packages/cli/src/commands/log/list.ts index 6539621c7..1735e7e81 100644 --- a/packages/cli/src/commands/log/list.ts +++ b/packages/cli/src/commands/log/list.ts @@ -704,14 +704,8 @@ export const listCommand = buildListCommand( brief: "List logs from a project", fullDescription: "List and stream logs from Sentry projects.\n\n" + - "Target patterns:\n" + - " sentry log list # auto-detect from DSN or config\n" + - " sentry log list / # explicit org and project\n" + - " sentry log list # find project across all orgs\n\n" + `${TARGET_PATTERN_NOTE}\n\n` + - "Trace filtering:\n" + - " sentry log list # Filter by trace (auto-detect org)\n" + - " sentry log list / # Filter by trace (explicit org)\n\n" + + "Pass a 32-character trace ID instead of a project to filter by trace.\n\n" + "Alias: `sentry logs` → `sentry log list`", examples: [ { description: "List the last 100 logs", command: "sentry log list" }, @@ -752,6 +746,10 @@ export const listCommand = buildListCommand( command: "sentry log list --json | jq '.data[] | select(.severity == \"error\")'", }, + { + description: "Filter by trace in an explicit organization", + command: "sentry log list my-org/abc123def456abc123def456abc12345", + }, ], }, output: { diff --git a/packages/cli/src/commands/log/view.ts b/packages/cli/src/commands/log/view.ts index 661fffe6e..38cab4a19 100644 --- a/packages/cli/src/commands/log/view.ts +++ b/packages/cli/src/commands/log/view.ts @@ -563,10 +563,6 @@ export const viewCommand = buildCommand({ brief: "View details of one or more log entries", fullDescription: "View detailed information about Sentry log entries by their IDs.\n\n" + - "Target specification:\n" + - " sentry log view # auto-detect from DSN or config\n" + - " sentry log view / [...] # explicit org and project\n" + - " sentry log view [...] # find project across all orgs\n\n" + "Multiple log IDs can be passed as separate arguments or newline-separated\n" + "within a single argument (handy when piping from other commands).\n\n" + "The log ID is the 32-character hexadecimal identifier shown in log listings.", @@ -584,6 +580,10 @@ export const viewCommand = buildCommand({ description: "Open in the browser", command: "sentry log view 968c763c740cfda8b6728f27fb9e9b01 -w", }, + { + description: "Find a project across organizations", + command: "sentry log view backend 968c763c740cfda8b6728f27fb9e9b01", + }, ], }, output: { diff --git a/packages/cli/src/commands/monitor/index.ts b/packages/cli/src/commands/monitor/index.ts index dd2170967..d9a20c44b 100644 --- a/packages/cli/src/commands/monitor/index.ts +++ b/packages/cli/src/commands/monitor/index.ts @@ -12,8 +12,6 @@ export const monitorRoute = buildRouteMap({ brief: "Work with Sentry cron monitors", fullDescription: "Run commands with cron monitor check-ins and list configured monitors.\n\n" + - " sentry monitor run -- # wrap a command with check-ins\n" + - " sentry monitor list # list configured monitors\n\n" + "Alias: `sentry monitors` → `sentry monitor list`", }, }); diff --git a/packages/cli/src/commands/monitor/list.ts b/packages/cli/src/commands/monitor/list.ts index 537c419ea..f747d3b95 100644 --- a/packages/cli/src/commands/monitor/list.ts +++ b/packages/cli/src/commands/monitor/list.ts @@ -75,14 +75,6 @@ const docs: OrgListCommandDocs = { brief: "List cron monitors", fullDescription: "List cron monitors in an organization.\n\n" + - "Target specification:\n" + - " sentry monitor list # auto-detect from DSN or config\n" + - " sentry monitor list / # list all monitors in org (paginated)\n" + - " sentry monitor list / # list monitors in org (project context)\n" + - " sentry monitor list # list monitors in org\n\n" + - "Pagination:\n" + - " sentry monitor list / -c next # fetch next page\n" + - " sentry monitor list / -c prev # fetch previous page\n\n" + "Alias: `sentry monitors` → `sentry monitor list`", examples: [ { diff --git a/packages/cli/src/commands/proguard/upload.ts b/packages/cli/src/commands/proguard/upload.ts index 740f09712..4ec2d6cfe 100644 --- a/packages/cli/src/commands/proguard/upload.ts +++ b/packages/cli/src/commands/proguard/upload.ts @@ -156,13 +156,7 @@ export const uploadCommand = buildCommand({ "Upload one or more ProGuard/R8 mapping files to Sentry using " + "the chunk-upload protocol. Each mapping is identified by a " + "deterministic UUID derived from its content.\n\n" + - "Org/project are auto-detected from DSN, env vars, or config defaults.\n\n" + - "Usage:\n" + - " sentry proguard upload mapping.txt\n" + - " sentry proguard upload build/mapping1.txt build/mapping2.txt\n" + - " sentry proguard upload mapping.txt --uuid 5db7294d-87fc-5726-a5c0-4a90679657a5\n" + - " sentry proguard upload mapping.txt --no-upload\n" + - " sentry proguard upload mapping.txt --json", + "Org/project are auto-detected from DSN, env vars, or config defaults.", examples: [ { description: "Upload a ProGuard/R8 mapping file", @@ -181,6 +175,11 @@ export const uploadCommand = buildCommand({ description: "Fail if no mapping files are found (useful in CI)", command: "sentry proguard upload ./mapping/ --require-one", }, + { + description: "Upload with an explicit UUID", + command: + "sentry proguard upload mapping.txt --uuid 5db7294d-87fc-5726-a5c0-4a90679657a5", + }, ], }, output: { diff --git a/packages/cli/src/commands/proguard/uuid.ts b/packages/cli/src/commands/proguard/uuid.ts index 664bc12f4..75058dfb1 100644 --- a/packages/cli/src/commands/proguard/uuid.ts +++ b/packages/cli/src/commands/proguard/uuid.ts @@ -27,10 +27,7 @@ export const uuidCommand = buildCommand({ fullDescription: "Compute and print the UUID of a ProGuard/R8 mapping file. The UUID is " + "deterministically derived from the file contents and matches the " + - "value assigned by `sentry proguard upload`.\n\n" + - "Usage:\n" + - " sentry proguard uuid ./app/build/outputs/mapping/release/mapping.txt\n" + - " sentry proguard uuid mapping.txt --json", + "value assigned by `sentry proguard upload`.", examples: [ { description: "Compute the UUID for a ProGuard/R8 mapping file", diff --git a/packages/cli/src/commands/project/list.ts b/packages/cli/src/commands/project/list.ts index 9a4734f48..04449b4e6 100644 --- a/packages/cli/src/commands/project/list.ts +++ b/packages/cli/src/commands/project/list.ts @@ -698,23 +698,13 @@ export const listCommand = buildListCommand("project", { brief: "List projects", fullDescription: "List projects in an organization.\n\n" + - "Target patterns:\n" + - " sentry project list # auto-detect from DSN or config\n" + - " sentry project list / # all projects in org (paginated)\n" + - " sentry project list / # show specific project\n" + - " sentry project list /, # show several projects\n" + - " sentry project list # find project across all orgs\n\n" + `${targetPatternExplanation("Cursor pagination (--cursor) requires the / form.")}\n\n` + - "Pagination:\n" + - " sentry project list / -c next # next page\n" + - " sentry project list / -c prev # previous page\n" + - " sentry project list / -c # resume at specific cursor\n\n" + - "Filtering and output:\n" + - " sentry project list --platform javascript # filter by platform\n" + - " sentry project list --limit 50 # show more results\n" + - " sentry project list --json # output as JSON\n\n" + "Alias: `sentry projects` → `sentry project list`", examples: [ + { + description: "List projects (organization auto-detected)", + command: "sentry project list", + }, { description: "List all projects in an organization", command: "sentry project list my-org/", @@ -727,6 +717,22 @@ export const listCommand = buildListCommand("project", { description: "Filter by platform", command: "sentry project list my-org/ --platform javascript", }, + { + description: "Find a project across organizations", + command: "sentry project list frontend", + }, + { + description: "Fetch the next page", + command: "sentry project list my-org/ -c next", + }, + { + description: "Show more results", + command: "sentry project list my-org/ --limit 50", + }, + { + description: "Output as JSON", + command: "sentry project list my-org/ --json", + }, ], }, output: { diff --git a/packages/cli/src/commands/project/view.ts b/packages/cli/src/commands/project/view.ts index 0c6d57277..78840ec20 100644 --- a/packages/cli/src/commands/project/view.ts +++ b/packages/cli/src/commands/project/view.ts @@ -25,6 +25,7 @@ import { applyFreshFlag, FRESH_ALIASES, FRESH_FLAG, + PROJECT_TARGET_BRIEF, TARGET_PATTERN_NOTE, } from "../../lib/list-command.js"; import { @@ -332,13 +333,13 @@ export const viewCommand = buildCommand({ brief: "View details of a project", fullDescription: "View detailed information about Sentry projects.\n\n" + - "Target patterns:\n" + - " sentry project view # auto-detect from DSN or config\n" + - " sentry project view / # explicit org and project\n" + - " sentry project view # find project across all orgs\n\n" + `${TARGET_PATTERN_NOTE}\n\n` + "In monorepos with multiple Sentry projects, shows details for all detected projects.", examples: [ + { + description: "View the auto-detected project", + command: "sentry project view", + }, { description: "View project details", command: "sentry project view my-org/frontend", @@ -347,6 +348,10 @@ export const viewCommand = buildCommand({ description: "Open the project in the browser", command: "sentry project view my-org/frontend -w", }, + { + description: "Find a project across organizations", + command: "sentry project view frontend", + }, ], }, output: { @@ -359,7 +364,7 @@ export const viewCommand = buildCommand({ parameters: [ { placeholder: "org/project", - brief: "/, (search), or omit for auto-detect", + brief: PROJECT_TARGET_BRIEF, parse: orgProjectTarget(resolveViewTargets), optional: true, }, diff --git a/packages/cli/src/commands/release/create.ts b/packages/cli/src/commands/release/create.ts index 9b326585e..016593333 100644 --- a/packages/cli/src/commands/release/create.ts +++ b/packages/cli/src/commands/release/create.ts @@ -68,7 +68,8 @@ export const createCommand = buildCommand({ }, { description: "Create a release from a proposed version", - command: "sentry release create $(sentry release propose-version)", + command: + 'sentry release create "$(sentry release propose-version --json | jq -r .version)"', }, { description: "Set the release ref and URL", diff --git a/packages/cli/src/commands/release/list.ts b/packages/cli/src/commands/release/list.ts index 0b4a65ebe..d2aa61780 100644 --- a/packages/cli/src/commands/release/list.ts +++ b/packages/cli/src/commands/release/list.ts @@ -640,14 +640,6 @@ export const listCommand = buildListCommand("release", { " users # by total users\n" + " crash_free_sessions # by crash-free session rate (aliases: stable_sessions, cfs)\n" + " crash_free_users # by crash-free user rate (aliases: stable_users, cfu)\n\n" + - "Target specification:\n" + - " sentry release list # auto-detect from DSN (project-scoped)\n" + - " sentry release list / # list all releases in org (paginated)\n" + - " sentry release list / # list releases for project\n" + - " sentry release list # list releases in org\n\n" + - "Pagination:\n" + - " sentry release list / -c next # fetch next page\n" + - " sentry release list / -c prev # fetch previous page\n\n" + "Alias: `sentry releases` → `sentry release list`", examples: [ { @@ -675,6 +667,10 @@ export const listCommand = buildListCommand("release", { command: "sentry release list --period 7d", }, { description: "Output as JSON", command: "sentry release list --json" }, + { + description: "Fetch the next page", + command: "sentry release list my-org/ -c next", + }, ], }, output: { diff --git a/packages/cli/src/commands/release/propose-version.ts b/packages/cli/src/commands/release/propose-version.ts index 070f5ad4f..01ac8abc3 100644 --- a/packages/cli/src/commands/release/propose-version.ts +++ b/packages/cli/src/commands/release/propose-version.ts @@ -81,9 +81,7 @@ export const proposeVersionCommand = buildCommand({ " 12. CI_COMMIT_SHA (GitLab CI)\n" + " 13. BITBUCKET_COMMIT (Bitbucket Pipelines)\n" + " 14. TRAVIS_COMMIT (Travis CI)\n" + - " 15. Git HEAD SHA (fallback)\n\n" + - "Useful in CI scripts:\n" + - " sentry release create $(sentry release propose-version)", + " 15. Git HEAD SHA (fallback)", examples: [ { description: "Propose a version from git HEAD", @@ -93,6 +91,11 @@ export const proposeVersionCommand = buildCommand({ description: "Output as JSON", command: "sentry release propose-version --json", }, + { + description: "Create a release named after the proposed version", + command: + 'sentry release create "$(sentry release propose-version --json | jq -r .version)"', + }, ], }, output: { diff --git a/packages/cli/src/commands/replay/list.ts b/packages/cli/src/commands/replay/list.ts index b74c7eeff..7c46dbbd0 100644 --- a/packages/cli/src/commands/replay/list.ts +++ b/packages/cli/src/commands/replay/list.ts @@ -35,6 +35,7 @@ import { LIST_MAX_LIMIT, LIST_MIN_LIMIT, LIST_PERIOD_FLAG, + ORG_ALL_TARGET_BRIEF, PERIOD_ALIASES, paginationHint, targetPatternExplanation, @@ -254,11 +255,6 @@ export const listCommand = buildListCommand("replay", { brief: "List recent Session Replays", fullDescription: "List recent Session Replays from Sentry.\n\n" + - "Target patterns:\n" + - " sentry replay list # auto-detect org from config or DSN\n" + - " sentry replay list / # list all org replays\n" + - " sentry replay list / # list replays for one project\n" + - " sentry replay list # find project across all orgs\n\n" + `${targetPatternExplanation()}\n\n` + "Alias: `sentry replays` → `sentry replay list`", examples: [ @@ -304,6 +300,10 @@ export const listCommand = buildListCommand("replay", { description: "Output as JSON", command: "sentry replay list my-org/frontend --json", }, + { + description: "Find a project across organizations", + command: "sentry replay list frontend", + }, ], }, output: { @@ -317,7 +317,7 @@ export const listCommand = buildListCommand("replay", { parameters: [ { placeholder: "org/project", - brief: "/, /, or (search)", + brief: ORG_ALL_TARGET_BRIEF, parse: orgOptionalTarget, optional: true, }, diff --git a/packages/cli/src/commands/repo/list.ts b/packages/cli/src/commands/repo/list.ts index c5c4fc080..5e13137c2 100644 --- a/packages/cli/src/commands/repo/list.ts +++ b/packages/cli/src/commands/repo/list.ts @@ -58,14 +58,6 @@ const docs: OrgListCommandDocs = { brief: "List repositories", fullDescription: "List repositories connected to an organization.\n\n" + - "Target specification:\n" + - " sentry repo list # auto-detect from DSN or config\n" + - " sentry repo list / # list all repos in org (paginated)\n" + - " sentry repo list / # list repos in org (project context)\n" + - " sentry repo list # list repos in org\n\n" + - "Pagination:\n" + - " sentry repo list / -c next # fetch next page\n" + - " sentry repo list / -c prev # fetch previous page\n\n" + "Alias: `sentry repos` → `sentry repo list`", examples: [ { diff --git a/packages/cli/src/commands/snapshots/diff.ts b/packages/cli/src/commands/snapshots/diff.ts index d841cd045..7699ad879 100644 --- a/packages/cli/src/commands/snapshots/diff.ts +++ b/packages/cli/src/commands/snapshots/diff.ts @@ -232,11 +232,7 @@ export const diffCommand = buildCommand({ "both directories are diffed perceptually; a PNG diff mask is written " + "for each changed image, and a JSON report is printed.\n\n" + "Comparison is anti-aliasing aware (disable with --no-antialiasing) and " + - "makes no network requests.\n\n" + - "Usage:\n" + - " sentry snapshots diff ./baseline ./head\n" + - " sentry snapshots diff ./baseline ./head --threshold 0.02 --output ./diffs/\n" + - " sentry snapshots diff ./baseline ./head --fail-on-diff", + "makes no network requests.", examples: [ { description: "Compare two directories of snapshot images locally", @@ -248,6 +244,10 @@ export const diffCommand = buildCommand({ command: "sentry snapshots diff ./baseline ./head --fail-on-diff --threshold 0.02", }, + { + description: "Write diff masks to a directory", + command: "sentry snapshots diff ./baseline ./head --output ./diffs/", + }, ], }, output: { diff --git a/packages/cli/src/commands/snapshots/download.ts b/packages/cli/src/commands/snapshots/download.ts index 4ccbf713b..3d49626c0 100644 --- a/packages/cli/src/commands/snapshots/download.ts +++ b/packages/cli/src/commands/snapshots/download.ts @@ -154,11 +154,7 @@ export const downloadCommand = buildCommand({ "Use --snapshot-id to download a specific snapshot, or --app-id to " + "resolve the latest baseline (org auth tokens require --project with a " + "project ID or slug for --app-id).\n\n" + - "This feature only works with Sentry SaaS.\n\n" + - "Usage:\n" + - " sentry snapshots download --snapshot-id 1234567890\n" + - " sentry snapshots download --app-id my-app --branch main\n" + - " sentry snapshots download --app-id my-app --output ./baseline/", + "This feature only works with Sentry SaaS.", examples: [ { description: "Download a specific baseline snapshot by ID", diff --git a/packages/cli/src/commands/snapshots/upload.ts b/packages/cli/src/commands/snapshots/upload.ts index 954b4467b..dbaf23390 100644 --- a/packages/cli/src/commands/snapshots/upload.ts +++ b/packages/cli/src/commands/snapshots/upload.ts @@ -340,11 +340,7 @@ export const uploadCommand = buildCommand({ "Each image (PNG/JPEG) is hashed and uploaded to Sentry's object store " + "(images already present are skipped), then a manifest is created. " + "Companion `.json` sidecar files add per-image metadata. " + - "This feature only works with Sentry SaaS.\n\n" + - "Usage:\n" + - " sentry snapshots upload ./screenshots --app-id com.example.app\n" + - " sentry snapshots upload ./shots --app-id my-app --diff-threshold 0.01\n" + - " sentry snapshots upload ./shots --app-id my-app --selective", + "This feature only works with Sentry SaaS.", examples: [ { description: "Upload a folder of screenshots as a snapshot for an app", diff --git a/packages/cli/src/commands/sourcemap/inject.ts b/packages/cli/src/commands/sourcemap/inject.ts index 531e6bdc1..d4f0c60c8 100644 --- a/packages/cli/src/commands/sourcemap/inject.ts +++ b/packages/cli/src/commands/sourcemap/inject.ts @@ -64,12 +64,7 @@ export const injectCommand = buildCommand({ "Exits with an error if zero JS + sourcemap pairs are discovered " + "(typical cause: bundler not emitting .map files). Pass " + "--allow-empty to suppress this check for directories that may " + - "legitimately be empty.\n\n" + - "Usage:\n" + - " sentry sourcemap inject ./dist\n" + - " sentry sourcemap inject ./build --ext .js,.mjs\n" + - " sentry sourcemap inject ./out --dry-run\n" + - " sentry sourcemap inject ./maybe-empty --allow-empty", + "legitimately be empty.", examples: [ { description: "Inject debug IDs into all JS files in dist/", @@ -83,6 +78,10 @@ export const injectCommand = buildCommand({ description: "Only process specific extensions", command: "sentry sourcemap inject ./build --ext .js,.mjs", }, + { + description: "Allow a directory with no sourcemaps", + command: "sentry sourcemap inject ./maybe-empty --allow-empty", + }, ], }, // Purely local file operation — no Sentry API calls, no auth needed. diff --git a/packages/cli/src/commands/sourcemap/resolve.ts b/packages/cli/src/commands/sourcemap/resolve.ts index 04f862c00..af6a23309 100644 --- a/packages/cli/src/commands/sourcemap/resolve.ts +++ b/packages/cli/src/commands/sourcemap/resolve.ts @@ -110,11 +110,7 @@ export const resolveCommand = buildCommand({ ".map file, external sourceMappingURL directive, inline data: URL, or " + "none) and whether a Sentry debug ID has been injected.\n\n" + "This command never modifies files. Use it to debug why " + - "`sentry sourcemap upload` may not find the expected sourcemaps.\n\n" + - "Usage:\n" + - " sentry sourcemap resolve ./dist\n" + - " sentry sourcemap resolve ./build --ext .js,.mjs\n" + - " sentry sourcemap resolve ./out --json", + "`sentry sourcemap upload` may not find the expected sourcemaps.", examples: [ { description: @@ -125,6 +121,10 @@ export const resolveCommand = buildCommand({ description: "Output as JSON", command: "sentry sourcemap resolve ./dist --json", }, + { + description: "Only scan some extensions", + command: "sentry sourcemap resolve ./build --ext .js,.mjs", + }, ], }, // Purely local file operation — no Sentry API calls, no auth needed. diff --git a/packages/cli/src/commands/sourcemap/upload.ts b/packages/cli/src/commands/sourcemap/upload.ts index 39d7bc23d..914a35c09 100644 --- a/packages/cli/src/commands/sourcemap/upload.ts +++ b/packages/cli/src/commands/sourcemap/upload.ts @@ -213,15 +213,7 @@ export const uploadCommand = buildCommand({ "Exits with an error if zero JS + sourcemap pairs are discovered " + "(typical cause: bundler not emitting .map files). Pass " + "--allow-empty to suppress this check for directories that may " + - "legitimately be empty.\n\n" + - "Usage:\n" + - " sentry sourcemap upload ./dist\n" + - " sentry sourcemap upload ./dist --release 1.0.0\n" + - " sentry sourcemap upload ./dist --release 1.0.0 --dist 12345\n" + - " sentry sourcemap upload ./dist --url-prefix '~/static/js/'\n" + - " sentry sourcemap upload ./dist --no-rewrite\n" + - " sentry sourcemap upload ./dist --ext .js,.mjs\n" + - " sentry sourcemap upload ./maybe-empty --allow-empty", + "legitimately be empty.", examples: [ { description: "Upload sourcemaps from dist/", @@ -239,6 +231,18 @@ export const uploadCommand = buildCommand({ description: "Don't fail when no sourcemaps are found", command: "sentry sourcemap upload ./dist --allow-empty", }, + { + description: "Set a release and distribution", + command: "sentry sourcemap upload ./dist --release 1.0.0 --dist 12345", + }, + { + description: "Upload without rewriting sourcemaps", + command: "sentry sourcemap upload ./dist --no-rewrite", + }, + { + description: "Only upload some extensions", + command: "sentry sourcemap upload ./dist --ext .js,.mjs", + }, ], }, output: { diff --git a/packages/cli/src/commands/span/list.ts b/packages/cli/src/commands/span/list.ts index b8533eebd..aef68536d 100644 --- a/packages/cli/src/commands/span/list.ts +++ b/packages/cli/src/commands/span/list.ts @@ -542,19 +542,8 @@ export const listCommand = buildListCommand("span", { brief: "List spans in a project or trace", fullDescription: "List spans from a Sentry project, or within a specific trace.\n\n" + - "Project mode (no trace ID):\n" + - " sentry span list # auto-detect from DSN or config\n" + - " sentry span list / # explicit org and project\n" + - " sentry span list # find project across all orgs\n\n" + `${TARGET_PATTERN_NOTE}\n\n` + - "Trace mode (provide a 32-char trace ID):\n" + - " sentry span list # auto-detect org/project\n" + - " sentry span list // # explicit\n" + - " sentry span list # find project + trace\n\n" + - "Pagination:\n" + - " sentry span list -c next # fetch next page (project mode)\n" + - " sentry span list -c prev # fetch previous page\n" + - " sentry span list -c next # fetch next page (trace mode)\n\n" + + "Pass a 32-character trace ID to list the spans in one trace.\n\n" + "Alias: `sentry spans` → `sentry span list`", examples: [ { @@ -591,6 +580,18 @@ export const listCommand = buildListCommand("span", { description: "Fetch the next page", command: "sentry span list -c next", }, + { + description: "List spans in an explicit project", + command: "sentry span list my-org/cli-server", + }, + { + description: "Find a project across organizations, then list a trace", + command: "sentry span list cli-server abc123def456abc123def456abc12345", + }, + { + description: "Fetch the next page of a trace", + command: "sentry span list abc123def456abc123def456abc12345 -c next", + }, ], }, output: { diff --git a/packages/cli/src/commands/span/view.ts b/packages/cli/src/commands/span/view.ts index c25f81ff7..8718697c8 100644 --- a/packages/cli/src/commands/span/view.ts +++ b/packages/cli/src/commands/span/view.ts @@ -370,9 +370,6 @@ export const viewCommand = buildCommand({ brief: "View details of specific spans", fullDescription: "View detailed information about one or more spans within a trace.\n\n" + - "Target specification:\n" + - " sentry span view # auto-detect\n" + - " sentry span view // # explicit\n\n" + "The first argument is the trace ID (optionally prefixed with org/project),\n" + "followed by one or more span IDs.", examples: [ diff --git a/packages/cli/src/commands/team/list.ts b/packages/cli/src/commands/team/list.ts index 9dfd9b194..e8b6f6cf6 100644 --- a/packages/cli/src/commands/team/list.ts +++ b/packages/cli/src/commands/team/list.ts @@ -59,14 +59,6 @@ const docs: OrgListCommandDocs = { brief: "List teams", fullDescription: "List teams in an organization.\n\n" + - "Target specification:\n" + - " sentry team list # auto-detect from DSN or config\n" + - " sentry team list / # list all teams in org (paginated)\n" + - " sentry team list / # list teams in org (project context)\n" + - " sentry team list # list teams in org\n\n" + - "Pagination:\n" + - " sentry team list / -c next # fetch next page\n" + - " sentry team list / -c prev # fetch previous page\n\n" + "Alias: `sentry teams` → `sentry team list`", examples: [ { diff --git a/packages/cli/src/commands/trace/list.ts b/packages/cli/src/commands/trace/list.ts index cd31c8f8d..16998ea52 100644 --- a/packages/cli/src/commands/trace/list.ts +++ b/packages/cli/src/commands/trace/list.ts @@ -25,6 +25,7 @@ import { LIST_MIN_LIMIT, LIST_PERIOD_FLAG, PERIOD_ALIASES, + PROJECT_TARGET_BRIEF, paginationHint, TARGET_PATTERN_NOTE, } from "../../lib/list-command.js"; @@ -197,10 +198,6 @@ export const listCommand = buildListCommand("trace", { brief: "List recent traces in a project", fullDescription: "List recent traces from Sentry projects.\n\n" + - "Target patterns:\n" + - " sentry trace list # auto-detect from DSN or config\n" + - " sentry trace list / # explicit org and project\n" + - " sentry trace list # find project across all orgs\n\n" + `${TARGET_PATTERN_NOTE}\n\n` + "Alias: `sentry traces` → `sentry trace list`", examples: [ @@ -222,6 +219,10 @@ export const listCommand = buildListCommand("trace", { description: "Fetch the next page", command: "sentry trace list my-org/backend -c next", }, + { + description: "Find a project across organizations", + command: "sentry trace list backend", + }, ], }, output: { @@ -235,7 +236,7 @@ export const listCommand = buildListCommand("trace", { parameters: [ { placeholder: "org/project", - brief: "/ or (search)", + brief: PROJECT_TARGET_BRIEF, parse: projectBoundTarget, optional: true, }, diff --git a/packages/cli/src/commands/trace/logs.ts b/packages/cli/src/commands/trace/logs.ts index d48960a81..0124ac3da 100644 --- a/packages/cli/src/commands/trace/logs.ts +++ b/packages/cli/src/commands/trace/logs.ts @@ -102,10 +102,6 @@ export const logsCommand = buildCommand({ brief: "View logs associated with a trace", fullDescription: "View logs associated with a specific distributed trace.\n\n" + - "Target specification:\n" + - " sentry trace logs # auto-detect org\n" + - " sentry trace logs / # explicit org\n" + - " sentry trace logs // # filter to project\n\n" + "When a project is specified, only logs from that project are shown.\n" + "Use --query 'project:[a,b]' to filter to multiple projects.\n\n" + "The trace ID is the 32-character hexadecimal identifier.", @@ -138,6 +134,10 @@ export const logsCommand = buildCommand({ description: "Output as JSON", command: "sentry trace logs --json abc123def456abc123def456abc12345", }, + { + description: "Logs for a trace in an explicit organization", + command: "sentry trace logs my-org/abc123def456abc123def456abc12345", + }, ], }, output: { diff --git a/packages/cli/src/commands/trace/view.ts b/packages/cli/src/commands/trace/view.ts index 48808f697..94e42ba5e 100644 --- a/packages/cli/src/commands/trace/view.ts +++ b/packages/cli/src/commands/trace/view.ts @@ -470,10 +470,6 @@ export const viewCommand = buildCommand({ brief: "View details of a specific trace", fullDescription: "View detailed information about a distributed trace by its ID.\n\n" + - "Target specification:\n" + - " sentry trace view # auto-detect from DSN or config\n" + - " sentry trace view // # explicit org and project\n" + - " sentry trace view # find project across all orgs\n\n" + "The trace ID is the 32-character hexadecimal identifier.", examples: [ { @@ -497,6 +493,11 @@ export const viewCommand = buildCommand({ description: "Open the trace in the browser", command: "sentry trace view abc123def456abc123def456abc12345 -w", }, + { + description: "Find a project across organizations", + command: + "sentry trace view cli-server abc123def456abc123def456abc12345", + }, ], }, output: { diff --git a/packages/cli/src/commands/wasm-split.ts b/packages/cli/src/commands/wasm-split.ts index b2f4b6f2d..bc392ffa9 100644 --- a/packages/cli/src/commands/wasm-split.ts +++ b/packages/cli/src/commands/wasm-split.ts @@ -63,11 +63,7 @@ export const wasmSplitCommand = buildCommand({ "The debug companion is a complete copy of the module, captured before " + "stripping. DWARF offsets are relative to the code section, so a " + "companion missing it cannot be symbolicated.\n\n" + - "This is a drop-in replacement for Symbolicator's `wasm-split` binary.\n\n" + - "Usage:\n" + - " sentry wasm-split app.wasm\n" + - " sentry wasm-split app.wasm -d app.debug.wasm --strip\n" + - " BUILD_ID=$(sentry wasm-split app.wasm)", + "This is a drop-in replacement for Symbolicator's `wasm-split` binary.", examples: [ { description: "Add a build ID to a module in place and print it", diff --git a/packages/cli/src/lib/list-command.ts b/packages/cli/src/lib/list-command.ts index 71a264461..305bf9016 100644 --- a/packages/cli/src/lib/list-command.ts +++ b/packages/cli/src/lib/list-command.ts @@ -68,6 +68,18 @@ export const LIST_MIN_LIMIT = 1; /** Default number of items returned by list commands when `--limit` is omitted. */ export const LIST_DEFAULT_LIMIT = 25; +/** + * Accepted forms of an `[/][]` target that supports org-all + * mode. Positional briefs render in `--help`, the generated command docs, and + * the skill references, so the target syntax is described here once instead + * of in each command's `fullDescription`. + */ +export const ORG_ALL_TARGET_BRIEF = + "/ (all projects), /, or (search)"; + +/** Accepted forms of a target that names one project (no org-all mode). */ +export const PROJECT_TARGET_BRIEF = "/ or (search)"; + /** * Positional `org/project` parameter shared by all list commands. * @@ -79,7 +91,7 @@ export const LIST_TARGET_POSITIONAL = { parameters: [ { placeholder: "org/project", - brief: "/ (all projects), /, or (search)", + brief: ORG_ALL_TARGET_BRIEF, parse: parseOrgProjectTarget, optional: true as const, }, @@ -95,7 +107,7 @@ export const LIST_ORG_TARGET_POSITIONAL = { parameters: [ { placeholder: "org/project", - brief: "/ (all projects), /, or (search)", + brief: ORG_ALL_TARGET_BRIEF, parse: parseOrgTarget, optional: true as const, }, diff --git a/packages/cli/test/e2e/log.test.ts b/packages/cli/test/e2e/log.test.ts index 9f71b4fdb..da03416e3 100644 --- a/packages/cli/test/e2e/log.test.ts +++ b/packages/cli/test/e2e/log.test.ts @@ -198,7 +198,7 @@ describe("sentry log list (trace mode)", () => { expect(result.exitCode).toBe(0); expect(result.stdout).toMatch(/trace-id/i); - expect(result.stdout).toMatch(/trace filtering/i); + expect(result.stdout).toMatch(/filter by trace/i); }); }); diff --git a/packages/cli/test/script/generate-skill-markdown.test.ts b/packages/cli/test/script/generate-skill-markdown.test.ts index 5918de3f1..0206edc93 100644 --- a/packages/cli/test/script/generate-skill-markdown.test.ts +++ b/packages/cli/test/script/generate-skill-markdown.test.ts @@ -10,10 +10,17 @@ import { import { listCommand } from "../../src/commands/agent-conversation/list.js"; import { viewCommand } from "../../src/commands/agent-conversation/view.js"; import { sendCommand } from "../../src/commands/event/send.js"; +import { listCommand as feedbackListCommand } from "../../src/commands/feedback/list.js"; import { mergeCommand } from "../../src/commands/issue/merge.js"; import { createCommand } from "../../src/commands/project/create.js"; import { deleteCommand } from "../../src/commands/project/delete.js"; +import { listCommand as teamListCommand } from "../../src/commands/team/list.js"; +import { listCommand as traceListCommand } from "../../src/commands/trace/list.js"; import { buildCommandInfo } from "../../src/lib/introspect.js"; +import { + ORG_ALL_TARGET_BRIEF, + PROJECT_TARGET_BRIEF, +} from "../../src/lib/list-command.js"; describe("command metadata in generated references", () => { test("derives conversation signatures and examples from command metadata", () => { @@ -92,9 +99,26 @@ describe("command metadata in generated references", () => { expect(content).not.toContain( "sentry agent-conversation view my-org conv-123", ); + expect(content).toContain( + "| `[/]` | Organization slug (optional) and conversation ID |", + ); } - expect(docs).toContain( - "| `[/]` | Organization slug (optional) and conversation ID |", + }); + + test("list targets take their syntax from the shared briefs", () => { + const brief = (cmd: unknown, path: string) => + buildCommandInfo(cmd as never, path).positionals[0]?.brief; + expect(brief(listCommand, "sentry agent-conversation list")).toBe( + ORG_ALL_TARGET_BRIEF, + ); + expect(brief(feedbackListCommand, "sentry feedback list")).toBe( + ORG_ALL_TARGET_BRIEF, + ); + expect(brief(teamListCommand, "sentry team list")).toBe( + ORG_ALL_TARGET_BRIEF, + ); + expect(brief(traceListCommand, "sentry trace list")).toBe( + PROJECT_TARGET_BRIEF, ); }); diff --git a/scripts/cli-lint-rules.test.mjs b/scripts/cli-lint-rules.test.mjs index 044717720..46bc0c351 100644 --- a/scripts/cli-lint-rules.test.mjs +++ b/scripts/cli-lint-rules.test.mjs @@ -157,6 +157,14 @@ tester.run( filename: commands, code: "buildCommand({ docs: { fullDescription: 'Format: count()\\n Example: p50(value)' } });", }, + { + filename: commands, + code: "buildCommand({ docs: { fullDescription: 'Lists items.\\n\\nRun `sentry item view` for details.' } });", + }, + { + filename: commands, + code: "throw new ContextError('Item', 'sentry item view \\n sentry item list');", + }, { filename: commands, code: "throw new ValidationError('Bad input.\\n\\nExamples:\\n sentry list');", @@ -182,6 +190,16 @@ tester.run( code: "buildCommand({ docs: { fullDescription: 'Manage items.\\n\\n' + '## Examples\\n\\n' + 'sentry item list\\n' } });", errors: 1, }, + { + filename: commands, + code: "buildCommand({ docs: { fullDescription: 'Lists items.\\n\\n' + 'Target patterns:\\n' + ' sentry item list / # all items in org\\n' } });", + errors: 1, + }, + { + filename: commands, + code: "buildCommand({ docs: { fullDescription: `Lists items.\\n\\n sentry item list -c next\\n\\n${note}` } });", + errors: 1, + }, ], }, );