From 60dc339248321e3a082b1cece57a91bfd446e08a Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Sat, 7 Nov 2026 12:27:31 +0000 Subject: [PATCH] refactor(cli): Store example steps without the program name docs.examples steps now leave out `sentry`: `run: "issue list my-org/"`. `--help` adds getInvocationCommand(), and the generated docs, skill references and check:doc-examples add `sentry`, so nothing swaps a leading `sentry ` at runtime anymore. A step inside other shell text keeps it around the invocation, as `{ prefix: "sudo ", args: "cli fix" }`. An AST codemod converted all 711 steps in 697 examples. The no-hardcoded-sentry-command lint rule now rejects a step that starts with `sentry `. Refs #2085 Refs #2050 Co-Authored-By: BYK <126780+BYK@users.noreply.github.com> --- packages/cli/AGENTS.md | 6 +- packages/cli/lint-rules/cli-oxlint-plugin.js | 29 +++++++- packages/cli/script/check-doc-examples.ts | 2 +- packages/cli/script/generate-docs-sections.ts | 2 +- .../src/commands/agent-conversation/list.ts | 27 ++++---- .../src/commands/agent-conversation/view.ts | 6 +- .../cli/src/commands/alert/issues/create.ts | 12 ++-- .../cli/src/commands/alert/issues/delete.ts | 6 +- .../cli/src/commands/alert/issues/edit.ts | 12 ++-- .../cli/src/commands/alert/issues/list.ts | 10 +-- .../cli/src/commands/alert/issues/view.ts | 6 +- .../cli/src/commands/alert/metrics/create.ts | 6 +- .../cli/src/commands/alert/metrics/delete.ts | 4 +- .../cli/src/commands/alert/metrics/edit.ts | 10 ++- .../cli/src/commands/alert/metrics/list.ts | 6 +- .../cli/src/commands/alert/metrics/view.ts | 8 +-- packages/cli/src/commands/api.ts | 38 +++++------ packages/cli/src/commands/attribute/list.ts | 34 ++++------ packages/cli/src/commands/auth/list.ts | 2 +- packages/cli/src/commands/auth/login.ts | 20 +++--- packages/cli/src/commands/auth/logout.ts | 11 ++- packages/cli/src/commands/auth/refresh.ts | 10 +-- packages/cli/src/commands/auth/status.ts | 4 +- packages/cli/src/commands/auth/switch.ts | 7 +- packages/cli/src/commands/auth/token.ts | 2 +- packages/cli/src/commands/auth/whoami.ts | 4 +- packages/cli/src/commands/build/download.ts | 6 +- packages/cli/src/commands/build/upload.ts | 19 ++---- packages/cli/src/commands/cli/completion.ts | 10 ++- packages/cli/src/commands/cli/defaults.ts | 26 +++---- packages/cli/src/commands/cli/feedback.ts | 4 +- packages/cli/src/commands/cli/fix.ts | 9 ++- packages/cli/src/commands/cli/import.ts | 10 +-- packages/cli/src/commands/cli/setup.ts | 12 ++-- packages/cli/src/commands/cli/uninstall.ts | 6 +- packages/cli/src/commands/cli/upgrade.ts | 20 +++--- .../cli/src/commands/code-mappings/upload.ts | 9 ++- .../src/commands/dart-symbol-map/upload.ts | 9 +-- packages/cli/src/commands/dashboard/create.ts | 6 +- packages/cli/src/commands/dashboard/list.ts | 18 ++--- .../cli/src/commands/dashboard/restore.ts | 8 +-- .../cli/src/commands/dashboard/revisions.ts | 10 +-- packages/cli/src/commands/dashboard/view.ts | 20 +++--- .../cli/src/commands/dashboard/widget/add.ts | 24 +++---- .../src/commands/dashboard/widget/delete.ts | 7 +- .../cli/src/commands/dashboard/widget/edit.ts | 12 ++-- .../src/commands/debug-files/bundle-jvm.ts | 9 +-- .../commands/debug-files/bundle-sources.ts | 5 +- .../cli/src/commands/debug-files/check.ts | 7 +- packages/cli/src/commands/debug-files/find.ts | 8 +-- .../src/commands/debug-files/print-sources.ts | 4 +- .../cli/src/commands/debug-files/upload.ts | 22 +++--- packages/cli/src/commands/docs/list.ts | 6 +- packages/cli/src/commands/docs/query.ts | 8 +-- packages/cli/src/commands/dsn/list.ts | 13 ++-- packages/cli/src/commands/event/analytics.ts | 9 ++- packages/cli/src/commands/event/list.ts | 18 ++--- packages/cli/src/commands/event/send.ts | 27 +++----- packages/cli/src/commands/event/view.ts | 24 +++---- packages/cli/src/commands/explore.ts | 55 ++++++--------- packages/cli/src/commands/feedback/list.ts | 18 +++-- packages/cli/src/commands/feedback/resolve.ts | 9 ++- packages/cli/src/commands/feedback/spam.ts | 9 ++- .../cli/src/commands/feedback/unresolve.ts | 11 ++- packages/cli/src/commands/feedback/view.ts | 14 ++-- .../cli/src/commands/games/leaderboard.ts | 4 +- packages/cli/src/commands/games/snake.ts | 2 +- packages/cli/src/commands/info.ts | 6 +- packages/cli/src/commands/init.ts | 4 +- .../cli/src/commands/integration/delete.ts | 6 +- packages/cli/src/commands/integration/list.ts | 12 ++-- packages/cli/src/commands/issue/archive.ts | 22 +++--- packages/cli/src/commands/issue/events.ts | 14 ++-- packages/cli/src/commands/issue/explain.ts | 14 ++-- packages/cli/src/commands/issue/link.ts | 18 ++--- packages/cli/src/commands/issue/list.ts | 24 +++---- packages/cli/src/commands/issue/merge.ts | 9 ++- packages/cli/src/commands/issue/plan.ts | 8 +-- packages/cli/src/commands/issue/resolve.ts | 15 ++--- packages/cli/src/commands/issue/tags.ts | 10 ++- packages/cli/src/commands/issue/unlink.ts | 12 ++-- packages/cli/src/commands/issue/unresolve.ts | 6 +- packages/cli/src/commands/issue/view.ts | 29 ++++---- packages/cli/src/commands/local/run.ts | 35 +++++----- packages/cli/src/commands/local/server.ts | 16 ++--- packages/cli/src/commands/log/list.ts | 23 +++---- packages/cli/src/commands/log/view.ts | 9 ++- packages/cli/src/commands/mcp.ts | 12 ++-- packages/cli/src/commands/monitor/list.ts | 12 ++-- packages/cli/src/commands/monitor/run.ts | 11 +-- packages/cli/src/commands/org/list.ts | 12 ++-- packages/cli/src/commands/org/view.ts | 4 +- packages/cli/src/commands/platform/list.ts | 6 +- packages/cli/src/commands/proguard/upload.ts | 12 ++-- packages/cli/src/commands/proguard/uuid.ts | 5 +- packages/cli/src/commands/project/create.ts | 12 ++-- packages/cli/src/commands/project/delete.ts | 6 +- packages/cli/src/commands/project/list.ts | 20 +++--- packages/cli/src/commands/project/view.ts | 8 +-- .../cli/src/commands/react-native/gradle.ts | 6 +- .../cli/src/commands/react-native/xcode.ts | 2 +- packages/cli/src/commands/release/archive.ts | 6 +- packages/cli/src/commands/release/create.ts | 26 ++++--- packages/cli/src/commands/release/delete.ts | 6 +- packages/cli/src/commands/release/deploy.ts | 11 ++- packages/cli/src/commands/release/deploys.ts | 6 +- packages/cli/src/commands/release/finalize.ts | 9 ++- packages/cli/src/commands/release/list.ts | 16 ++--- .../src/commands/release/propose-version.ts | 7 +- packages/cli/src/commands/release/restore.ts | 6 +- .../cli/src/commands/release/set-commits.ts | 16 ++--- packages/cli/src/commands/release/view.ts | 8 +-- packages/cli/src/commands/replay/download.ts | 9 +-- packages/cli/src/commands/replay/list.ts | 24 +++---- packages/cli/src/commands/replay/view.ts | 16 ++--- packages/cli/src/commands/repo/list.ts | 12 ++-- packages/cli/src/commands/schema.ts | 25 ++++--- packages/cli/src/commands/snapshots/diff.ts | 7 +- .../cli/src/commands/snapshots/download.ts | 7 +- packages/cli/src/commands/snapshots/upload.ts | 9 +-- packages/cli/src/commands/sourcemap/inject.ts | 8 +-- .../cli/src/commands/sourcemap/resolve.ts | 6 +- packages/cli/src/commands/sourcemap/upload.ts | 16 ++--- packages/cli/src/commands/span/list.ts | 24 +++---- packages/cli/src/commands/span/view.ts | 9 +-- packages/cli/src/commands/status/show.ts | 6 +- packages/cli/src/commands/team/list.ts | 12 ++-- packages/cli/src/commands/token/create.ts | 6 +- packages/cli/src/commands/token/delete.ts | 8 +-- packages/cli/src/commands/token/list.ts | 6 +- packages/cli/src/commands/trace/list.ts | 13 ++-- packages/cli/src/commands/trace/logs.ts | 18 ++--- packages/cli/src/commands/trace/view.ts | 26 +++---- packages/cli/src/commands/trial/list.ts | 6 +- packages/cli/src/commands/trial/start.ts | 8 +-- packages/cli/src/commands/wasm-split.ts | 17 ++--- packages/cli/src/lib/command-example.ts | 40 +++++++++-- packages/cli/src/lib/command.ts | 16 +---- packages/cli/src/lib/introspect.ts | 2 +- .../cli/test/lib/command-examples.test.ts | 67 +++++++++++++++++++ packages/cli/test/lib/introspect.test.ts | 4 +- scripts/cli-lint-rules.test.mjs | 17 ++++- 142 files changed, 874 insertions(+), 918 deletions(-) create mode 100644 packages/cli/test/lib/command-examples.test.ts diff --git a/packages/cli/AGENTS.md b/packages/cli/AGENTS.md index bb93383a9..cdb1952b6 100644 --- a/packages/cli/AGENTS.md +++ b/packages/cli/AGENTS.md @@ -826,11 +826,11 @@ All command docs and skill files are generated via `pnpm run generate:docs`. Thi - **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. -- **Hints name the running program**: the same code runs as `sentry`, `npx sentry`, and `sentry-mcp`, so write a hint's command with the `` sentry`…` `` tag from `src/lib/app-identity.ts`, without the program name (`` sentry`issue list ${org}/` ``), inside the function that builds the hint. The tag inserts interpolated values as they are and nothing rewrites a hint later, so errors such as `ContextError` print usage lines as given. Keep a command in a constant or table as a `LazyCommand`, `` const usageHint = () => sentry`issue view ` ``, and call it where the hint is shown: the entry point registers the program only after the command modules load (`test/lib/app-identity-import.test.ts` checks that no hint is built at import). Command help (`docs`, `fullDescription`, `brief`, `examples`) stays `sentry …`. Lint (`sentry-cli/no-hardcoded-sentry-command`) flags a bare `sentry ` (routes come from `src/command-manifest.ts`), and `pnpm run check:doc-examples` checks each tag's command and flags against the route tree. -- **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. +- **Hints name the running program**: the same code runs as `sentry`, `npx sentry`, and `sentry-mcp`, so write a hint's command with the `` sentry`…` `` tag from `src/lib/app-identity.ts`, without the program name (`` sentry`issue list ${org}/` ``), inside the function that builds the hint. The tag inserts interpolated values as they are and nothing rewrites a hint later, so errors such as `ContextError` print usage lines as given. Keep a command in a constant or table as a `LazyCommand`, `` const usageHint = () => sentry`issue view ` ``, and call it where the hint is shown: the entry point registers the program only after the command modules load (`test/lib/app-identity-import.test.ts` checks that no hint is built at import). Command help prose (`docs`, `fullDescription`, `brief`) stays `sentry …`; `docs.examples` steps leave the program out. Lint (`sentry-cli/no-hardcoded-sentry-command`) flags a bare `sentry ` (routes come from `src/command-manifest.ts`), and `pnpm run check:doc-examples` checks each tag's command and flags against the route tree. +- **Examples belong to the command**: add them to `docs.examples` (`{ description, run }[]`, see `src/commands/agent-conversation/list.ts`). Write each step without the program name, as `run: "issue list my-org/"`; `--help` adds the running program and the generated docs and skill references add `sentry`. A step inside other shell text keeps that text around it, as `{ prefix: "sudo ", args: "cli fix" }`. 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. Multi-step workflows belong in `docs.examples` too: pass `command` an array of steps (see `release create` and `local run`), and every step is checked and shown in `--help`, the docs, and the skill. Reserve `` (on the line directly above the block) for sample output and guides that interleave non-`sentry` commands. +- `pnpm run check:fragments` also rejects any shell code block in a fragment that runs a `sentry` command, whatever its heading. Multi-step workflows belong in `docs.examples` too: pass `run` an array of steps (see `release create` and `local run`), and every step is checked and shown in `--help`, the docs, and the skill. Reserve `` (on the line directly above the block) for sample output and guides that interleave non-`sentry` commands. - `pnpm run check:fragments` validates fragment ↔ route consistency. - Positional `placeholder` values must be descriptive: `"org/project/trace-id"` not `"args"`. - Don't restate a value flag's `default` in its `brief`; help and docs already show it (`test/lib/flag-briefs.test.ts`). diff --git a/packages/cli/lint-rules/cli-oxlint-plugin.js b/packages/cli/lint-rules/cli-oxlint-plugin.js index a79afdfdf..c1990fb12 100644 --- a/packages/cli/lint-rules/cli-oxlint-plugin.js +++ b/packages/cli/lint-rules/cli-oxlint-plugin.js @@ -420,6 +420,24 @@ const HELP_TEXT_KEYS = new Set([ "examples", ]); +/** Key of a property node, as written. */ +function propertyKey(node) { + return node.key?.name ?? node.key?.value; +} + +/** + * Whether `node` is a step of a `docs.examples` entry: the `run` value, an + * element of a `run` array, or the `args` of a `{ prefix, args }` step. + */ +function isExampleStep(node) { + let current = node.parent; + if (current?.type === "Property" && propertyKey(current) === "args") { + current = current.parent?.parent; + } + if (current?.type === "ArrayExpression") current = current.parent; + return current?.type === "Property" && propertyKey(current) === "run"; +} + /** Whether `node` sits inside a function body. */ function hasFunctionAncestor(node) { for (let current = node.parent; current; current = current.parent) { @@ -919,7 +937,16 @@ const rules = { ); }, Literal(node) { - if (typeof node.value === "string") check(node, node.value); + if (typeof node.value !== "string") return; + if (isExampleStep(node)) { + if (node.value.startsWith("sentry ")) + report( + node, + "Write example steps without the program name, as `issue list`: help, docs and skills each add it.", + ); + return; + } + check(node, node.value); }, TemplateLiteral(node) { if (!isSentryTag(node.parent)) check(node, templateText(node)); diff --git a/packages/cli/script/check-doc-examples.ts b/packages/cli/script/check-doc-examples.ts index 8e5c588eb..179dc7bd2 100644 --- a/packages/cli/script/check-doc-examples.ts +++ b/packages/cli/script/check-doc-examples.ts @@ -332,7 +332,7 @@ function commandExamples( } const source = `\`${["sentry", ...path].join(" ")}\` help`; return (target.__examples ?? []).flatMap((e) => - exampleSteps(e).map((invocation) => ({ source, invocation })), + exampleSteps(e, "sentry").map((invocation) => ({ source, invocation })), ); } diff --git a/packages/cli/script/generate-docs-sections.ts b/packages/cli/script/generate-docs-sections.ts index 9d8d74504..70fdc10b5 100644 --- a/packages/cli/script/generate-docs-sections.ts +++ b/packages/cli/script/generate-docs-sections.ts @@ -924,7 +924,7 @@ function commandAt(path: string[]): Command { */ function sdkRunStatement(path: string[], variable: string): string { for (const example of commandAt(path).__examples ?? []) { - const steps = exampleSteps(example); + const steps = exampleSteps(example, "sentry"); const commands = steps.length === 1 ? shellCommands(steps[0] ?? "") : []; const words = commands.length === 1 ? (commands[0] ?? []) : []; if (words[0] === "sentry" && words.some((w) => w.startsWith("-"))) { diff --git a/packages/cli/src/commands/agent-conversation/list.ts b/packages/cli/src/commands/agent-conversation/list.ts index 3b7b15682..09862e48f 100644 --- a/packages/cli/src/commands/agent-conversation/list.ts +++ b/packages/cli/src/commands/agent-conversation/list.ts @@ -138,54 +138,51 @@ export const listCommand = buildListCommand("agent-conversation", { examples: [ { description: "List recent agent conversations", - command: "sentry agent-conversation list", + run: "agent-conversation list", }, { description: "Explicit organization (all projects)", - command: "sentry agent-conversation list my-org/", + run: "agent-conversation list my-org/", }, { description: "One project", - command: "sentry agent-conversation list my-org/my-project", + run: "agent-conversation list my-org/my-project", }, { description: "Find a project across organizations", - command: "sentry agent-conversation list my-project", + run: "agent-conversation list my-project", }, { description: "Show more, last 24 hours", - command: "sentry agent-conversation list --limit 50 --period 24h", + run: "agent-conversation list --limit 50 --period 24h", }, { description: "Sort by highest error count", - command: "sentry agent-conversation list --sort -conversation.errors", + run: "agent-conversation list --sort -conversation.errors", }, { description: "Sort by lowest total cost", - command: "sentry agent-conversation list --sort conversation.totalCost", + run: "agent-conversation list --sort conversation.totalCost", }, { description: "Find conversations with errors", - command: 'sentry agent-conversation list -q "conversation.errors:>0"', + run: 'agent-conversation list -q "conversation.errors:>0"', }, { description: "Find conversations for an agent", - command: - 'sentry agent-conversation list -q "gen_ai.agent.name:my-agent"', + run: 'agent-conversation list -q "gen_ai.agent.name:my-agent"', }, { description: "Find conversations with more than two tool calls", - command: - 'sentry agent-conversation list -q "conversation.toolCalls:>2"', + run: 'agent-conversation list -q "conversation.toolCalls:>2"', }, { description: "Find conversations that used a tool", - command: - 'sentry agent-conversation list -q "gen_ai.tool.name:search_issues"', + run: 'agent-conversation list -q "gen_ai.tool.name:search_issues"', }, { description: "Paginate through project results", - command: "sentry agent-conversation list my-org/my-project -c next", + run: "agent-conversation list my-org/my-project -c next", }, ], }, diff --git a/packages/cli/src/commands/agent-conversation/view.ts b/packages/cli/src/commands/agent-conversation/view.ts index 6709f04bb..02efad033 100644 --- a/packages/cli/src/commands/agent-conversation/view.ts +++ b/packages/cli/src/commands/agent-conversation/view.ts @@ -116,15 +116,15 @@ export const viewCommand = buildCommand({ examples: [ { description: "View full transcript (organization auto-detected)", - command: "sentry agent-conversation view conv-123", + run: "agent-conversation view conv-123", }, { description: "Explicit organization", - command: "sentry agent-conversation view my-org/conv-123", + run: "agent-conversation view my-org/conv-123", }, { description: "JSON output", - command: "sentry agent-conversation view my-org/conv-123 --json", + run: "agent-conversation view my-org/conv-123 --json", }, ], }, diff --git a/packages/cli/src/commands/alert/issues/create.ts b/packages/cli/src/commands/alert/issues/create.ts index 4055c272d..8fdaa5cd9 100644 --- a/packages/cli/src/commands/alert/issues/create.ts +++ b/packages/cli/src/commands/alert/issues/create.ts @@ -126,25 +126,21 @@ export const createCommand = buildCommand({ examples: [ { description: "Alert on new issues and email a team", - command: - 'sentry alert issues create my-org/my-project --name \'New Issues\' --condition \'{"type":"first_seen_event","comparison":true,"conditionResult":true}\' --action \'{"type":"email","data":{},"config":{"targetType":"team","targetIdentifier":"1"}}\'', + run: 'alert issues create my-org/my-project --name \'New Issues\' --condition \'{"type":"first_seen_event","comparison":true,"conditionResult":true}\' --action \'{"type":"email","data":{},"config":{"targetType":"team","targetIdentifier":"1"}}\'', }, { description: "Preview a high-priority alert that emails a user at most every 30 minutes", - command: - 'sentry alert issues create my-org/my-project --name \'High Priority\' --condition \'{"type":"new_high_priority_issue","comparison":true,"conditionResult":true}\' --action \'{"type":"email","data":{},"config":{"targetType":"user","targetIdentifier":"56789"}}\' --frequency 30 --dry-run', + run: 'alert issues create my-org/my-project --name \'High Priority\' --condition \'{"type":"new_high_priority_issue","comparison":true,"conditionResult":true}\' --action \'{"type":"email","data":{},"config":{"targetType":"user","targetIdentifier":"56789"}}\' --frequency 30 --dry-run', }, { description: "Alert on new issues and regressions, using trigger names", - command: - 'sentry alert issues create my-org/my-project --name \'New or Regressed\' --condition first-seen,regression --action \'{"type":"email","data":{},"config":{"targetType":"team","targetIdentifier":"1"}}\'', + run: 'alert issues create my-org/my-project --name \'New or Regressed\' --condition first-seen,regression --action \'{"type":"email","data":{},"config":{"targetType":"team","targetIdentifier":"1"}}\'', }, { description: "Alert when an issue sees more than 50 events in a day (filters only, checked on every event)", - command: - 'sentry alert issues create my-org/my-project --name \'Busy Issues\' --filter \'{"type":"event_frequency_count","comparison":{"value":50,"interval":"1d"},"conditionResult":true}\' --action \'{"type":"email","data":{},"config":{"targetType":"team","targetIdentifier":"1"}}\' --frequency 1440', + run: 'alert issues create my-org/my-project --name \'Busy Issues\' --filter \'{"type":"event_frequency_count","comparison":{"value":50,"interval":"1d"},"conditionResult":true}\' --action \'{"type":"email","data":{},"config":{"targetType":"team","targetIdentifier":"1"}}\' --frequency 1440', }, ], }, diff --git a/packages/cli/src/commands/alert/issues/delete.ts b/packages/cli/src/commands/alert/issues/delete.ts index da61254ce..faad7e355 100644 --- a/packages/cli/src/commands/alert/issues/delete.ts +++ b/packages/cli/src/commands/alert/issues/delete.ts @@ -50,15 +50,15 @@ export const deleteCommand = buildDeleteCommand({ examples: [ { description: "Delete an issue alert rule (prompts for confirmation)", - command: "sentry alert issues delete my-org/my-project/12345", + run: "alert issues delete my-org/my-project/12345", }, { description: "Delete a rule selected by name without prompting", - command: "sentry alert issues delete my-org/my-project/'My Rule' --yes", + run: "alert issues delete my-org/my-project/'My Rule' --yes", }, { description: "Preview the deletion", - command: "sentry alert issues delete my-org/my-project/12345 --dry-run", + run: "alert issues delete my-org/my-project/12345 --dry-run", }, ], }, diff --git a/packages/cli/src/commands/alert/issues/edit.ts b/packages/cli/src/commands/alert/issues/edit.ts index e8e0b0305..37e96573c 100644 --- a/packages/cli/src/commands/alert/issues/edit.ts +++ b/packages/cli/src/commands/alert/issues/edit.ts @@ -202,24 +202,20 @@ export const editCommand = buildCommand({ examples: [ { description: "Rename an issue alert rule", - command: - "sentry alert issues edit my-org/my-project/12345 --name 'Prod errors'", + run: "alert issues edit my-org/my-project/12345 --name 'Prod errors'", }, { description: "Disable a rule selected by name", - command: - "sentry alert issues edit my-org/my-project/'Old name' --status disabled", + run: "alert issues edit my-org/my-project/'Old name' --status disabled", }, { description: "Rename and enable a rule (organization and project auto-detected)", - command: - "sentry alert issues edit 12345 --name 'Renamed' --status active", + run: "alert issues edit 12345 --name 'Renamed' --status active", }, { description: "Replace the rule's conditions", - command: - 'sentry alert issues edit my-org/my-project/12345 --condition \'{"type":"first_seen_event","comparison":true,"conditionResult":true}\'', + run: 'alert issues edit my-org/my-project/12345 --condition \'{"type":"first_seen_event","comparison":true,"conditionResult":true}\'', }, ], }, diff --git a/packages/cli/src/commands/alert/issues/list.ts b/packages/cli/src/commands/alert/issues/list.ts index 24490b8c4..f8bcb90a4 100644 --- a/packages/cli/src/commands/alert/issues/list.ts +++ b/packages/cli/src/commands/alert/issues/list.ts @@ -506,24 +506,24 @@ export const listCommand = buildListCommand("alert issues", { examples: [ { description: "List issue alert rules (project auto-detected)", - command: "sentry alert issues list", + run: "alert issues list", }, { description: "List issue alert rules for a project", - command: "sentry alert issues list my-org/my-project", + run: "alert issues list my-org/my-project", }, { description: "Filter rules by name", - command: 'sentry alert issues list my-org/my-project --query "spike"', + run: '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/", + run: "alert issues list my-org/", }, { description: "Find a project across organizations", - command: "sentry alert issues list frontend", + run: "alert issues list frontend", }, ], }, diff --git a/packages/cli/src/commands/alert/issues/view.ts b/packages/cli/src/commands/alert/issues/view.ts index 26a2ad5f0..ef609c471 100644 --- a/packages/cli/src/commands/alert/issues/view.ts +++ b/packages/cli/src/commands/alert/issues/view.ts @@ -50,15 +50,15 @@ export const viewCommand = buildCommand({ { description: "View an issue alert rule by ID (organization and project auto-detected)", - command: "sentry alert issues view 12345", + run: "alert issues view 12345", }, { description: "View by ID in an explicit project", - command: "sentry alert issues view my-org/my-project/12345", + run: "alert issues view my-org/my-project/12345", }, { description: "View by name", - command: "sentry alert issues view my-org/my-project/'Error Spike'", + run: "alert issues view my-org/my-project/'Error Spike'", }, ], }, diff --git a/packages/cli/src/commands/alert/metrics/create.ts b/packages/cli/src/commands/alert/metrics/create.ts index bd6cd4632..6d1f79682 100644 --- a/packages/cli/src/commands/alert/metrics/create.ts +++ b/packages/cli/src/commands/alert/metrics/create.ts @@ -102,14 +102,12 @@ export const createCommand = buildCommand({ examples: [ { description: "Alert when P95 span duration goes above 500ms", - command: - "sentry alert metrics create my-org/ --name 'P95 latency' --project my-project --query 'environment:prod' --aggregate 'p95(span.duration)' --dataset spans --time-window 5 --trigger '{\"alertThreshold\":500}'", + run: "alert metrics create my-org/ --name 'P95 latency' --project my-project --query 'environment:prod' --aggregate 'p95(span.duration)' --dataset spans --time-window 5 --trigger '{\"alertThreshold\":500}'", }, { description: "Preview an alert on any matching log line that notifies through an existing alert", - command: - "sentry alert metrics create my-org/ --name 'AI chat failures' --project my-project --query 'action:ai.chat result:error' --aggregate 'count()' --dataset logs --time-window 5 --trigger '{\"alertThreshold\":0,\"resolveThreshold\":0}' --workflow 12345 --dry-run", + run: "alert metrics create my-org/ --name 'AI chat failures' --project my-project --query 'action:ai.chat result:error' --aggregate 'count()' --dataset logs --time-window 5 --trigger '{\"alertThreshold\":0,\"resolveThreshold\":0}' --workflow 12345 --dry-run", }, ], }, diff --git a/packages/cli/src/commands/alert/metrics/delete.ts b/packages/cli/src/commands/alert/metrics/delete.ts index 7ed86a0f7..0a2d3907f 100644 --- a/packages/cli/src/commands/alert/metrics/delete.ts +++ b/packages/cli/src/commands/alert/metrics/delete.ts @@ -47,11 +47,11 @@ export const deleteCommand = buildDeleteCommand({ examples: [ { description: "Delete a metric alert rule (prompts for confirmation)", - command: "sentry alert metrics delete my-org/12345", + run: "alert metrics delete my-org/12345", }, { description: "Delete a rule selected by name without prompting", - command: "sentry alert metrics delete my-org/'P95 alert' --yes", + run: "alert metrics delete my-org/'P95 alert' --yes", }, ], }, diff --git a/packages/cli/src/commands/alert/metrics/edit.ts b/packages/cli/src/commands/alert/metrics/edit.ts index 7b24c8a21..f06d92a69 100644 --- a/packages/cli/src/commands/alert/metrics/edit.ts +++ b/packages/cli/src/commands/alert/metrics/edit.ts @@ -192,21 +192,19 @@ export const editCommand = buildCommand({ examples: [ { description: "Rename a metric alert rule", - command: "sentry alert metrics edit my-org/12345 --name 'Error budget'", + run: "alert metrics edit my-org/12345 --name 'Error budget'", }, { description: "Disable a rule", - command: "sentry alert metrics edit my-org/12345 --status disabled", + run: "alert metrics edit my-org/12345 --status disabled", }, { description: "Change the query and time window", - command: - 'sentry alert metrics edit my-org/12345 --query "environment:prod event.type:error" --time-window 15', + run: 'alert metrics edit my-org/12345 --query "environment:prod event.type:error" --time-window 15', }, { description: "Switch the dataset", - command: - "sentry alert metrics edit my-org/12345 --time-window 15 --dataset spans", + run: "alert metrics edit my-org/12345 --time-window 15 --dataset spans", }, ], }, diff --git a/packages/cli/src/commands/alert/metrics/list.ts b/packages/cli/src/commands/alert/metrics/list.ts index af1c9d697..97fd60a6f 100644 --- a/packages/cli/src/commands/alert/metrics/list.ts +++ b/packages/cli/src/commands/alert/metrics/list.ts @@ -512,15 +512,15 @@ export const listCommand = buildListCommand("alert metrics", { examples: [ { description: "List metric alert rules (organization auto-detected)", - command: "sentry alert metrics list", + run: "alert metrics list", }, { description: "List metric alert rules for an organization", - command: "sentry alert metrics list my-org/", + run: "alert metrics list my-org/", }, { description: "Fetch the next page", - command: "sentry alert metrics list my-org/ -c next", + run: "alert metrics list my-org/ -c next", }, ], }, diff --git a/packages/cli/src/commands/alert/metrics/view.ts b/packages/cli/src/commands/alert/metrics/view.ts index ebb04601f..fe7bec424 100644 --- a/packages/cli/src/commands/alert/metrics/view.ts +++ b/packages/cli/src/commands/alert/metrics/view.ts @@ -40,19 +40,19 @@ export const viewCommand = buildCommand({ { description: "View a metric alert rule by ID (organization auto-detected)", - command: "sentry alert metrics view 12345", + run: "alert metrics view 12345", }, { description: "View by ID in an explicit organization", - command: "sentry alert metrics view my-org/12345", + run: "alert metrics view my-org/12345", }, { description: "View by name", - command: "sentry alert metrics view my-org/'P95 latency alert'", + run: "alert metrics view my-org/'P95 latency alert'", }, { description: "Inspect native thresholds and notification workflows", - command: "sentry alert metrics view my-org/12345 --json", + run: "alert metrics view my-org/12345 --json", }, ], }, diff --git a/packages/cli/src/commands/api.ts b/packages/cli/src/commands/api.ts index f8ab967fb..1cf8d1ce7 100644 --- a/packages/cli/src/commands/api.ts +++ b/packages/cli/src/commands/api.ts @@ -1591,74 +1591,68 @@ export const apiCommand = buildCommand({ examples: [ { description: "List organizations", - command: "sentry api organizations/", + run: "api organizations/", }, { description: "Read a page and its pagination metadata", - command: "sentry api organizations/ -f per_page=2 --json", + run: "api organizations/ -f per_page=2 --json", }, { description: "Continue the same query using shared pagination", - command: "sentry api organizations/ -f per_page=2 --cursor next --json", + run: "api organizations/ -f per_page=2 --cursor next --json", }, { description: "Return to the previously visited page", - command: "sentry api organizations/ -f per_page=2 --cursor prev --json", + run: "api organizations/ -f per_page=2 --cursor prev --json", }, { description: "Get a specific issue", - command: "sentry api issues/123456789/", + run: "api issues/123456789/", }, { description: "Create a release", - command: - "sentry api organizations/my-org/releases/ -X POST -F version=1.0.0", + run: "api organizations/my-org/releases/ -X POST -F version=1.0.0", }, { description: "Update an issue status", - command: "sentry api issues/123456789/ -X PUT -F status=resolved", + run: "api issues/123456789/ -X PUT -F status=resolved", }, { description: "Send an inline JSON body", - command: - 'sentry api issues/123456789/ -X PUT -d \'{"status":"resolved"}\'', + run: 'api issues/123456789/ -X PUT -d \'{"status":"resolved"}\'', }, { description: "Set a nested field", - command: - "sentry api projects/my-org/my-project/ -X PUT -F options[sampleRate]=0.5", + run: "api projects/my-org/my-project/ -X PUT -F options[sampleRate]=0.5", }, { description: "Assign an issue", - command: - 'sentry api issues/123456789/ -X PUT --field assignedTo="user@example.com"', + run: 'api issues/123456789/ -X PUT --field assignedTo="user@example.com"', }, { description: "Delete a project", - command: "sentry api projects/my-org/my-project/ -X DELETE", + run: "api projects/my-org/my-project/ -X DELETE", }, { description: "Add custom headers", - command: 'sentry api organizations/ -H "X-Custom: value"', + run: 'api organizations/ -H "X-Custom: value"', }, { description: "Read the request body from a file", - command: - "sentry api projects/my-org/my-project/releases/ -X POST --input release.json", + run: "api projects/my-org/my-project/releases/ -X POST --input release.json", }, { description: "Show the full HTTP request and response", - command: "sentry api organizations/ --verbose", + run: "api organizations/ --verbose", }, { description: "Preview the request without sending it", - command: "sentry api organizations/ --dry-run", + run: "api organizations/ --dry-run", }, { description: "Save a binary response, such as an event attachment, to a file", - command: - 'sentry api "https://sentry.io/api/0/projects/my-org/my-project/events/EVENT_ID/attachments/ATTACHMENT_ID/?download=1" > screenshot.png', + run: 'api "https://sentry.io/api/0/projects/my-org/my-project/events/EVENT_ID/attachments/ATTACHMENT_ID/?download=1" > screenshot.png', }, ], }, diff --git a/packages/cli/src/commands/attribute/list.ts b/packages/cli/src/commands/attribute/list.ts index 0454f7609..cdfdea2b1 100644 --- a/packages/cli/src/commands/attribute/list.ts +++ b/packages/cli/src/commands/attribute/list.ts @@ -206,68 +206,62 @@ export const listCommand = buildListCommand("attribute", { examples: [ { description: "List span attribute keys for a project", - command: "sentry attribute list my-org/my-project", + run: "attribute list my-org/my-project", }, { description: "List log attribute keys across the whole organization", - command: "sentry attribute list my-org/ --dataset logs", + run: "attribute list my-org/ --dataset logs", }, { description: "String attributes whose names contain gen_ai (case-sensitive)", - command: "sentry attribute list my-org/ gen_ai --type string", + run: "attribute list my-org/ gen_ai --type string", }, { description: "Discover candidates alongside an attribute", - command: "sentry attribute list my-org/ has:gen_ai.request.model", + run: "attribute list my-org/ has:gen_ai.request.model", }, { description: "Discover candidates alongside several keys (one quoted argument)", - command: - "sentry attribute list my-org/ 'has:gen_ai.request.model has:gen_ai.usage.input_tokens'", + run: "attribute list my-org/ 'has:gen_ai.request.model has:gen_ai.usage.input_tokens'", }, { description: "Text and has: filters together", - command: "sentry attribute list my-org/ 'gen_ai has:http.method'", + run: "attribute list my-org/ 'gen_ai has:http.method'", }, { description: "Discover candidates using the last 24 hours (includes built-in and virtual keys)", - command: "sentry attribute list my-org/ --period 24h", + run: "attribute list my-org/ --period 24h", }, { description: "Show more than the default 25", - command: "sentry attribute list my-org/my-project -n 100", + run: "attribute list my-org/my-project -n 100", }, { description: "Show the next page of the previous listing (same flags)", - command: "sentry attribute list my-org/my-project -n 100 -c next", + run: "attribute list my-org/my-project -n 100 -c next", }, { description: "Filter spans that have a discovered key", - command: - "sentry span list my-org/my-project -q 'has:gen_ai.request.model'", + run: "span list my-org/my-project -q 'has:gen_ai.request.model'", }, { description: "Find a custom numeric attribute by name", - command: - "sentry attribute list my-org/my-project cart.total --type number", + run: "attribute list my-org/my-project cart.total --type number", }, { description: "Show a discovered typed key as a span column", - command: - "sentry span list my-org/my-project --fields 'tags[cart.total,number]'", + run: "span list my-org/my-project --fields 'tags[cart.total,number]'", }, { description: "Group a metric by a discovered attribute", - command: - "sentry explore my-org/ --dataset metrics -m llm.token_usage -F gen_ai.request.model", + run: "explore my-org/ --dataset metrics -m llm.token_usage -F gen_ai.request.model", }, { description: "Select fields as JSON", - command: - "sentry attribute list my-org/ --json --fields key,type,source", + run: "attribute list my-org/ --json --fields key,type,source", }, ], }, diff --git a/packages/cli/src/commands/auth/list.ts b/packages/cli/src/commands/auth/list.ts index 742a5e3a2..965ee5017 100644 --- a/packages/cli/src/commands/auth/list.ts +++ b/packages/cli/src/commands/auth/list.ts @@ -38,7 +38,7 @@ export const listCommand = buildCommand({ examples: [ { description: "Show stored accounts (* marks the active one)", - command: "sentry auth list", + run: "auth list", }, ], }, diff --git a/packages/cli/src/commands/auth/login.ts b/packages/cli/src/commands/auth/login.ts index 6b548faea..fe1caf565 100644 --- a/packages/cli/src/commands/auth/login.ts +++ b/packages/cli/src/commands/auth/login.ts @@ -503,42 +503,40 @@ export const loginCommand = buildCommand({ examples: [ { description: "Log in with OAuth (device flow)", - command: "sentry auth login", + run: "auth login", }, { description: "Log in with an API token", - command: "sentry auth login --token YOUR_SENTRY_API_TOKEN", + run: "auth login --token YOUR_SENTRY_API_TOKEN", }, { description: "Request only read-only scopes", - command: "sentry auth login --read-only", + run: "auth login --read-only", }, { description: "Request specific scopes (repeatable or comma-separated)", - command: "sentry auth login --scope project:read --scope org:read", + run: "auth login --scope project:read --scope org:read", }, { description: "Log in to a self-hosted instance", - command: "sentry auth login --url https://sentry.example.com", + run: "auth login --url https://sentry.example.com", }, { description: "Log in to a self-hosted instance with a token", - command: - "sentry auth login --token YOUR_TOKEN --url https://sentry.example.com", + run: "auth login --token YOUR_TOKEN --url https://sentry.example.com", }, { description: "Add (or log in again to) a specific account without prompting", - command: "sentry auth login jane@example.com", + run: "auth login jane@example.com", }, { description: "Add an account on a specific server", - command: - "sentry auth login jane@example.com --url https://sentry.example.com", + run: "auth login jane@example.com --url https://sentry.example.com", }, { description: "Same as --url, using the account notation", - command: "sentry auth login jane@example.com:sentry.example.com", + run: "auth login jane@example.com:sentry.example.com", }, ], }, diff --git a/packages/cli/src/commands/auth/logout.ts b/packages/cli/src/commands/auth/logout.ts index a710e3d4e..e59638e2b 100644 --- a/packages/cli/src/commands/auth/logout.ts +++ b/packages/cli/src/commands/auth/logout.ts @@ -100,25 +100,24 @@ export const logoutCommand = buildCommand({ { description: "Log out of the active account (the most recently used other account becomes active)", - command: "sentry auth logout", + run: "auth logout", }, { description: "Log out of a specific account", - command: "sentry auth logout jane@example.com", + run: "auth logout jane@example.com", }, { description: "Log out of several accounts (space- or comma-separated)", - command: "sentry auth logout jane@example.com,jane@personal.dev", + run: "auth logout jane@example.com,jane@personal.dev", }, { description: "Pick the account on one server when the same email is stored twice", - command: - "sentry auth logout jane@example.com --url https://sentry.example.com", + run: "auth logout jane@example.com --url https://sentry.example.com", }, { description: "Log out of every stored account", - command: "sentry auth logout all", + run: "auth logout all", }, ], }, diff --git a/packages/cli/src/commands/auth/refresh.ts b/packages/cli/src/commands/auth/refresh.ts index 5ab79e94b..bb9b68f6b 100644 --- a/packages/cli/src/commands/auth/refresh.ts +++ b/packages/cli/src/commands/auth/refresh.ts @@ -107,23 +107,23 @@ session (similar to \`gh auth refresh -s \`). { description: "Refresh the OAuth access token when it is close to expiring", - command: "sentry auth refresh", + run: "auth refresh", }, { description: "Refresh even if the token is still valid", - command: "sentry auth refresh --force", + run: "auth refresh --force", }, { description: "Re-authenticate with specific scopes", - command: "sentry auth refresh --scope project:read --scope org:read", + run: "auth refresh --scope project:read --scope org:read", }, { description: "Re-authenticate with read-only scopes", - command: "sentry auth refresh --read-only", + run: "auth refresh --read-only", }, { description: "Output the refresh result as JSON", - command: "sentry auth refresh --json", + run: "auth refresh --json", }, ], }, diff --git a/packages/cli/src/commands/auth/status.ts b/packages/cli/src/commands/auth/status.ts index 783614abd..77b15a465 100644 --- a/packages/cli/src/commands/auth/status.ts +++ b/packages/cli/src/commands/auth/status.ts @@ -204,11 +204,11 @@ export const statusCommand = buildCommand({ examples: [ { description: "Check authentication status", - command: "sentry auth status", + run: "auth status", }, { description: "Include the raw token", - command: "sentry auth status --show-token", + run: "auth status --show-token", }, ], }, diff --git a/packages/cli/src/commands/auth/switch.ts b/packages/cli/src/commands/auth/switch.ts index 3f52b2943..bc469843c 100644 --- a/packages/cli/src/commands/auth/switch.ts +++ b/packages/cli/src/commands/auth/switch.ts @@ -90,17 +90,16 @@ export const switchCommand = buildCommand({ examples: [ { description: "Pick the active account from a searchable list", - command: "sentry auth switch", + run: "auth switch", }, { description: "Switch to a specific account", - command: "sentry auth switch jane@example.com", + run: "auth switch jane@example.com", }, { description: "Pick the account on one server when the same email is stored twice", - command: - "sentry auth switch jane@example.com --url https://sentry.example.com", + run: "auth switch jane@example.com --url https://sentry.example.com", }, ], }, diff --git a/packages/cli/src/commands/auth/token.ts b/packages/cli/src/commands/auth/token.ts index 5217e75e7..59ff5505a 100644 --- a/packages/cli/src/commands/auth/token.ts +++ b/packages/cli/src/commands/auth/token.ts @@ -21,7 +21,7 @@ export const tokenCommand = buildCommand({ examples: [ { description: "Print the stored auth token", - command: "sentry auth token", + run: "auth token", }, ], }, diff --git a/packages/cli/src/commands/auth/whoami.ts b/packages/cli/src/commands/auth/whoami.ts index baf37dddf..efc714289 100644 --- a/packages/cli/src/commands/auth/whoami.ts +++ b/packages/cli/src/commands/auth/whoami.ts @@ -59,9 +59,7 @@ export const whoamiCommand = buildCommand({ "For user-scoped tokens (OAuth, personal access tokens), this fetches " + "the user from the Sentry API. For organization auth tokens (`sntrys_`), " + "it shows which organization the token belongs to.", - examples: [ - { description: "Show the current user", command: "sentry auth whoami" }, - ], + examples: [{ description: "Show the current user", run: "auth whoami" }], }, output: { human: formatWhoami, diff --git a/packages/cli/src/commands/build/download.ts b/packages/cli/src/commands/build/download.ts index 43268c88f..d0da5193c 100644 --- a/packages/cli/src/commands/build/download.ts +++ b/packages/cli/src/commands/build/download.ts @@ -61,15 +61,15 @@ export const downloadCommand = buildCommand({ examples: [ { description: "Download a build artifact by ID", - command: "sentry build download 1234567890", + run: "build download 1234567890", }, { description: "Download to a specific path", - command: "sentry build download 1234567890 --output ./app.ipa", + run: "build download 1234567890 --output ./app.ipa", }, { description: "Output the result as JSON", - command: "sentry build download 1234567890 --json", + run: "build download 1234567890 --json", }, ], }, diff --git a/packages/cli/src/commands/build/upload.ts b/packages/cli/src/commands/build/upload.ts index 99289acd7..82b002c44 100644 --- a/packages/cli/src/commands/build/upload.ts +++ b/packages/cli/src/commands/build/upload.ts @@ -194,36 +194,31 @@ export const uploadCommand = buildCommand({ examples: [ { description: "Upload an Android build", - command: "sentry build upload ./app-release.apk", + run: "build upload ./app-release.apk", }, { description: "Upload an XCArchive directory", - command: "sentry build upload ./MyApp.xcarchive", + run: "build upload ./MyApp.xcarchive", }, { description: "Upload an IPA with a build configuration", - command: - "sentry build upload ./MyApp.ipa --build-configuration Release", + run: "build upload ./MyApp.ipa --build-configuration Release", }, { description: "Attach debug symbols to an IPA", - command: - "sentry build upload ./MyApp.ipa --dsym ./MyApp.app.dSYM --dsym ./frameworks-dsyms.zip", + run: "build upload ./MyApp.ipa --dsym ./MyApp.app.dSYM --dsym ./frameworks-dsyms.zip", }, { description: "Upload with release notes", - command: - 'sentry build upload ./app.aab --build-configuration Release --release-notes "Nightly"', + run: 'build upload ./app.aab --build-configuration Release --release-notes "Nightly"', }, { description: "Tag a build with install groups", - command: - "sentry build upload ./app.aab --install-group qa --install-group beta", + run: "build upload ./app.aab --install-group qa --install-group beta", }, { description: "Attach explicit git metadata", - command: - 'sentry build upload ./app.aab --head-sha "$GIT_SHA" --pr-number 42 --base-ref main', + run: 'build upload ./app.aab --head-sha "$GIT_SHA" --pr-number 42 --base-ref main', }, ], }, diff --git a/packages/cli/src/commands/cli/completion.ts b/packages/cli/src/commands/cli/completion.ts index b12fe8c60..00b1e13dc 100644 --- a/packages/cli/src/commands/cli/completion.ts +++ b/packages/cli/src/commands/cli/completion.ts @@ -32,21 +32,19 @@ export const completionCommand = buildCommand({ { description: "Print completions for your current shell (auto-detected from $SHELL)", - command: "sentry cli completion", + run: "cli completion", }, { description: "Install zsh completions", - command: - "sentry cli completion zsh > ~/.local/share/zsh/site-functions/_sentry", + run: "cli completion zsh > ~/.local/share/zsh/site-functions/_sentry", }, { description: "Load bash completions into the current shell", - command: 'eval "$(sentry cli completion bash)"', + run: { prefix: 'eval "$(', args: "cli completion bash", suffix: ')"' }, }, { description: "Install fish completions", - command: - "sentry cli completion fish > ~/.config/fish/completions/sentry.fish", + run: "cli completion fish > ~/.config/fish/completions/sentry.fish", }, ], }, diff --git a/packages/cli/src/commands/cli/defaults.ts b/packages/cli/src/commands/cli/defaults.ts index 6bc22d7dd..7a0230c7e 100644 --- a/packages/cli/src/commands/cli/defaults.ts +++ b/packages/cli/src/commands/cli/defaults.ts @@ -266,57 +266,57 @@ export const defaultsCommand = buildCommand({ examples: [ { description: "Show all current defaults", - command: "sentry cli defaults", + run: "cli defaults", }, { description: "Same as above (aliases: ls, show)", - command: "sentry cli defaults list", + run: "cli defaults list", }, { description: "Set the default organization", - command: "sentry cli defaults org my-org", + run: "cli defaults org my-org", }, { description: "Set the default project", - command: "sentry cli defaults project my-project", + run: "cli defaults project my-project", }, { description: "Set the default Sentry URL (self-hosted)", - command: "sentry cli defaults url https://sentry.example.com", + run: "cli defaults url https://sentry.example.com", }, { description: "Set custom HTTP headers (self-hosted, e.g. for IAP/proxies)", - command: 'sentry cli defaults headers "X-IAP: token"', + run: 'cli defaults headers "X-IAP: token"', }, { description: "Set a custom CA certificate (self-hosted, behind a TLS proxy)", - command: "sentry cli defaults ca-cert /path/to/ca.pem", + run: "cli defaults ca-cert /path/to/ca.pem", }, { description: "Disable telemetry", - command: "sentry cli defaults telemetry off", + run: "cli defaults telemetry off", }, { description: "Stop installing agent skills on upgrade", - command: "sentry cli defaults agent-skills off", + run: "cli defaults agent-skills off", }, { description: "Disable inline terminal images", - command: "sentry cli defaults graphics off", + run: "cli defaults graphics off", }, { description: "Hide Tip: hints in command output", - command: "sentry cli defaults tips off", + run: "cli defaults tips off", }, { description: "Clear a single default", - command: "sentry cli defaults org --clear", + run: "cli defaults org --clear", }, { description: "Clear all defaults without prompting", - command: "sentry cli defaults --clear --yes", + run: "cli defaults --clear --yes", }, ], }, diff --git a/packages/cli/src/commands/cli/feedback.ts b/packages/cli/src/commands/cli/feedback.ts index 22af1d6f6..87af84501 100644 --- a/packages/cli/src/commands/cli/feedback.ts +++ b/packages/cli/src/commands/cli/feedback.ts @@ -37,11 +37,11 @@ export const feedbackCommand = buildCommand({ examples: [ { description: "Send positive feedback", - command: "sentry cli feedback i love this tool", + run: "cli feedback i love this tool", }, { description: "Report an issue", - command: "sentry cli feedback the issue view is confusing", + run: "cli feedback the issue view is confusing", }, ], }, diff --git a/packages/cli/src/commands/cli/fix.ts b/packages/cli/src/commands/cli/fix.ts index 1b9873be2..020b6b1ab 100644 --- a/packages/cli/src/commands/cli/fix.ts +++ b/packages/cli/src/commands/cli/fix.ts @@ -675,11 +675,14 @@ export const fixCommand = buildCommand({ "to transfer ownership back to the current user:\n\n" + " sudo sentry cli fix", examples: [ - { description: "Fix database issues", command: "sentry cli fix" }, - { description: "Fix root-owned files", command: "sudo sentry cli fix" }, + { description: "Fix database issues", run: "cli fix" }, + { + description: "Fix root-owned files", + run: { prefix: "sudo ", args: "cli fix" }, + }, { description: "Show what would be fixed without making changes", - command: "sentry cli fix --dry-run", + run: "cli fix --dry-run", }, ], }, diff --git a/packages/cli/src/commands/cli/import.ts b/packages/cli/src/commands/cli/import.ts index dabe83555..f6e0b6675 100644 --- a/packages/cli/src/commands/cli/import.ts +++ b/packages/cli/src/commands/cli/import.ts @@ -278,23 +278,23 @@ export const importCommand = buildCommand({ examples: [ { description: "Scan for .sentryclirc files and import interactively", - command: "sentry cli import", + run: "cli import", }, { description: "Preview what would be imported", - command: "sentry cli import --dry-run", + run: "cli import --dry-run", }, { description: "Skip the confirmation prompt (CI-safe)", - command: "sentry cli import --yes", + run: "cli import --yes", }, { description: "Explicitly trust a self-hosted URL", - command: "sentry cli import --url https://sentry.example.com", + run: "cli import --url https://sentry.example.com", }, { description: "Skip API validation of the imported token", - command: "sentry cli import --skip-validation", + run: "cli import --skip-validation", }, ], }, diff --git a/packages/cli/src/commands/cli/setup.ts b/packages/cli/src/commands/cli/setup.ts index ec4029df9..86f06b845 100644 --- a/packages/cli/src/commands/cli/setup.ts +++ b/packages/cli/src/commands/cli/setup.ts @@ -641,27 +641,27 @@ export const setupCommand = buildCommand({ examples: [ { description: "Run full setup (PATH, completions, agent skills)", - command: "sentry cli setup", + run: "cli setup", }, { description: "Record the install method", - command: "sentry cli setup --method curl", + run: "cli setup --method curl", }, { description: "Place the binary and configure the shell", - command: "sentry cli setup --install", + run: "cli setup --install", }, { description: "Skip PATH modification", - command: "sentry cli setup --no-modify-path", + run: "cli setup --no-modify-path", }, { description: "Skip shell completions", - command: "sentry cli setup --no-completions", + run: "cli setup --no-completions", }, { description: "Skip agent skill installation", - command: "sentry cli setup --no-agent-skills", + run: "cli setup --no-agent-skills", }, ], }, diff --git a/packages/cli/src/commands/cli/uninstall.ts b/packages/cli/src/commands/cli/uninstall.ts index 6fd354665..01a399795 100644 --- a/packages/cli/src/commands/cli/uninstall.ts +++ b/packages/cli/src/commands/cli/uninstall.ts @@ -437,15 +437,15 @@ export const uninstallCommand = buildDeleteCommand({ examples: [ { description: "Show what would be removed", - command: "sentry cli uninstall --dry-run", + run: "cli uninstall --dry-run", }, { description: "Uninstall, keeping the config directory", - command: "sentry cli uninstall --yes --keep-config", + run: "cli uninstall --yes --keep-config", }, { description: "Full uninstall with confirmation", - command: "sentry cli uninstall", + run: "cli uninstall", }, ], }, diff --git a/packages/cli/src/commands/cli/upgrade.ts b/packages/cli/src/commands/cli/upgrade.ts index f2a4cf3a5..64255c179 100644 --- a/packages/cli/src/commands/cli/upgrade.ts +++ b/packages/cli/src/commands/cli/upgrade.ts @@ -1154,43 +1154,43 @@ export const upgradeCommand = buildCommand({ examples: [ { description: "Update to the latest version on the persisted channel", - command: "sentry cli upgrade", + run: "cli upgrade", }, { description: "Check for updates without installing", - command: "sentry cli upgrade --check", + run: "cli upgrade --check", }, { description: "Switch to the nightly channel and update", - command: "sentry cli upgrade nightly", + run: "cli upgrade nightly", }, { description: "Switch back to the stable channel and update", - command: "sentry cli upgrade stable", + run: "cli upgrade stable", }, { description: "Install a specific stable version", - command: "sentry cli upgrade 0.5.0", + run: "cli upgrade 0.5.0", }, { description: "Return to the version before the last upgrade", - command: "sentry cli upgrade undo", + run: "cli upgrade undo", }, { description: "Force re-download even if up to date", - command: "sentry cli upgrade --force", + run: "cli upgrade --force", }, { description: "Force using npm to upgrade", - command: "sentry cli upgrade --method npm", + run: "cli upgrade --method npm", }, { description: "Upgrade from cached patches (no network)", - command: "sentry cli upgrade --offline", + run: "cli upgrade --offline", }, { description: "Skip reinstalling agent skills", - command: "sentry cli upgrade --no-agent-skills", + run: "cli upgrade --no-agent-skills", }, ], }, diff --git a/packages/cli/src/commands/code-mappings/upload.ts b/packages/cli/src/commands/code-mappings/upload.ts index e7461e997..e7d7d68b0 100644 --- a/packages/cli/src/commands/code-mappings/upload.ts +++ b/packages/cli/src/commands/code-mappings/upload.ts @@ -184,20 +184,19 @@ export const uploadCommand = buildCommand({ examples: [ { description: "Upload code mappings from a JSON file", - command: "sentry code-mappings upload mappings.json", + run: "code-mappings upload mappings.json", }, { description: "Specify the repository explicitly", - command: "sentry code-mappings upload mappings.json --repo owner/repo", + run: "code-mappings upload mappings.json --repo owner/repo", }, { description: "Specify the repository and default branch", - command: - "sentry code-mappings upload mappings.json --repo owner/repo --default-branch develop", + run: "code-mappings upload mappings.json --repo owner/repo --default-branch develop", }, { description: "Output as JSON", - command: "sentry code-mappings upload mappings.json --json", + run: "code-mappings upload mappings.json --json", }, ], }, diff --git a/packages/cli/src/commands/dart-symbol-map/upload.ts b/packages/cli/src/commands/dart-symbol-map/upload.ts index 6e19e9933..8a8a90a51 100644 --- a/packages/cli/src/commands/dart-symbol-map/upload.ts +++ b/packages/cli/src/commands/dart-symbol-map/upload.ts @@ -173,18 +173,15 @@ export const uploadCommand = buildCommand({ examples: [ { description: "Upload a Dart symbol map with a debug ID", - command: - "sentry dart-symbol-map upload --debug-id 12345678-1234-1234-1234-123456789abc mapping.json", + run: "dart-symbol-map upload --debug-id 12345678-1234-1234-1234-123456789abc mapping.json", }, { description: "Validate without uploading", - command: - "sentry dart-symbol-map upload --debug-id 12345678-1234-1234-1234-123456789abc mapping.json --no-upload", + run: "dart-symbol-map upload --debug-id 12345678-1234-1234-1234-123456789abc mapping.json --no-upload", }, { description: "Output as JSON", - command: - "sentry dart-symbol-map upload --debug-id 12345678-1234-1234-1234-123456789abc mapping.json --json", + run: "dart-symbol-map upload --debug-id 12345678-1234-1234-1234-123456789abc mapping.json --json", }, ], }, diff --git a/packages/cli/src/commands/dashboard/create.ts b/packages/cli/src/commands/dashboard/create.ts index d80d27516..718e513e0 100644 --- a/packages/cli/src/commands/dashboard/create.ts +++ b/packages/cli/src/commands/dashboard/create.ts @@ -169,15 +169,15 @@ export const createCommand = buildCommand({ examples: [ { description: "Create a dashboard (organization auto-detected)", - command: "sentry dashboard create 'Frontend Performance'", + run: "dashboard create 'Frontend Performance'", }, { description: "Create a dashboard in an explicit organization", - command: "sentry dashboard create my-org/ 'My Dashboard'", + run: "dashboard create my-org/ 'My Dashboard'", }, { description: "Use the organization of an explicit project", - command: "sentry dashboard create my-org/my-project 'My Dashboard'", + run: "dashboard create my-org/my-project 'My Dashboard'", }, ], }, diff --git a/packages/cli/src/commands/dashboard/list.ts b/packages/cli/src/commands/dashboard/list.ts index 72dcb7d73..ff85571cc 100644 --- a/packages/cli/src/commands/dashboard/list.ts +++ b/packages/cli/src/commands/dashboard/list.ts @@ -379,39 +379,39 @@ export const listCommand = buildListCommand("dashboard", { examples: [ { description: "List dashboards (organization auto-detected)", - command: "sentry dashboard list", + run: "dashboard list", }, { description: "List dashboards in an explicit organization", - command: "sentry dashboard list my-org/", + run: "dashboard list my-org/", }, { description: "Use the organization of an explicit project", - command: "sentry dashboard list my-org/my-project", + run: "dashboard list my-org/my-project", }, { description: "Filter by title glob", - command: "sentry dashboard list 'Backend*'", + run: "dashboard list 'Backend*'", }, { description: "Filter within an organization", - command: "sentry dashboard list my-org/ '*API*'", + run: "dashboard list my-org/ '*API*'", }, { description: "Fetch the next page", - command: "sentry dashboard list -c next", + run: "dashboard list -c next", }, { description: "Fetch the previous page", - command: "sentry dashboard list -c prev", + run: "dashboard list -c prev", }, { description: "Output JSON with the pagination envelope", - command: "sentry dashboard list --json", + run: "dashboard list --json", }, { description: "Open the dashboard list in the browser", - command: "sentry dashboard list -w", + run: "dashboard list -w", }, ], }, diff --git a/packages/cli/src/commands/dashboard/restore.ts b/packages/cli/src/commands/dashboard/restore.ts index 4e13412b8..22e23671a 100644 --- a/packages/cli/src/commands/dashboard/restore.ts +++ b/packages/cli/src/commands/dashboard/restore.ts @@ -56,19 +56,19 @@ export const restoreCommand = buildCommand({ examples: [ { description: "Restore by dashboard title and revision number", - command: "sentry dashboard restore 'Frontend Performance' --revision 3", + run: "dashboard restore 'Frontend Performance' --revision 3", }, { description: "Restore by dashboard ID", - command: "sentry dashboard restore 12345 --revision 42", + run: "dashboard restore 12345 --revision 42", }, { description: "Pass the organization explicitly", - command: "sentry dashboard restore my-org/ 12345 --revision 42", + run: "dashboard restore my-org/ 12345 --revision 42", }, { description: "Output the restored dashboard as JSON", - command: "sentry dashboard restore 12345 --revision 42 --json", + run: "dashboard restore 12345 --revision 42 --json", }, ], }, diff --git a/packages/cli/src/commands/dashboard/revisions.ts b/packages/cli/src/commands/dashboard/revisions.ts index 7ba86359f..dd1baeaa9 100644 --- a/packages/cli/src/commands/dashboard/revisions.ts +++ b/packages/cli/src/commands/dashboard/revisions.ts @@ -118,23 +118,23 @@ export const revisionsCommand = buildCommand({ examples: [ { description: "List revisions by dashboard title", - command: "sentry dashboard revisions 'Frontend Performance'", + run: "dashboard revisions 'Frontend Performance'", }, { description: "List revisions by dashboard ID", - command: "sentry dashboard revisions 12345", + run: "dashboard revisions 12345", }, { description: "Pass the organization explicitly", - command: "sentry dashboard revisions my-org/ 12345", + run: "dashboard revisions my-org/ 12345", }, { description: "Fetch the next page", - command: "sentry dashboard revisions my-org/ 12345 -c next", + run: "dashboard revisions my-org/ 12345 -c next", }, { description: "Output as JSON", - command: "sentry dashboard revisions my-org/ 12345 --json", + run: "dashboard revisions my-org/ 12345 --json", }, ], }, diff --git a/packages/cli/src/commands/dashboard/view.ts b/packages/cli/src/commands/dashboard/view.ts index 48b76e68f..514f68951 100644 --- a/packages/cli/src/commands/dashboard/view.ts +++ b/packages/cli/src/commands/dashboard/view.ts @@ -169,44 +169,44 @@ export const viewCommand = buildCommand({ examples: [ { description: "View a dashboard by title", - command: "sentry dashboard view 'Frontend Performance'", + run: "dashboard view 'Frontend Performance'", }, { description: "View a dashboard by ID", - command: "sentry dashboard view 12345", + run: "dashboard view 12345", }, { description: "View by ID in an explicit organization", - command: "sentry dashboard view my-org/12345", + run: "dashboard view my-org/12345", }, { description: "Include project context in the same argument", - command: "sentry dashboard view my-org/my-project/12345", + run: "dashboard view my-org/my-project/12345", }, { description: "Pass the organization separately, e.g. for titles that contain a slash", - command: 'sentry dashboard view my-org/ "incidents/2026"', + run: 'dashboard view my-org/ "incidents/2026"', }, { description: "Override the time period", - command: "sentry dashboard view 12345 --period 7d", + run: "dashboard view 12345 --period 7d", }, { description: "Render charts with sixel graphics", - command: "sentry dashboard view 12345 --renderer sixel", + run: "dashboard view 12345 --renderer sixel", }, { description: "Auto-refresh every 30 seconds", - command: "sentry dashboard view 'Backend Performance' --refresh 30", + run: "dashboard view 'Backend Performance' --refresh 30", }, { description: "Output as JSON", - command: "sentry dashboard view 12345 --json", + run: "dashboard view 12345 --json", }, { description: "Open in the browser", - command: "sentry dashboard view 12345 -w", + run: "dashboard view 12345 -w", }, ], }, diff --git a/packages/cli/src/commands/dashboard/widget/add.ts b/packages/cli/src/commands/dashboard/widget/add.ts index 7d5a3aa80..ffdcac197 100644 --- a/packages/cli/src/commands/dashboard/widget/add.ts +++ b/packages/cli/src/commands/dashboard/widget/add.ts @@ -125,43 +125,35 @@ export const addCommand = buildCommand({ examples: [ { description: "Add a counter widget", - command: - "sentry dashboard widget add 'My Dashboard' \"Error Count\" --display big_number --query count", + run: "dashboard widget add 'My Dashboard' \"Error Count\" --display big_number --query count", }, { description: "Use a dashboard ID in an explicit organization", - command: - 'sentry dashboard widget add my-org/12345 "Error Count" --display big_number --query count', + run: 'dashboard widget add my-org/12345 "Error Count" --display big_number --query count', }, { description: "Line chart with group-by", - command: - "sentry dashboard widget add 'My Dashboard' \"Errors by Browser\" --display line --query count --group-by browser.name", + run: "dashboard widget add 'My Dashboard' \"Errors by Browser\" --display line --query count --group-by browser.name", }, { description: "Table with multiple aggregates, sorted descending", - command: - "sentry dashboard widget add 'My Dashboard' \"Top Endpoints\" --display table --query count --query p95:span.duration --group-by transaction --sort -count --limit 10", + run: "dashboard widget add 'My Dashboard' \"Top Endpoints\" --display table --query count --query p95:span.duration --group-by transaction --sort -count --limit 10", }, { description: "Bar chart with a search filter", - command: - 'sentry dashboard widget add \'My Dashboard\' "Slow Requests" --display bar --query p95:span.duration --where "span.op:http.client" --group-by span.description', + run: '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", + run: "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", + run: "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)"', + run: '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)"', }, ], }, diff --git a/packages/cli/src/commands/dashboard/widget/delete.ts b/packages/cli/src/commands/dashboard/widget/delete.ts index a5fec9aa2..d748a8594 100644 --- a/packages/cli/src/commands/dashboard/widget/delete.ts +++ b/packages/cli/src/commands/dashboard/widget/delete.ts @@ -49,16 +49,15 @@ export const deleteCommand = buildDeleteCommand( examples: [ { description: "Delete a widget by title", - command: - "sentry dashboard widget delete 'My Dashboard' --title 'Error Rate'", + run: "dashboard widget delete 'My Dashboard' --title 'Error Rate'", }, { description: "Delete a widget by index", - command: "sentry dashboard widget delete 12345 --index 0", + run: "dashboard widget delete 12345 --index 0", }, { description: "Preview the deletion", - command: "sentry dashboard widget delete 12345 --index 0 --dry-run", + run: "dashboard widget delete 12345 --index 0 --dry-run", }, ], }, diff --git a/packages/cli/src/commands/dashboard/widget/edit.ts b/packages/cli/src/commands/dashboard/widget/edit.ts index ba3f966eb..4a5baf84a 100644 --- a/packages/cli/src/commands/dashboard/widget/edit.ts +++ b/packages/cli/src/commands/dashboard/widget/edit.ts @@ -218,23 +218,19 @@ export const editCommand = buildCommand({ examples: [ { description: "Change a widget's display type", - command: - "sentry dashboard widget edit 12345 --title 'Error Rate' --display bar", + run: "dashboard widget edit 12345 --title 'Error Rate' --display bar", }, { description: "Change the query of a widget selected by index", - command: - "sentry dashboard widget edit 'My Dashboard' --index 0 --query p95:span.duration", + run: "dashboard widget edit 'My Dashboard' --index 0 --query p95:span.duration", }, { description: "Rename a widget", - command: - "sentry dashboard widget edit 12345 --title 'Old Name' --new-title 'New Name'", + run: "dashboard widget edit 12345 --title 'Old Name' --new-title 'New Name'", }, { description: "Move and resize a widget", - command: - "sentry dashboard widget edit 12345 --index 0 --col 0 --row 0 --width 6 --height 2", + run: "dashboard widget edit 12345 --index 0 --col 0 --row 0 --width 6 --height 2", }, ], }, diff --git a/packages/cli/src/commands/debug-files/bundle-jvm.ts b/packages/cli/src/commands/debug-files/bundle-jvm.ts index cff0cb069..bb9faf557 100644 --- a/packages/cli/src/commands/debug-files/bundle-jvm.ts +++ b/packages/cli/src/commands/debug-files/bundle-jvm.ts @@ -60,18 +60,15 @@ export const bundleJvmCommand = buildCommand({ examples: [ { description: "Bundle JVM sources with a debug ID", - command: - "sentry debug-files bundle-jvm --output ./out --debug-id ./src", + run: "debug-files bundle-jvm --output ./out --debug-id ./src", }, { description: "Exclude additional directories", - command: - "sentry debug-files bundle-jvm --output ./out --debug-id --exclude generated --exclude build-tools ./src", + run: "debug-files bundle-jvm --output ./out --debug-id --exclude generated --exclude build-tools ./src", }, { description: "Output as JSON", - command: - "sentry debug-files bundle-jvm --output ./out --debug-id --json ./src", + run: "debug-files bundle-jvm --output ./out --debug-id --json ./src", }, ], }, diff --git a/packages/cli/src/commands/debug-files/bundle-sources.ts b/packages/cli/src/commands/debug-files/bundle-sources.ts index 7b3463421..e4d763889 100644 --- a/packages/cli/src/commands/debug-files/bundle-sources.ts +++ b/packages/cli/src/commands/debug-files/bundle-sources.ts @@ -86,12 +86,11 @@ export const bundleSourcesCommand = buildCommand({ { description: "Bundle a debug file's referenced source files (run on the build machine)", - command: "sentry debug-files bundle-sources ./libexample.so", + run: "debug-files bundle-sources ./libexample.so", }, { description: "Write the bundle to a specific path", - command: - "sentry debug-files bundle-sources ./app.pdb --output ./app.src.zip", + run: "debug-files bundle-sources ./app.pdb --output ./app.src.zip", }, ], }, diff --git a/packages/cli/src/commands/debug-files/check.ts b/packages/cli/src/commands/debug-files/check.ts index a9b1f75e6..2364321e0 100644 --- a/packages/cli/src/commands/debug-files/check.ts +++ b/packages/cli/src/commands/debug-files/check.ts @@ -127,16 +127,15 @@ export const checkCommand = buildCommand({ { description: "Inspect a debug information file (auto-detects the format)", - command: "sentry debug-files check ./libexample.so", + run: "debug-files check ./libexample.so", }, { description: "Inspect the DWARF file inside a dSYM", - command: - "sentry debug-files check MyApp.dSYM/Contents/Resources/DWARF/MyApp", + run: "debug-files check MyApp.dSYM/Contents/Resources/DWARF/MyApp", }, { description: "Output the report as JSON", - command: "sentry debug-files check ./app.pdb --json", + run: "debug-files check ./app.pdb --json", }, ], }, diff --git a/packages/cli/src/commands/debug-files/find.ts b/packages/cli/src/commands/debug-files/find.ts index cf020f181..eb3be6386 100644 --- a/packages/cli/src/commands/debug-files/find.ts +++ b/packages/cli/src/commands/debug-files/find.ts @@ -124,17 +124,15 @@ export const findCommand = buildCommand({ examples: [ { description: "Locate debug files for a debug identifier on disk", - command: "sentry debug-files find ", + run: "debug-files find ", }, { description: "Search only for dSYMs, including an extra directory", - command: - "sentry debug-files find --type dsym --path ./build", + run: "debug-files find --type dsym --path ./build", }, { description: "Search only an explicit directory and output JSON", - command: - "sentry debug-files find --no-cwd --no-well-known -p /symbols --json", + run: "debug-files find --no-cwd --no-well-known -p /symbols --json", }, ], }, diff --git a/packages/cli/src/commands/debug-files/print-sources.ts b/packages/cli/src/commands/debug-files/print-sources.ts index 51ed1e631..afb173b82 100644 --- a/packages/cli/src/commands/debug-files/print-sources.ts +++ b/packages/cli/src/commands/debug-files/print-sources.ts @@ -114,11 +114,11 @@ export const printSourcesCommand = buildCommand({ { description: "List the source files a debug file references (and whether they're available)", - command: "sentry debug-files print-sources ./libexample.so", + run: "debug-files print-sources ./libexample.so", }, { description: "Output the list as JSON", - command: "sentry debug-files print-sources ./app.pdb --json", + run: "debug-files print-sources ./app.pdb --json", }, ], }, diff --git a/packages/cli/src/commands/debug-files/upload.ts b/packages/cli/src/commands/debug-files/upload.ts index 74f255f55..723d9dffc 100644 --- a/packages/cli/src/commands/debug-files/upload.ts +++ b/packages/cli/src/commands/debug-files/upload.ts @@ -565,46 +565,44 @@ export const uploadCommand = buildCommand({ { description: "Upload debug information files (scans directories recursively)", - command: "sentry debug-files upload ./build", + run: "debug-files upload ./build", }, { description: "Attach a source bundle to each file", - command: "sentry debug-files upload ./libexample.so --include-sources", + run: "debug-files upload ./libexample.so --include-sources", }, { description: "Scan a .zip archive in place", - command: "sentry debug-files upload ./symbols.zip", + run: "debug-files upload ./symbols.zip", }, { description: "Skip .zip archives", - command: "sentry debug-files upload ./build --no-zips", + run: "debug-files upload ./build --no-zips", }, { description: "Upload only dSYMs and wait for server-side processing", - command: "sentry debug-files upload ./dsyms --type dsym --wait", + run: "debug-files upload ./dsyms --type dsym --wait", }, { description: "Fail unless the requested debug ID is found", - command: - "sentry debug-files upload ./build --id --require-all", + run: "debug-files upload ./build --id --require-all", }, { description: "Unity: upload IL2CPP line mappings", - command: "sentry debug-files upload ./build --il2cpp-mapping", + run: "debug-files upload ./build --il2cpp-mapping", }, { description: "Unity: upload IL2CPP line mappings with referenced C# sources", - command: - "sentry debug-files upload ./build --il2cpp-mapping --include-sources", + run: "debug-files upload ./build --il2cpp-mapping --include-sources", }, { description: "Preview what would be uploaded (no credentials needed)", - command: "sentry debug-files upload ./build --no-upload", + run: "debug-files upload ./build --no-upload", }, { description: "Scan Xcode's DerivedData without uploading", - command: "sentry debug-files upload --derived-data --no-upload", + run: "debug-files upload --derived-data --no-upload", }, ], }, diff --git a/packages/cli/src/commands/docs/list.ts b/packages/cli/src/commands/docs/list.ts index 757a5324a..2d8ab5795 100644 --- a/packages/cli/src/commands/docs/list.ts +++ b/packages/cli/src/commands/docs/list.ts @@ -41,15 +41,15 @@ export const listCommand = buildCommand({ examples: [ { description: "Search the documentation index", - command: 'sentry docs list "source maps"', + run: 'docs list "source maps"', }, { description: "Limit the number of results", - command: 'sentry docs list "session replay privacy" --limit 5', + run: 'docs list "session replay privacy" --limit 5', }, { description: "Output as JSON", - command: 'sentry docs list "source maps" --json', + run: 'docs list "source maps" --json', }, ], }, diff --git a/packages/cli/src/commands/docs/query.ts b/packages/cli/src/commands/docs/query.ts index 9d555d62e..ab4212d3e 100644 --- a/packages/cli/src/commands/docs/query.ts +++ b/packages/cli/src/commands/docs/query.ts @@ -35,19 +35,19 @@ export const queryCommand = buildCommand({ examples: [ { description: "Ask a documentation question", - command: 'sentry docs "How do I configure tracing in Next.js?"', + run: 'docs "How do I configure tracing in Next.js?"', }, { description: "Use the explicit subcommand", - command: 'sentry docs query "How do I upload source maps?"', + run: 'docs query "How do I upload source maps?"', }, { description: "Use the search alias", - command: 'sentry docs search "How does session replay mask text?"', + run: 'docs search "How does session replay mask text?"', }, { description: "Output the answer as JSON", - command: 'sentry docs "How do I configure tracing?" --json', + run: 'docs "How do I configure tracing?" --json', }, ], }, diff --git a/packages/cli/src/commands/dsn/list.ts b/packages/cli/src/commands/dsn/list.ts index 6a3c4e6cd..b3414856e 100644 --- a/packages/cli/src/commands/dsn/list.ts +++ b/packages/cli/src/commands/dsn/list.ts @@ -310,29 +310,28 @@ export const listCommand = buildListCommand("dsn", { { description: "List client keys for detected projects, including monorepos", - command: "sentry dsn list", + run: "dsn list", }, { description: "List enabled and disabled DSNs for one project", - command: "sentry dsn list my-org/my-project", + run: "dsn list my-org/my-project", }, { description: "List DSNs across all accessible projects in an organization", - command: "sentry dsn list my-org/", + run: "dsn list my-org/", }, { description: "Fetch the next page", - command: "sentry dsn list my-org/ --limit 10 -c next", + run: "dsn list my-org/ --limit 10 -c next", }, { description: "Fetch the previous page", - command: "sentry dsn list my-org/ --limit 10 -c prev", + run: "dsn list my-org/ --limit 10 -c prev", }, { description: "Select public DSN fields as JSON", - command: - "sentry dsn list my-org/my-project --json --fields name,dsn,isActive", + run: "dsn list my-org/my-project --json --fields name,dsn,isActive", }, ], }, diff --git a/packages/cli/src/commands/event/analytics.ts b/packages/cli/src/commands/event/analytics.ts index f628aecdc..743204a9b 100644 --- a/packages/cli/src/commands/event/analytics.ts +++ b/packages/cli/src/commands/event/analytics.ts @@ -56,20 +56,19 @@ export const analyticsCommand = buildCommand({ examples: [ { description: "Accepted and dropped event analytics for a project", - command: "sentry event analytics my-org/my-project", + run: "event analytics my-org/my-project", }, { description: "Analytics for a different dataset", - command: "sentry event analytics my-org/my-project --dataset spans", + run: "event analytics my-org/my-project --dataset spans", }, { description: "Widen the time range", - command: "sentry event analytics my-org/my-project --period 7d", + run: "event analytics my-org/my-project --period 7d", }, { description: "Select specific JSON fields", - command: - "sentry event analytics my-org/my-project --json --fields outcome,reason,events", + run: "event analytics my-org/my-project --json --fields outcome,reason,events", }, ], }, diff --git a/packages/cli/src/commands/event/list.ts b/packages/cli/src/commands/event/list.ts index b61c56e76..e3662173e 100644 --- a/packages/cli/src/commands/event/list.ts +++ b/packages/cli/src/commands/event/list.ts @@ -88,39 +88,39 @@ export const listCommand = buildListCommand("event", { examples: [ { description: "List events for an issue (short ID)", - command: "sentry event list PROJ-ABC", + run: "event list PROJ-ABC", }, { description: "List events for an issue (numeric ID)", - command: "sentry event list 123456789", + run: "event list 123456789", }, { description: "List events for the most recent issue", - command: "sentry event list @latest --limit 50", + run: "event list @latest --limit 50", }, { description: "Filter by search query", - command: 'sentry event list PROJ-ABC --query "browser:Chrome"', + run: 'event list PROJ-ABC --query "browser:Chrome"', }, { description: "Include full event bodies (stacktraces)", - command: "sentry event list PROJ-ABC --full", + run: "event list PROJ-ABC --full", }, { description: "Limit results and time range", - command: "sentry event list PROJ-ABC --limit 50 --period 24h", + run: "event list PROJ-ABC --limit 50 --period 24h", }, { description: "Fetch the next page", - command: "sentry event list PROJ-ABC -c next", + run: "event list PROJ-ABC -c next", }, { description: "Fetch the previous page", - command: "sentry event list PROJ-ABC -c prev", + run: "event list PROJ-ABC -c prev", }, { description: "Output as JSON", - command: "sentry event list PROJ-ABC --json", + run: "event list PROJ-ABC --json", }, ], }, diff --git a/packages/cli/src/commands/event/send.ts b/packages/cli/src/commands/event/send.ts index 8c26e216b..13cf5548b 100644 --- a/packages/cli/src/commands/event/send.ts +++ b/packages/cli/src/commands/event/send.ts @@ -156,53 +156,48 @@ built entirely from the file contents. examples: [ { description: "Send an error event (default level)", - command: 'sentry event send -m "Something went wrong"', + run: 'event send -m "Something went wrong"', }, { description: "Specify level, release, and environment", - command: - 'sentry event send -m "Deploy check" -l info -r 1.0.0 -E production', + run: 'event send -m "Deploy check" -l info -r 1.0.0 -E production', }, { description: "Add tags and extra data", - command: - 'sentry event send -m "Payment failed" --tag env:prod --tag region:us-east --extra amount:99.99', + run: 'event send -m "Payment failed" --tag env:prod --tag region:us-east --extra amount:99.99', }, { description: "Set user context", - command: - 'sentry event send -m "Login error" --user id:42 --user email:alice@example.com', + run: 'event send -m "Login error" --user id:42 --user email:alice@example.com', }, { description: "Custom fingerprint to group related events together", - command: - 'sentry event send -m "DB timeout" --fingerprint db-timeout --fingerprint {{ default }}', + run: 'event send -m "DB timeout" --fingerprint db-timeout --fingerprint {{ default }}', }, { description: "Send a serialized Sentry Event object", - command: "sentry event send ./crash.json", + run: "event send ./crash.json", }, { description: "Send without re-parsing (raw mode)", - command: "sentry event send --raw ./crash.json", + run: "event send --raw ./crash.json", }, { description: "Send a pre-built envelope", - command: "sentry event send --raw ./captured.envelope", + run: "event send --raw ./captured.envelope", }, { description: "Send with an explicit DSN", - command: - 'sentry event send "https://key@o123.ingest.us.sentry.io/456" -m "Test"', + run: 'event send "https://key@o123.ingest.us.sentry.io/456" -m "Test"', }, { description: "Send to a project (logged-in session; the CLI fetches its sole active DSN)", - command: 'sentry event send my-project -m "Test"', + run: 'event send my-project -m "Test"', }, { description: "Send to an org/project target", - command: 'sentry event send my-org/my-project -m "Test"', + run: 'event send my-org/my-project -m "Test"', }, ], }, diff --git a/packages/cli/src/commands/event/view.ts b/packages/cli/src/commands/event/view.ts index e319c074f..d6def64c1 100644 --- a/packages/cli/src/commands/event/view.ts +++ b/packages/cli/src/commands/event/view.ts @@ -1358,50 +1358,46 @@ export const viewCommand = buildCommand({ examples: [ { description: "View an event", - command: "sentry event view abc123def456abc123def456abc12345", + run: "event view abc123def456abc123def456abc12345", }, { description: "View a specific event using an issue short ID", - command: "sentry event view PROJ-ABC 7388f6a62b7d436ab77bb5365f97a1ac", + run: "event view PROJ-ABC 7388f6a62b7d436ab77bb5365f97a1ac", }, { description: "View a specific event with an explicit organization", - command: - "sentry event view my-org/PROJ-ABC 7388f6a62b7d436ab77bb5365f97a1ac", + run: "event view my-org/PROJ-ABC 7388f6a62b7d436ab77bb5365f97a1ac", }, { description: "View the latest event for an issue", - command: "sentry event view PROJ-ABC", + run: "event view PROJ-ABC", }, { description: "View the latest event of the most recent unresolved issue in a project", - command: "sentry event view my-org/my-project", + run: "event view my-org/my-project", }, { description: "View the latest event of the most frequent issue", - command: "sentry event view @most_frequent", + run: "event view @most_frequent", }, { description: "Open in the browser", - command: "sentry event view abc123def456abc123def456abc12345 -w", + run: "event view abc123def456abc123def456abc12345 -w", }, { description: "Download an attachment listed by --json (with sentry api)", - command: - "sentry api 'https://sentry.io/api/0/projects/my-org/my-project/events/EVENT_ID/attachments/ATTACHMENT_ID/?download=1' > screenshot.png", + run: "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", + run: "event view my-org/my-project abc123def456abc123def456abc12345", }, { description: "View several events, finding the project across organizations", - command: - "sentry event view my-project abc123def456abc123def456abc12345 def456abc123def456abc123def45678", + run: "event view my-project abc123def456abc123def456abc12345 def456abc123def456abc123def45678", }, ], }, diff --git a/packages/cli/src/commands/explore.ts b/packages/cli/src/commands/explore.ts index bf941b838..430aafbdf 100644 --- a/packages/cli/src/commands/explore.ts +++ b/packages/cli/src/commands/explore.ts @@ -714,100 +714,85 @@ export const exploreCommand = buildListCommand("explore", { examples: [ { description: "Top errors in the last 24 hours, scoped to a project", - command: "sentry explore my-org/cli", + run: "explore my-org/cli", }, { description: "All projects in an organization", - command: "sentry explore my-org/", + run: "explore my-org/", }, { description: "Bare project slug (searches across organizations)", - command: "sentry explore cli", + run: "explore cli", }, { description: "Auto-detect the project from DSN/config", - command: "sentry explore", + run: "explore", }, { description: "Errors with user impact for a specific UTC window", - command: - 'sentry explore my-org/cli -F title -F "count()" -F "count_unique(user)" --period "2024-01-15T00:00:00Z..2024-01-16T00:00:00Z"', + run: 'explore my-org/cli -F title -F "count()" -F "count_unique(user)" --period "2024-01-15T00:00:00Z..2024-01-16T00:00:00Z"', }, { description: "Filter by error type (combined with the project filter)", - command: - 'sentry explore my-org/cli -F title -F "count()" -q "error.type:TypeError" --period 1h', + run: 'explore my-org/cli -F title -F "count()" -q "error.type:TypeError" --period 1h', }, { description: "Combine span filters while keeping the project scope", - command: - 'sentry explore my-org/cli --dataset spans -F "count()" -q "span.op:http.client OR span.status:internal_error"', + run: 'explore my-org/cli --dataset spans -F "count()" -q "span.op:http.client OR span.status:internal_error"', }, { description: "Count a metric only for a matching release", - command: - "sentry explore my-org/ --dataset metrics -F 'count_if(`release:example`,value,request_duration,distribution,none)'", + run: "explore my-org/ --dataset metrics -F 'count_if(`release:example`,value,request_duration,distribution,none)'", }, { description: "Span operation latency", - command: - 'sentry explore my-org/cli -F span.op -F "p50(span.duration)" -F "p95(span.duration)" --dataset spans --period 1h', + run: 'explore my-org/cli -F span.op -F "p50(span.duration)" -F "p95(span.duration)" --dataset spans --period 1h', }, { description: "Top spans by count", - command: - 'sentry explore my-org/cli -F span.op -F "count()" --dataset spans --sort "-count()"', + run: 'explore my-org/cli -F span.op -F "count()" --dataset spans --sort "-count()"', }, { description: "Error counts in 15-minute buckets over the last hour", - command: "sentry explore my-org/cli --time-series 15m --period 1h", + run: "explore my-org/cli --time-series 15m --period 1h", }, { description: "Latency over time with automatic bucket duration, as JSON", - command: - 'sentry explore my-org/cli --dataset spans -F "p95(span.duration)" --time-series --period 24h --json', + run: 'explore my-org/cli --dataset spans -F "p95(span.duration)" --time-series --period 24h --json', }, { description: "A metric over time using its discovered type and unit", - command: - "sentry explore my-org/cli --dataset metrics -m cache.hit_rate --agg avg -b -t 1h", + run: "explore my-org/cli --dataset metrics -m cache.hit_rate --agg avg -b -t 1h", }, { description: "Sum a custom metric (e.g., LLM token usage) across an organization", - command: - "sentry explore my-org/ -m llm.token_usage --dataset metrics --period 7d", + run: "explore my-org/ -m llm.token_usage --dataset metrics --period 7d", }, { description: "Break a metric down by a tag column", - command: - "sentry explore my-org/seer -F gen_ai.request.model -m llm.token_usage --dataset metrics --period 7d", + run: "explore my-org/seer -F gen_ai.request.model -m llm.token_usage --dataset metrics --period 7d", }, { description: "Use a different metric aggregation (default is sum)", - command: - "sentry explore my-org/ -m cache.hit_rate --agg avg --dataset metrics", + run: "explore my-org/ -m cache.hit_rate --agg avg --dataset metrics", }, { description: "Use the raw tracemetrics format", - command: - 'sentry explore my-org/ -F "sum(value,llm.token_usage,distribution,none)" --dataset metrics --period 7d', + run: 'explore my-org/ -F "sum(value,llm.token_usage,distribution,none)" --dataset metrics --period 7d', }, { description: "Filter replays by activity level", - command: - "sentry explore my-org/cli --dataset replays -F activity -F duration -F count_errors --period 7d", + run: "explore my-org/cli --dataset replays -F activity -F duration -F count_errors --period 7d", }, { description: "Log severity counts in the last hour", - command: - 'sentry explore my-org/cli -F severity -F "count()" --dataset logs --period 1h', + run: 'explore my-org/cli -F severity -F "count()" --dataset logs --period 1h', }, { description: "Pipe JSON to jq", - command: - "sentry explore my-org/cli -F title -F \"count()\" --json | jq '.data[:5]'", + run: "explore my-org/cli -F title -F \"count()\" --json | jq '.data[:5]'", }, ], }, diff --git a/packages/cli/src/commands/feedback/list.ts b/packages/cli/src/commands/feedback/list.ts index f86335d5a..699e4ef63 100644 --- a/packages/cli/src/commands/feedback/list.ts +++ b/packages/cli/src/commands/feedback/list.ts @@ -146,37 +146,35 @@ export const listCommand = buildListCommand("feedback", { examples: [ { description: "List Feedback (organization auto-detected)", - command: "sentry feedback list", + run: "feedback list", }, { description: "List Feedback for one project", - command: "sentry feedback list my-org/frontend", + run: "feedback list my-org/frontend", }, { description: "List Feedback across every project in an organization", - command: "sentry feedback list my-org/", + run: "feedback list my-org/", }, { description: "Search for a project across accessible organizations", - command: "sentry feedback list frontend", + run: "feedback list frontend", }, { description: "Show resolved Feedback", - command: "sentry feedback list my-org/frontend --status resolved", + run: "feedback list my-org/frontend --status resolved", }, { description: "Show the spam mailbox", - command: "sentry feedback list my-org/frontend --status spam", + run: "feedback list my-org/frontend --status spam", }, { description: "Show every status over the last 90 days", - command: - "sentry feedback list my-org/frontend --status all --period 90d", + run: "feedback list my-org/frontend --status all --period 90d", }, { description: "Search Feedback messages", - command: - 'sentry feedback list my-org/frontend --query "message:*checkout*"', + run: 'feedback list my-org/frontend --query "message:*checkout*"', }, ], }, diff --git a/packages/cli/src/commands/feedback/resolve.ts b/packages/cli/src/commands/feedback/resolve.ts index c163d728d..27045d7d6 100644 --- a/packages/cli/src/commands/feedback/resolve.ts +++ b/packages/cli/src/commands/feedback/resolve.ts @@ -21,20 +21,19 @@ export const resolveCommand = buildCommand({ examples: [ { description: "Resolve a Feedback item (organization auto-detected)", - command: "sentry feedback resolve FRONTEND-2SDJ", + run: "feedback resolve FRONTEND-2SDJ", }, { description: "Resolve a Feedback item in an explicit organization", - command: "sentry feedback resolve my-org/FRONTEND-2SDJ", + run: "feedback resolve my-org/FRONTEND-2SDJ", }, { description: "Resolve the most recently active unresolved Feedback", - command: "sentry feedback resolve my-org/@latest", + run: "feedback resolve my-org/@latest", }, { description: "Return selected fields from the updated Feedback", - command: - "sentry feedback resolve my-org/FRONTEND-2SDJ --json --fields id,shortId,status", + run: "feedback resolve my-org/FRONTEND-2SDJ --json --fields id,shortId,status", }, ], }, diff --git a/packages/cli/src/commands/feedback/spam.ts b/packages/cli/src/commands/feedback/spam.ts index 061fd861f..da72a914b 100644 --- a/packages/cli/src/commands/feedback/spam.ts +++ b/packages/cli/src/commands/feedback/spam.ts @@ -21,20 +21,19 @@ export const spamCommand = buildCommand({ examples: [ { description: "Move a Feedback item to the spam mailbox", - command: "sentry feedback spam FRONTEND-2SDJ", + run: "feedback spam FRONTEND-2SDJ", }, { description: "Mark as spam by numeric ID", - command: "sentry feedback spam 5146636313", + run: "feedback spam 5146636313", }, { description: "Specify an organization explicitly", - command: "sentry feedback spam my-org/FRONTEND-2SDJ", + run: "feedback spam my-org/FRONTEND-2SDJ", }, { description: "Return selected fields from the updated Feedback", - command: - "sentry feedback spam FRONTEND-2SDJ --json --fields id,shortId,status", + run: "feedback spam FRONTEND-2SDJ --json --fields id,shortId,status", }, ], }, diff --git a/packages/cli/src/commands/feedback/unresolve.ts b/packages/cli/src/commands/feedback/unresolve.ts index 8e0666234..da5936d75 100644 --- a/packages/cli/src/commands/feedback/unresolve.ts +++ b/packages/cli/src/commands/feedback/unresolve.ts @@ -22,24 +22,23 @@ export const unresolveCommand = buildCommand({ { description: "Reopen a Feedback item, or return it from spam to the inbox", - command: "sentry feedback unresolve FRONTEND-2SDJ", + run: "feedback unresolve FRONTEND-2SDJ", }, { description: "Reopen by numeric ID", - command: "sentry feedback unresolve 5146636313", + run: "feedback unresolve 5146636313", }, { description: "`reopen` is an alias for `unresolve`", - command: "sentry feedback reopen FRONTEND-2SDJ", + run: "feedback reopen FRONTEND-2SDJ", }, { description: "Specify an organization explicitly", - command: "sentry feedback unresolve my-org/FRONTEND-2SDJ", + run: "feedback unresolve my-org/FRONTEND-2SDJ", }, { description: "Return selected fields from the updated Feedback", - command: - "sentry feedback unresolve FRONTEND-2SDJ --json --fields id,shortId,status", + run: "feedback unresolve FRONTEND-2SDJ --json --fields id,shortId,status", }, ], }, diff --git a/packages/cli/src/commands/feedback/view.ts b/packages/cli/src/commands/feedback/view.ts index dd3fca134..f5a638de9 100644 --- a/packages/cli/src/commands/feedback/view.ts +++ b/packages/cli/src/commands/feedback/view.ts @@ -111,32 +111,32 @@ export const viewCommand = buildCommand({ examples: [ { description: "View the most recent unresolved Feedback", - command: "sentry feedback view @latest", + run: "feedback view @latest", }, { description: "Most recent unresolved Feedback in an explicit organization", - command: "sentry feedback view my-org/@latest", + run: "feedback view my-org/@latest", }, { description: "View by short ID", - command: "sentry feedback view FRONTEND-2SDJ", + run: "feedback view FRONTEND-2SDJ", }, { description: "View by numeric ID", - command: "sentry feedback view 5146636313", + run: "feedback view 5146636313", }, { description: "View in an explicit organization", - command: "sentry feedback view my-org/FRONTEND-2SDJ", + run: "feedback view my-org/FRONTEND-2SDJ", }, { description: "`view` is the default command", - command: "sentry feedback my-org/FRONTEND-2SDJ", + run: "feedback my-org/FRONTEND-2SDJ", }, { description: "Open the Feedback item in Sentry", - command: "sentry feedback view my-org/FRONTEND-2SDJ --web", + run: "feedback view my-org/FRONTEND-2SDJ --web", }, ], }, diff --git a/packages/cli/src/commands/games/leaderboard.ts b/packages/cli/src/commands/games/leaderboard.ts index 8f820948b..3f0216607 100644 --- a/packages/cli/src/commands/games/leaderboard.ts +++ b/packages/cli/src/commands/games/leaderboard.ts @@ -44,11 +44,11 @@ export const leaderboardCommand = buildCommand({ examples: [ { description: "Show the top Snake scores", - command: "sentry games leaderboard", + run: "games leaderboard", }, { description: "Show the scores as JSON", - command: "sentry games leaderboard --json", + run: "games leaderboard --json", }, ], }, diff --git a/packages/cli/src/commands/games/snake.ts b/packages/cli/src/commands/games/snake.ts index 2946c0caa..851903319 100644 --- a/packages/cli/src/commands/games/snake.ts +++ b/packages/cli/src/commands/games/snake.ts @@ -18,7 +18,7 @@ export const snakeCommand = buildCommand({ "pause with `p`, retry with `r`, and quit with `esc` or `q`.\n\n" + "Needs an interactive terminal and is not available when an AI agent " + "runs the CLI.", - examples: [{ description: "Play Snake", command: "sentry games snake" }], + examples: [{ description: "Play Snake", run: "games snake" }], }, auth: false, parameters: {}, diff --git a/packages/cli/src/commands/info.ts b/packages/cli/src/commands/info.ts index 65a405400..801bec302 100644 --- a/packages/cli/src/commands/info.ts +++ b/packages/cli/src/commands/info.ts @@ -123,17 +123,17 @@ export const infoCommand = buildCommand({ examples: [ { description: "Print the resolved config and verify authentication", - command: "sentry info", + run: "info", }, { description: "Verify only authentication (don't require a default org/project)", - command: "sentry info --no-defaults", + run: "info --no-defaults", }, { description: "Machine-readable status for external tooling (always exits 0)", - command: "sentry info --config-status-json", + run: "info --config-status-json", }, ], }, diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index bd70634d3..334915591 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -54,11 +54,11 @@ export const initCommand = buildCommand({ examples: [ { description: "Print the setup guide", - command: "sentry init", + run: "init", }, { description: "Print the guide as JSON", - command: "sentry init --json", + run: "init --json", }, ], }, diff --git a/packages/cli/src/commands/integration/delete.ts b/packages/cli/src/commands/integration/delete.ts index eb2357399..efe0df615 100644 --- a/packages/cli/src/commands/integration/delete.ts +++ b/packages/cli/src/commands/integration/delete.ts @@ -164,15 +164,15 @@ export const deleteCommand = buildDeleteCommand({ examples: [ { description: "Remove an integration (auto-detect org)", - command: "sentry integration delete 12345", + run: "integration delete 12345", }, { description: "Preview removing an integration", - command: "sentry integration delete my-org/12345 --dry-run", + run: "integration delete my-org/12345 --dry-run", }, { description: "Remove without the confirmation prompt", - command: "sentry integration delete my-org/12345 --yes", + run: "integration delete my-org/12345 --yes", }, ], }, diff --git a/packages/cli/src/commands/integration/list.ts b/packages/cli/src/commands/integration/list.ts index bc9e21558..d987fac06 100644 --- a/packages/cli/src/commands/integration/list.ts +++ b/packages/cli/src/commands/integration/list.ts @@ -66,28 +66,28 @@ const docs: OrgListCommandDocs = { examples: [ { description: "List installed integrations (auto-detect org)", - command: "sentry integration list", + run: "integration list", }, { description: "List integrations in a specific org", - command: "sentry integration list my-org/", + run: "integration list my-org/", }, { description: "Fetch the next page", - command: "sentry integration list my-org/ -c next", + run: "integration list my-org/ -c next", }, { description: "Only integrations whose name or provider matches a glob", - command: "sentry integration list 'my-org/git*'", + run: "integration list 'my-org/git*'", }, { description: "Integrations named like 'GitHub' (fuzzy when nothing matches exactly)", - command: "sentry integration list my-org/githb", + run: "integration list my-org/githb", }, { description: "Output as JSON", - command: "sentry integration list --json", + run: "integration list --json", }, ], }; diff --git a/packages/cli/src/commands/issue/archive.ts b/packages/cli/src/commands/issue/archive.ts index f6cabefc1..d11ae030e 100644 --- a/packages/cli/src/commands/issue/archive.ts +++ b/packages/cli/src/commands/issue/archive.ts @@ -347,47 +347,47 @@ export const archiveCommand = buildCommand({ examples: [ { description: "Archive forever (fully silenced)", - command: "sentry issue archive CLI-G5", + run: "issue archive CLI-G5", }, { description: "Unarchive when Sentry detects a spike in event frequency", - command: "sentry issue archive CLI-G5 --until auto", + run: "issue archive CLI-G5 --until auto", }, { description: "Archive for 1 hour", - command: "sentry issue archive CLI-G5 --until 1h", + run: "issue archive CLI-G5 --until 1h", }, { description: "Archive for 7 days", - command: "sentry issue archive CLI-G5 --until 7d", + run: "issue archive CLI-G5 --until 7d", }, { description: "Archive until a specific date", - command: "sentry issue archive CLI-G5 --until 2026-12-31", + run: "issue archive CLI-G5 --until 2026-12-31", }, { description: "Unarchive after 100 more events", - command: "sentry issue archive CLI-G5 --until 100x", + run: "issue archive CLI-G5 --until 100x", }, { description: "Unarchive after 10 more users are affected", - command: "sentry issue archive CLI-G5 --until 10u", + run: "issue archive CLI-G5 --until 10u", }, { description: "Unarchive after 100 events within 1 hour", - command: "sentry issue archive CLI-G5 --until 100x/1h", + run: "issue archive CLI-G5 --until 100x/1h", }, { description: "Unarchive after 10 users within 1 day", - command: "sentry issue archive CLI-G5 --until 10u/1d", + run: "issue archive CLI-G5 --until 10u/1d", }, { description: "Use the verbose condition form", - command: "sentry issue archive CLI-G5 --until 10events/2hours", + run: "issue archive CLI-G5 --until 10events/2hours", }, { description: "`ignore` is an alias for `archive`", - command: "sentry issue ignore CLI-G5 --until auto", + run: "issue ignore CLI-G5 --until auto", }, ], }, diff --git a/packages/cli/src/commands/issue/events.ts b/packages/cli/src/commands/issue/events.ts index 7fc35a948..e268ac929 100644 --- a/packages/cli/src/commands/issue/events.ts +++ b/packages/cli/src/commands/issue/events.ts @@ -82,31 +82,31 @@ export const eventsCommand = buildListCommand("issue", { examples: [ { description: "List recent events for an issue", - command: "sentry issue events FRONT-ABC", + run: "issue events FRONT-ABC", }, { description: "List events for the most recent issue", - command: "sentry issue events @latest --limit 50", + run: "issue events @latest --limit 50", }, { description: "Filter events by search query", - command: 'sentry issue events FRONT-ABC --query "browser:Chrome"', + run: 'issue events FRONT-ABC --query "browser:Chrome"', }, { description: "Show full event details", - command: "sentry issue events FRONT-ABC --full", + run: "issue events FRONT-ABC --full", }, { description: "Limit results and filter by time period", - command: "sentry issue events FRONT-ABC --limit 50 --period 24h", + run: "issue events FRONT-ABC --limit 50 --period 24h", }, { description: "Fetch the next page", - command: "sentry issue events FRONT-ABC -c next", + run: "issue events FRONT-ABC -c next", }, { description: "Output as JSON", - command: "sentry issue events FRONT-ABC --json", + run: "issue events FRONT-ABC --json", }, ], }, diff --git a/packages/cli/src/commands/issue/explain.ts b/packages/cli/src/commands/issue/explain.ts index 7ccf86de9..5bfcf66d2 100644 --- a/packages/cli/src/commands/issue/explain.ts +++ b/packages/cli/src/commands/issue/explain.ts @@ -107,31 +107,31 @@ export const explainCommand = buildCommand({ { description: "Analyze the root cause of an issue (may take a few minutes for new issues)", - command: "sentry issue explain 123456789", + run: "issue explain 123456789", }, { description: "Explain the most recent issue", - command: "sentry issue explain @latest", + run: "issue explain @latest", }, { description: "Explain the most frequently occurring issue", - command: "sentry issue explain @most_frequent", + run: "issue explain @most_frequent", }, { description: "Use a short ID with an organization prefix", - command: "sentry issue explain my-org/MYPROJECT-ABC", + run: "issue explain my-org/MYPROJECT-ABC", }, { description: "Analyze multiple issues in one invocation", - command: "sentry issue explain FRONT-ABC BACK-2", + run: "issue explain FRONT-ABC BACK-2", }, { description: "Force a fresh analysis", - command: "sentry issue explain 123456789 --force", + run: "issue explain 123456789 --force", }, { description: "Output root causes as JSON", - command: "sentry issue explain 123456789 --json", + run: "issue explain 123456789 --json", }, ], }, diff --git a/packages/cli/src/commands/issue/link.ts b/packages/cli/src/commands/issue/link.ts index 1f46bed53..aa5da0a08 100644 --- a/packages/cli/src/commands/issue/link.ts +++ b/packages/cli/src/commands/issue/link.ts @@ -34,33 +34,27 @@ export const linkCommand = buildCommand({ examples: [ { description: "Link a GitHub issue", - command: - "sentry issue link FRONT-123 https://github.com/example/app/issues/42", + run: "issue link FRONT-123 https://github.com/example/app/issues/42", }, { description: "Link a GitHub pull request", - command: - "sentry issue link FRONT-123 https://github.com/example/app/pull/43", + run: "issue link FRONT-123 https://github.com/example/app/pull/43", }, { description: "Link a Jira issue in an explicit organization", - command: - "sentry issue link my-org/FRONT-123 https://example.atlassian.net/browse/APP-42", + run: "issue link my-org/FRONT-123 https://example.atlassian.net/browse/APP-42", }, { description: "Link a Linear issue", - command: - "sentry issue link FRONT-123 https://linear.app/example/issue/APP-42/fix-error", + run: "issue link FRONT-123 https://linear.app/example/issue/APP-42/fix-error", }, { description: "Prepare the link without submitting it", - command: - "sentry issue link my-org/FRONT-123 https://github.com/example/app/issues/42 --dry-run", + run: "issue link my-org/FRONT-123 https://github.com/example/app/issues/42 --dry-run", }, { description: "Output the result as JSON", - command: - "sentry issue link my-org/FRONT-123 https://github.com/example/app/issues/42 --json", + run: "issue link my-org/FRONT-123 https://github.com/example/app/issues/42 --json", }, ], }, diff --git a/packages/cli/src/commands/issue/list.ts b/packages/cli/src/commands/issue/list.ts index 784bc0f85..e4ff2fa72 100644 --- a/packages/cli/src/commands/issue/list.ts +++ b/packages/cli/src/commands/issue/list.ts @@ -1668,50 +1668,48 @@ export const listCommand = buildListCommand("issue", { examples: [ { description: "List issues (project auto-detected)", - command: "sentry issue list", + run: "issue list", }, { description: "List issues in a specific project", - command: "sentry issue list my-org/frontend", + run: "issue list my-org/frontend", }, { description: "Several projects in the same organization", - command: "sentry issue list my-org/frontend,backend,worker", + run: "issue list my-org/frontend,backend,worker", }, { description: "All projects in an organization", - command: "sentry issue list my-org/", + run: "issue list my-org/", }, { description: "Search for a project across organizations", - command: "sentry issue list frontend", + run: "issue list frontend", }, { description: "Show only unresolved issues", - command: 'sentry issue list my-org/frontend --query "is:unresolved"', + run: 'issue list my-org/frontend --query "is:unresolved"', }, { description: "Sort by frequency", - command: "sentry issue list my-org/frontend --sort freq --limit 20", + run: "issue list my-org/frontend --sort freq --limit 20", }, { description: "Sort by Sentry's recommended relevance ranking", - command: "sentry issue list my-org/frontend --sort recommended", + run: "issue list my-org/frontend --sort recommended", }, { description: "Multiple filters (space-separated terms are combined with AND)", - command: - 'sentry issue list --query "is:unresolved level:error assigned:me"', + run: 'issue list --query "is:unresolved level:error assigned:me"', }, { description: "Negation and wildcards", - command: - 'sentry issue list --query "!browser:Chrome message:*timeout*"', + run: 'issue list --query "!browser:Chrome message:*timeout*"', }, { description: "Match multiple values for one key", - command: 'sentry issue list --query "browser:[Chrome,Firefox]"', + run: 'issue list --query "browser:[Chrome,Firefox]"', }, ], }, diff --git a/packages/cli/src/commands/issue/merge.ts b/packages/cli/src/commands/issue/merge.ts index 76d09526e..99dda56b8 100644 --- a/packages/cli/src/commands/issue/merge.ts +++ b/packages/cli/src/commands/issue/merge.ts @@ -276,20 +276,19 @@ export const mergeCommand = buildCommand({ { description: "Let Sentry pick the parent (typically the largest by event count)", - command: "sentry issue merge CLI-K9 CLI-15H CLI-15N", + run: "issue merge CLI-K9 CLI-15H CLI-15N", }, { description: "Pin the canonical parent explicitly", - command: "sentry issue merge CLI-K9 CLI-15H CLI-15N --into CLI-K9", + run: "issue merge CLI-K9 CLI-15H CLI-15N --into CLI-K9", }, { description: "Use organization-qualified IDs", - command: - "sentry issue merge my-org/CLI-K9 my-org/CLI-15H --into my-org/CLI-K9", + run: "issue merge my-org/CLI-K9 my-org/CLI-15H --into my-org/CLI-K9", }, { description: "Use project-alias IDs", - command: "sentry issue merge cli-k9 cli-15h --into cli-k9", + run: "issue merge cli-k9 cli-15h --into cli-k9", }, ], }, diff --git a/packages/cli/src/commands/issue/plan.ts b/packages/cli/src/commands/issue/plan.ts index 2594520ae..9c735f7f1 100644 --- a/packages/cli/src/commands/issue/plan.ts +++ b/packages/cli/src/commands/issue/plan.ts @@ -228,19 +228,19 @@ export const planCommand = buildCommand({ examples: [ { description: "Generate a fix plan (runs explain first if needed)", - command: "sentry issue plan 123456789", + run: "issue plan 123456789", }, { description: "Generate a fix plan for the most recent issue", - command: "sentry issue plan @latest", + run: "issue plan @latest", }, { description: "Use a short ID with an organization prefix", - command: "sentry issue plan my-org/MYPROJECT-ABC", + run: "issue plan my-org/MYPROJECT-ABC", }, { description: "Force a fresh plan even if one already exists", - command: "sentry issue plan 123456789 --force", + run: "issue plan 123456789 --force", }, ], }, diff --git a/packages/cli/src/commands/issue/resolve.ts b/packages/cli/src/commands/issue/resolve.ts index 38b732fb3..a015a828b 100644 --- a/packages/cli/src/commands/issue/resolve.ts +++ b/packages/cli/src/commands/issue/resolve.ts @@ -114,35 +114,34 @@ export const resolveCommand = buildCommand({ examples: [ { description: "Resolve immediately (no regression tracking)", - command: "sentry issue resolve CLI-G5", + run: "issue resolve CLI-G5", }, { description: "Resolve in a specific release (newer releases flag regressions)", - command: "sentry issue resolve CLI-G5 --in 0.26.1", + run: "issue resolve CLI-G5 --in 0.26.1", }, { description: "Monorepo-style release versions work too", - command: "sentry issue resolve CLI-G5 --in spotlight@1.2.3", + run: "issue resolve CLI-G5 --in spotlight@1.2.3", }, { description: "Resolve in the next release", - command: "sentry issue resolve CLI-G5 --in @next", + run: "issue resolve CLI-G5 --in @next", }, { description: "Resolve in the current git HEAD (auto-detects the Sentry repo from your origin remote)", - command: "sentry issue resolve CLI-G5 --in @commit", + run: "issue resolve CLI-G5 --in @commit", }, { description: "Resolve in an explicit commit and repo (no git inspection)", - command: - "sentry issue resolve CLI-G5 --in @commit:getsentry/cli@abc123def", + run: "issue resolve CLI-G5 --in @commit:getsentry/cli@abc123def", }, { description: "Resolve an issue in an explicit organization", - command: "sentry issue resolve my-org/CLI-G5", + run: "issue resolve my-org/CLI-G5", }, ], }, diff --git a/packages/cli/src/commands/issue/tags.ts b/packages/cli/src/commands/issue/tags.ts index 8554181c7..523fc0f7e 100644 --- a/packages/cli/src/commands/issue/tags.ts +++ b/packages/cli/src/commands/issue/tags.ts @@ -51,22 +51,20 @@ export const tagsCommand = buildCommand({ examples: [ { description: "Show which releases concentrate an issue's events", - command: "sentry issue tags my-org/FRONT-ABC release", + run: "issue tags my-org/FRONT-ABC release", }, { description: "Inspect server distribution for the latest issue in production", - command: - "sentry issue tags @latest server_name --environment production", + run: "issue tags @latest server_name --environment production", }, { description: "Get browser counts and timestamps as JSON", - command: "sentry issue tags FRONT-ABC browser.name --json", + run: "issue tags FRONT-ABC browser.name --json", }, { description: "Select the aggregate fields for a release distribution", - command: - "sentry issue tags FRONT-ABC release --json --fields key,totalValues,topValues", + run: "issue tags FRONT-ABC release --json --fields key,totalValues,topValues", }, ], }, diff --git a/packages/cli/src/commands/issue/unlink.ts b/packages/cli/src/commands/issue/unlink.ts index 944568157..9e581f91b 100644 --- a/packages/cli/src/commands/issue/unlink.ts +++ b/packages/cli/src/commands/issue/unlink.ts @@ -35,23 +35,19 @@ export const unlinkCommand = buildDeleteCommand({ examples: [ { description: "Unlink a GitHub issue (prompts for confirmation)", - command: - "sentry issue unlink FRONT-123 https://github.com/example/app/issues/42", + run: "issue unlink FRONT-123 https://github.com/example/app/issues/42", }, { description: "Unlink a GitHub pull request without prompting", - command: - "sentry issue unlink FRONT-123 https://github.com/example/app/pull/43 --yes", + run: "issue unlink FRONT-123 https://github.com/example/app/pull/43 --yes", }, { description: "Unlink a Jira issue in an explicit organization", - command: - "sentry issue unlink my-org/FRONT-123 https://example.atlassian.net/browse/APP-42 --yes", + run: "issue unlink my-org/FRONT-123 https://example.atlassian.net/browse/APP-42 --yes", }, { description: "Check whether a link exists without removing it", - command: - "sentry issue unlink FRONT-123 https://linear.app/example/issue/APP-42/fix-error --dry-run", + run: "issue unlink FRONT-123 https://linear.app/example/issue/APP-42/fix-error --dry-run", }, ], }, diff --git a/packages/cli/src/commands/issue/unresolve.ts b/packages/cli/src/commands/issue/unresolve.ts index 7aad926e2..5ed0bc43c 100644 --- a/packages/cli/src/commands/issue/unresolve.ts +++ b/packages/cli/src/commands/issue/unresolve.ts @@ -34,15 +34,15 @@ export const unresolveCommand = buildCommand({ examples: [ { description: "Reopen a resolved issue", - command: "sentry issue unresolve CLI-G5", + run: "issue unresolve CLI-G5", }, { description: "`reopen` is an alias for `unresolve`", - command: "sentry issue reopen CLI-G5", + run: "issue reopen CLI-G5", }, { description: "Reopen an issue in an explicit organization", - command: "sentry issue unresolve my-org/CLI-G5", + run: "issue unresolve my-org/CLI-G5", }, ], }, diff --git a/packages/cli/src/commands/issue/view.ts b/packages/cli/src/commands/issue/view.ts index 57b15c434..a61f4aa59 100644 --- a/packages/cli/src/commands/issue/view.ts +++ b/packages/cli/src/commands/issue/view.ts @@ -337,59 +337,54 @@ export const viewCommand = buildCommand({ "In multi-project mode (after 'issue list'), use alias-suffix format (e.g., 'f-g' " + "where 'f' is the project alias shown in the list).", examples: [ - { description: "View an issue", command: "sentry issue view FRONT-ABC" }, + { description: "View an issue", run: "issue view FRONT-ABC" }, { description: "View the most recent issue", - command: "sentry issue view @latest", + run: "issue view @latest", }, { description: "View several issues (space-separated, not commas)", - command: "sentry issue view FRONT-ABC BACK-2", + run: "issue view FRONT-ABC BACK-2", }, { description: "Select an organization explicitly", - command: "sentry issue view my-org/FRONT-ABC", + run: "issue view my-org/FRONT-ABC", }, { description: 'Use a GitHub-style identifier (the "#" replaces the final slash)', - command: "sentry issue view my-org/my-project#FRONT-ABC", + run: "issue view my-org/my-project#FRONT-ABC", }, { description: "Open issues in the browser (up to 5 tabs by default)", - command: "sentry issue view FRONT-ABC BACK-2 -w", + run: "issue view FRONT-ABC BACK-2 -w", }, { description: "Allow more than 5 browser tabs", - command: - "sentry issue view FRONT-ABC BACK-2 API-3 WEB-4 IOS-5 OPS-6 -w --force", + run: "issue view FRONT-ABC BACK-2 API-3 WEB-4 IOS-5 OPS-6 -w --force", }, { description: "Full JSON (issue fields + latest event + trace/replay context)", - command: "sentry issue view FRONT-ABC --json", + run: "issue view FRONT-ABC --json", }, { description: "Select top-level fields to keep output small", - command: - "sentry issue view FRONT-ABC --json --fields shortId,title,culprit,count,userCount,permalink", + run: "issue view FRONT-ABC --json --fields shortId,title,culprit,count,userCount,permalink", }, { description: "Select fields from the latest event instead of the whole event", - command: - "sentry issue view FRONT-ABC --json --fields event.id,event.title,event.dateCreated", + run: "issue view FRONT-ABC --json --fields event.id,event.title,event.dateCreated", }, { description: "Extract the request URL and method from the latest event", - command: - "sentry issue view FRONT-ABC --json | jq '.event.entries[] | select(.type == \"request\") | .data | {url, method}'", + run: "issue view FRONT-ABC --json | jq '.event.entries[] | select(.type == \"request\") | .data | {url, method}'", }, { description: "Extract the exception type and value from the latest event", - command: - "sentry issue view FRONT-ABC --json | jq '.event.entries[] | select(.type == \"exception\") | .data.values[0] | {type, value}'", + run: "issue view FRONT-ABC --json | jq '.event.entries[] | select(.type == \"exception\") | .data.values[0] | {type, value}'", }, ], }, diff --git a/packages/cli/src/commands/local/run.ts b/packages/cli/src/commands/local/run.ts index 939c99cd0..2b8d7569e 100644 --- a/packages/cli/src/commands/local/run.ts +++ b/packages/cli/src/commands/local/run.ts @@ -407,39 +407,38 @@ export const runCommand = buildCommand({ examples: [ { description: "Run a Node.js dev server with the local server enabled", - command: "sentry local run -- npm run dev", + run: "local run -- npm run dev", }, { description: "Run a Django dev server with the local server enabled", - command: "sentry local run -- python manage.py runserver", + run: "local run -- python manage.py runserver", }, { description: "Capture into a daemon session, inspect it after the app exits, then clean up", - command: [ - "sentry local run --session web -- npm run dev", - "sentry local session list --json", - "sentry local session view web --json", - "sentry local session retention web --max-envelopes 2000", - "sentry local event list web --json", - "sentry local event view web --json", - "sentry local envelope list web --json", - "sentry local envelope view web --json", - "sentry local session reset web", - "sentry local session close web", - "sentry local daemon status", - "sentry local daemon stop", + run: [ + "local run --session web -- npm run dev", + "local session list --json", + "local session view web --json", + "local session retention web --max-envelopes 2000", + "local event list web --json", + "local event view web --json", + "local envelope list web --json", + "local envelope view web --json", + "local session reset web", + "local session close web", + "local daemon status", + "local daemon stop", ], }, { description: "Run your app and open the Sentry Local UI", - command: "sentry local run --open -- npm run dev", + run: "local run --open -- npm run dev", }, { description: "Stream agent-relevant NDJSON without SDK housekeeping envelopes", - command: - "sentry local run --format json -f error -f transaction -f log -f ai -- npm run dev", + run: "local run --format json -f error -f transaction -f log -f ai -- npm run dev", }, ], }, diff --git a/packages/cli/src/commands/local/server.ts b/packages/cli/src/commands/local/server.ts index d9f40cd04..f77eb5ce7 100644 --- a/packages/cli/src/commands/local/server.ts +++ b/packages/cli/src/commands/local/server.ts @@ -1025,33 +1025,33 @@ export const serverCommand = buildCommand({ examples: [ { description: "Start the server and tail events", - command: "sentry local", + run: "local", }, - { description: "Use a custom port", command: "sentry local --port 9000" }, + { description: "Use a custom port", run: "local --port 9000" }, { description: "Receive into a daemon session that outlives this terminal", - command: "sentry local serve --session worker", + run: "local serve --session worker", }, { description: "Only show errors and logs (filter out transactions)", - command: "sentry local -f error -f log", + run: "local -f error -f log", }, { description: "Only show AI/agent spans", - command: "sentry local -f ai", + run: "local -f ai", }, { description: "Suppress per-envelope tail output", - command: "sentry local --quiet", + run: "local --quiet", }, { description: "Stream NDJSON for scripts and agents", - command: "sentry local --format json", + run: "local --format json", }, { description: "Start the server and open the Sentry Local UI", - command: "sentry local --open", + run: "local --open", }, ], }, diff --git a/packages/cli/src/commands/log/list.ts b/packages/cli/src/commands/log/list.ts index be33afb80..1512fa417 100644 --- a/packages/cli/src/commands/log/list.ts +++ b/packages/cli/src/commands/log/list.ts @@ -777,47 +777,46 @@ export const listCommand = buildListCommand( "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" }, + { description: "List the last 100 logs", run: "log list" }, { description: "Show only error logs", - command: "sentry log list -q 'severity:error'", + run: "log list -q 'severity:error'", }, { description: "Filter by message content", - command: "sentry log list -q 'database'", + run: "log list -q 'database'", }, { description: "Match a regular expression (key://pattern//)", - command: "sentry log list -q 'message://^Timeout after \\d+ms//'", + run: "log list -q 'message://^Timeout after \\d+ms//'", }, { description: "Show the last 50 logs", - command: "sentry log list --limit 50", + run: "log list --limit 50", }, { description: "List logs for a trace", - command: "sentry log list abc123def456abc123def456abc12345", + run: "log list abc123def456abc123def456abc12345", }, { description: "Stream logs (2-second poll interval)", - command: "sentry log list -f", + run: "log list -f", }, { description: "Stream logs (5-second poll interval)", - command: "sentry log list -f 5", + run: "log list -f 5", }, { description: "Stream error logs from a specific project", - command: "sentry log list my-org/backend -f -q 'severity:error'", + run: "log list my-org/backend -f -q 'severity:error'", }, { description: "Filter JSON output with jq", - command: - "sentry log list --json | jq '.data[] | select(.severity == \"error\")'", + run: "log list --json | jq '.data[] | select(.severity == \"error\")'", }, { description: "Filter by trace in an explicit organization", - command: "sentry log list my-org/abc123def456abc123def456abc12345", + run: "log list my-org/abc123def456abc123def456abc12345", }, ], }, diff --git a/packages/cli/src/commands/log/view.ts b/packages/cli/src/commands/log/view.ts index 966dd4f04..bb1b1cf3e 100644 --- a/packages/cli/src/commands/log/view.ts +++ b/packages/cli/src/commands/log/view.ts @@ -461,20 +461,19 @@ export const viewCommand = buildCommand({ examples: [ { description: "View a log entry", - command: "sentry log view 968c763c740cfda8b6728f27fb9e9b01", + run: "log view 968c763c740cfda8b6728f27fb9e9b01", }, { description: "Specify the project explicitly", - command: - "sentry log view my-org/backend 968c763c740cfda8b6728f27fb9e9b01", + run: "log view my-org/backend 968c763c740cfda8b6728f27fb9e9b01", }, { description: "Open in the browser", - command: "sentry log view 968c763c740cfda8b6728f27fb9e9b01 -w", + run: "log view 968c763c740cfda8b6728f27fb9e9b01 -w", }, { description: "Find a project across organizations", - command: "sentry log view backend 968c763c740cfda8b6728f27fb9e9b01", + run: "log view backend 968c763c740cfda8b6728f27fb9e9b01", }, ], }, diff --git a/packages/cli/src/commands/mcp.ts b/packages/cli/src/commands/mcp.ts index d1f33f97a..3df8b66b1 100644 --- a/packages/cli/src/commands/mcp.ts +++ b/packages/cli/src/commands/mcp.ts @@ -96,27 +96,27 @@ export const mcpCommand = buildCommand({ examples: [ { description: "Start the server with the current CLI login", - command: "sentry mcp", + run: "mcp", }, { description: "Limit every call to one organization", - command: "sentry mcp acme/", + run: "mcp acme/", }, { description: "Limit calls to one project", - command: "sentry mcp acme/web", + run: "mcp acme/web", }, { description: "Grant every skill, including seer on self-hosted", - command: "sentry mcp --all-skills", + run: "mcp --all-skills", }, { description: "Grant only some skills", - command: "sentry mcp --skills inspect,triage", + run: "mcp --skills inspect,triage", }, { description: "Pick the LLM provider for AI-powered search", - command: "sentry mcp --agent-provider anthropic", + run: "mcp --agent-provider anthropic", }, ], }, diff --git a/packages/cli/src/commands/monitor/list.ts b/packages/cli/src/commands/monitor/list.ts index cb47051ec..c7ebee7c1 100644 --- a/packages/cli/src/commands/monitor/list.ts +++ b/packages/cli/src/commands/monitor/list.ts @@ -88,26 +88,26 @@ const docs: OrgListCommandDocs = { examples: [ { description: "List monitors (organization auto-detected)", - command: "sentry monitor list", + run: "monitor list", }, { description: "List cron monitors in an organization", - command: "sentry monitor list my-org/", + run: "monitor list my-org/", }, { description: "Fetch the next page", - command: "sentry monitor list my-org/ -c next", + run: "monitor list my-org/ -c next", }, { description: "Only monitors whose slug or name matches a glob", - command: "sentry monitor list 'my-org/nightly-*'", + run: "monitor list 'my-org/nightly-*'", }, { description: "Monitors named like 'nightly' (fuzzy when nothing matches exactly)", - command: "sentry monitor list my-org/nigthly", + run: "monitor list my-org/nigthly", }, - { description: "Output as JSON", command: "sentry monitor list --json" }, + { description: "Output as JSON", run: "monitor list --json" }, ], }; diff --git a/packages/cli/src/commands/monitor/run.ts b/packages/cli/src/commands/monitor/run.ts index dbd624929..f591bb864 100644 --- a/packages/cli/src/commands/monitor/run.ts +++ b/packages/cli/src/commands/monitor/run.ts @@ -185,18 +185,19 @@ The wrapped command receives the \`SENTRY_MONITOR_SLUG\` environment variable.`, examples: [ { description: "Wrap a command with cron monitor check-ins (DSN-based)", - command: - "SENTRY_DSN=https://examplePublicKey@o0.ingest.sentry.io/0 sentry monitor run nightly-job -- python manage.py cron", + run: { + prefix: "SENTRY_DSN=https://examplePublicKey@o0.ingest.sentry.io/0 ", + args: "monitor run nightly-job -- python manage.py cron", + }, }, { description: "The -- separator is optional when the command has no flags", - command: "sentry monitor run nightly-job npm run task", + run: "monitor run nightly-job npm run task", }, { description: "Create or update the monitor on the first check-in", - command: - 'sentry monitor run nightly-job -s "0 0 * * *" --max-runtime 30 --timezone UTC -- ./backup.sh', + run: 'monitor run nightly-job -s "0 0 * * *" --max-runtime 30 --timezone UTC -- ./backup.sh', }, ], }, diff --git a/packages/cli/src/commands/org/list.ts b/packages/cli/src/commands/org/list.ts index 6ba8fcc2d..d044f843a 100644 --- a/packages/cli/src/commands/org/list.ts +++ b/packages/cli/src/commands/org/list.ts @@ -405,25 +405,25 @@ export const listCommand = buildCommand({ "(best matches first), or as a glob like 'acme-*'.\n\n" + "Alias: `sentry orgs` → `sentry org list`", examples: [ - { description: "List organizations", command: "sentry org list" }, + { description: "List organizations", run: "org list" }, { description: "Only organizations whose slug or name matches (fuzzy, best matches first)", - command: "sentry org list acme", + run: "org list acme", }, { description: "Only organizations matching a glob", - command: "sentry org list 'acme-*'", + run: "org list 'acme-*'", }, { description: "Only one account's organizations", - command: "sentry org list --account jane@acme.com", + run: "org list --account jane@acme.com", }, { description: "Same email on several servers: add the server", - command: "sentry org list -a jane@example.com:sentry.io", + run: "org list -a jane@example.com:sentry.io", }, - { description: "Output as JSON", command: "sentry org list --json" }, + { description: "Output as JSON", run: "org list --json" }, ], }, output: { human: formatOrgListHuman, schema: OrgListEntrySchema }, diff --git a/packages/cli/src/commands/org/view.ts b/packages/cli/src/commands/org/view.ts index 7a422983c..54e1cee67 100644 --- a/packages/cli/src/commands/org/view.ts +++ b/packages/cli/src/commands/org/view.ts @@ -38,11 +38,11 @@ export const viewCommand = buildCommand({ examples: [ { description: "View organization details", - command: "sentry org view my-org", + run: "org view my-org", }, { description: "Open in the browser", - command: "sentry org view my-org -w", + run: "org view my-org -w", }, ], }, diff --git a/packages/cli/src/commands/platform/list.ts b/packages/cli/src/commands/platform/list.ts index 435253cbe..23cf8d6b5 100644 --- a/packages/cli/src/commands/platform/list.ts +++ b/packages/cli/src/commands/platform/list.ts @@ -43,13 +43,13 @@ export const listCommand = buildCommand({ examples: [ { description: "List all valid Sentry platform identifiers", - command: "sentry platform list", + run: "platform list", }, { description: "Filter by substring", - command: "sentry platform list --search python", + run: "platform list --search python", }, - { description: "Output as JSON", command: "sentry platform list --json" }, + { description: "Output as JSON", run: "platform list --json" }, ], }, output: { diff --git a/packages/cli/src/commands/proguard/upload.ts b/packages/cli/src/commands/proguard/upload.ts index 3ed0da10f..df5e34848 100644 --- a/packages/cli/src/commands/proguard/upload.ts +++ b/packages/cli/src/commands/proguard/upload.ts @@ -162,25 +162,23 @@ export const uploadCommand = buildCommand({ examples: [ { description: "Upload a ProGuard/R8 mapping file", - command: - "sentry proguard upload ./app/build/outputs/mapping/release/mapping.txt", + run: "proguard upload ./app/build/outputs/mapping/release/mapping.txt", }, { description: "Upload multiple mapping files", - command: "sentry proguard upload mapping-release.txt mapping-debug.txt", + run: "proguard upload mapping-release.txt mapping-debug.txt", }, { description: "Validate without uploading", - command: "sentry proguard upload mapping.txt --no-upload", + run: "proguard upload mapping.txt --no-upload", }, { description: "Fail if no mapping files are found (useful in CI)", - command: "sentry proguard upload ./mapping/ --require-one", + run: "proguard upload ./mapping/ --require-one", }, { description: "Upload with an explicit UUID", - command: - "sentry proguard upload mapping.txt --uuid 5db7294d-87fc-5726-a5c0-4a90679657a5", + run: "proguard upload mapping.txt --uuid 5db7294d-87fc-5726-a5c0-4a90679657a5", }, ], }, diff --git a/packages/cli/src/commands/proguard/uuid.ts b/packages/cli/src/commands/proguard/uuid.ts index c359faa3c..c14a01000 100644 --- a/packages/cli/src/commands/proguard/uuid.ts +++ b/packages/cli/src/commands/proguard/uuid.ts @@ -33,12 +33,11 @@ export const uuidCommand = buildCommand({ examples: [ { description: "Compute the UUID for a ProGuard/R8 mapping file", - command: - "sentry proguard uuid ./app/build/outputs/mapping/release/mapping.txt", + run: "proguard uuid ./app/build/outputs/mapping/release/mapping.txt", }, { description: "Output as JSON (includes the file path)", - command: "sentry proguard uuid mapping.txt --json", + run: "proguard uuid mapping.txt --json", }, ], }, diff --git a/packages/cli/src/commands/project/create.ts b/packages/cli/src/commands/project/create.ts index bc54b1555..9a8a26b59 100644 --- a/packages/cli/src/commands/project/create.ts +++ b/packages/cli/src/commands/project/create.ts @@ -687,25 +687,23 @@ export const createCommand = buildCommand({ examples: [ { description: "Create a project (every project is a name:platform pair)", - command: "sentry project create my-new-app:javascript-nextjs", + run: "project create my-new-app:javascript-nextjs", }, { description: "Create several projects with their own platforms", - command: - "sentry project create web:javascript api:python-django worker:node", + run: "project create web:javascript api:python-django worker:node", }, { description: "Create under a specific organization and team", - command: - "sentry project create my-org/my-new-app:python --team backend-team", + run: "project create my-org/my-new-app:python --team backend-team", }, { description: "Preview without creating", - command: "sentry project create my-new-app:node --dry-run", + run: "project create my-new-app:node --dry-run", }, { description: "Output the created project as JSON", - command: "sentry project create my-app:go --json", + run: "project create my-app:go --json", }, ], }, diff --git a/packages/cli/src/commands/project/delete.ts b/packages/cli/src/commands/project/delete.ts index 7b4093482..594b860b5 100644 --- a/packages/cli/src/commands/project/delete.ts +++ b/packages/cli/src/commands/project/delete.ts @@ -139,15 +139,15 @@ export const deleteCommand = buildDeleteCommand({ examples: [ { description: "Delete a project (prompts for confirmation)", - command: "sentry project delete my-org/old-project", + run: "project delete my-org/old-project", }, { description: "Delete without confirmation", - command: "sentry project delete my-org/old-project --yes", + run: "project delete my-org/old-project --yes", }, { description: "Preview the deletion", - command: "sentry project delete my-org/old-project --dry-run", + run: "project delete my-org/old-project --dry-run", }, ], }, diff --git a/packages/cli/src/commands/project/list.ts b/packages/cli/src/commands/project/list.ts index e9e8bc44d..b9c9d0589 100644 --- a/packages/cli/src/commands/project/list.ts +++ b/packages/cli/src/commands/project/list.ts @@ -863,44 +863,44 @@ export const listCommand = buildListCommand("project", { examples: [ { description: "List projects (organization auto-detected)", - command: "sentry project list", + run: "project list", }, { description: "List all projects in an organization", - command: "sentry project list my-org/", + run: "project list my-org/", }, { description: "Several projects in the same organization", - command: "sentry project list my-org/frontend,backend", + run: "project list my-org/frontend,backend", }, { description: "Filter by platform", - command: "sentry project list my-org/ --platform javascript", + run: "project list my-org/ --platform javascript", }, { description: "Only projects whose slug or name matches a glob", - command: "sentry project list 'my-org/web-*'", + run: "project list 'my-org/web-*'", }, { description: "Projects named like 'frontend' (fuzzy when nothing matches exactly)", - command: "sentry project list my-org/frontnd", + run: "project list my-org/frontnd", }, { description: "Find a project across organizations", - command: "sentry project list frontend", + run: "project list frontend", }, { description: "Fetch the next page", - command: "sentry project list my-org/ -c next", + run: "project list my-org/ -c next", }, { description: "Show more results", - command: "sentry project list my-org/ --limit 50", + run: "project list my-org/ --limit 50", }, { description: "Output as JSON", - command: "sentry project list my-org/ --json", + run: "project list my-org/ --json", }, ], }, diff --git a/packages/cli/src/commands/project/view.ts b/packages/cli/src/commands/project/view.ts index c26b756c6..01b39b45d 100644 --- a/packages/cli/src/commands/project/view.ts +++ b/packages/cli/src/commands/project/view.ts @@ -342,19 +342,19 @@ export const viewCommand = buildCommand({ examples: [ { description: "View the auto-detected project", - command: "sentry project view", + run: "project view", }, { description: "View project details", - command: "sentry project view my-org/frontend", + run: "project view my-org/frontend", }, { description: "Open the project in the browser", - command: "sentry project view my-org/frontend -w", + run: "project view my-org/frontend -w", }, { description: "Find a project across organizations", - command: "sentry project view frontend", + run: "project view frontend", }, ], }, diff --git a/packages/cli/src/commands/react-native/gradle.ts b/packages/cli/src/commands/react-native/gradle.ts index bf9017d6c..6e7a7034d 100644 --- a/packages/cli/src/commands/react-native/gradle.ts +++ b/packages/cli/src/commands/react-native/gradle.ts @@ -140,13 +140,11 @@ export const gradleCommand = buildCommand({ { description: "Upload a bundle and sourcemap by debug ID (called by the Gradle plugin)", - command: - "sentry react-native gradle --bundle index.android.bundle --sourcemap index.android.bundle.map", + run: "react-native gradle --bundle index.android.bundle --sourcemap index.android.bundle.map", }, { description: "Also associate with a release and distribution", - command: - "sentry react-native gradle --bundle index.android.bundle --sourcemap index.android.bundle.map --release com.example.app@1.0.0 --dist 1000", + run: "react-native gradle --bundle index.android.bundle --sourcemap index.android.bundle.map --release com.example.app@1.0.0 --dist 1000", }, ], }, diff --git a/packages/cli/src/commands/react-native/xcode.ts b/packages/cli/src/commands/react-native/xcode.ts index 95c26a1cd..c008a9ce9 100644 --- a/packages/cli/src/commands/react-native/xcode.ts +++ b/packages/cli/src/commands/react-native/xcode.ts @@ -442,7 +442,7 @@ export const xcodeCommand = buildCommand({ { description: "Run as the Xcode build phase (usually added automatically to your build script)", - command: "sentry react-native xcode", + run: "react-native xcode", }, ], }, diff --git a/packages/cli/src/commands/release/archive.ts b/packages/cli/src/commands/release/archive.ts index 80f3c74d3..96597788e 100644 --- a/packages/cli/src/commands/release/archive.ts +++ b/packages/cli/src/commands/release/archive.ts @@ -56,15 +56,15 @@ export const archiveCommand = buildCommand({ { description: "Archive a release (hide it from the default list, but keep it)", - command: "sentry release archive 1.0.0", + run: "release archive 1.0.0", }, { description: "Archive a release in an explicit organization", - command: "sentry release archive my-org/1.0.0", + run: "release archive my-org/1.0.0", }, { description: "Preview without archiving", - command: "sentry release archive my-org/1.0.0 --dry-run", + run: "release archive my-org/1.0.0 --dry-run", }, ], }, diff --git a/packages/cli/src/commands/release/create.ts b/packages/cli/src/commands/release/create.ts index fae46f919..82a46d82c 100644 --- a/packages/cli/src/commands/release/create.ts +++ b/packages/cli/src/commands/release/create.ts @@ -64,43 +64,41 @@ export const createCommand = buildCommand({ examples: [ { description: "Create a release", - command: "sentry release create 1.0.0", + run: "release create 1.0.0", }, { description: "Create a release in an explicit organization", - command: "sentry release create my-org/1.0.0", + run: "release create my-org/1.0.0", }, { description: "Create and finalize a release", - command: "sentry release create 1.0.0 --finalize", + run: "release create 1.0.0 --finalize", }, { description: "Create a release for specific projects", - command: "sentry release create 1.0.0 --project proj-a,proj-b", + run: "release create 1.0.0 --project proj-a,proj-b", }, { description: "Typical CI release: create, associate commits, finalize, and record a deploy", - command: [ - "sentry release create my-org/1.0.0 --project my-project", - "sentry release set-commits my-org/1.0.0 --auto", - "sentry release finalize my-org/1.0.0", - "sentry release deploy my-org/1.0.0 production", + run: [ + "release create my-org/1.0.0 --project my-project", + "release set-commits my-org/1.0.0 --auto", + "release finalize my-org/1.0.0", + "release deploy my-org/1.0.0 production", ], }, { description: "Create a release from a proposed version", - command: - 'sentry release create "$(sentry release propose-version --json | jq -r .version)"', + run: 'release create "$(sentry release propose-version --json | jq -r .version)"', }, { description: "Set the release ref and URL", - command: - "sentry release create 1.0.0 --ref main --url https://github.com/org/repo/releases/tag/1.0.0", + run: "release create 1.0.0 --ref main --url https://github.com/org/repo/releases/tag/1.0.0", }, { description: "Preview without creating", - command: "sentry release create 1.0.0 --dry-run", + run: "release create 1.0.0 --dry-run", }, ], }, diff --git a/packages/cli/src/commands/release/delete.ts b/packages/cli/src/commands/release/delete.ts index a10f92bac..2dfdcff3d 100644 --- a/packages/cli/src/commands/release/delete.ts +++ b/packages/cli/src/commands/release/delete.ts @@ -84,15 +84,15 @@ export const deleteCommand = buildDeleteCommand({ examples: [ { description: "Delete a release (prompts for confirmation)", - command: "sentry release delete my-org/1.0.0", + run: "release delete my-org/1.0.0", }, { description: "Skip confirmation", - command: "sentry release delete my-org/1.0.0 --yes", + run: "release delete my-org/1.0.0 --yes", }, { description: "Preview without deleting", - command: "sentry release delete my-org/1.0.0 --dry-run", + run: "release delete my-org/1.0.0 --dry-run", }, ], }, diff --git a/packages/cli/src/commands/release/deploy.ts b/packages/cli/src/commands/release/deploy.ts index 1ce169957..eb6453c8b 100644 --- a/packages/cli/src/commands/release/deploy.ts +++ b/packages/cli/src/commands/release/deploy.ts @@ -89,24 +89,23 @@ export const deployCommand = buildCommand({ examples: [ { description: "Create a deploy", - command: "sentry release deploy 1.0.0 production", + run: "release deploy 1.0.0 production", }, { description: "Create a named deploy in an explicit organization", - command: 'sentry release deploy my-org/1.0.0 staging "Deploy #42"', + run: 'release deploy my-org/1.0.0 staging "Deploy #42"', }, { description: "Attach a deploy URL", - command: - "sentry release deploy 1.0.0 production --url https://example.com", + run: "release deploy 1.0.0 production --url https://example.com", }, { description: "Record a deploy duration in seconds", - command: "sentry release deploy 1.0.0 production --time 120", + run: "release deploy 1.0.0 production --time 120", }, { description: "Preview without creating", - command: "sentry release deploy 1.0.0 production --dry-run", + run: "release deploy 1.0.0 production --dry-run", }, ], }, diff --git a/packages/cli/src/commands/release/deploys.ts b/packages/cli/src/commands/release/deploys.ts index 2384dba4d..dd7c3ff57 100644 --- a/packages/cli/src/commands/release/deploys.ts +++ b/packages/cli/src/commands/release/deploys.ts @@ -40,15 +40,15 @@ export const deploysCommand = buildCommand({ examples: [ { description: "List deploys for a release", - command: "sentry release deploys 1.0.0", + run: "release deploys 1.0.0", }, { description: "List deploys for a release in an explicit organization", - command: "sentry release deploys my-org/1.0.0", + run: "release deploys my-org/1.0.0", }, { description: "Output as JSON", - command: "sentry release deploys 1.0.0 --json", + run: "release deploys 1.0.0 --json", }, ], }, diff --git a/packages/cli/src/commands/release/finalize.ts b/packages/cli/src/commands/release/finalize.ts index ff17361c1..fbdfbf546 100644 --- a/packages/cli/src/commands/release/finalize.ts +++ b/packages/cli/src/commands/release/finalize.ts @@ -54,20 +54,19 @@ export const finalizeCommand = buildCommand({ examples: [ { description: "Finalize a release", - command: "sentry release finalize 1.0.0", + run: "release finalize 1.0.0", }, { description: "Finalize a release in an explicit organization", - command: "sentry release finalize my-org/1.0.0", + run: "release finalize my-org/1.0.0", }, { description: "Set a custom release timestamp", - command: - "sentry release finalize 1.0.0 --released 2025-01-01T00:00:00Z", + run: "release finalize 1.0.0 --released 2025-01-01T00:00:00Z", }, { description: "Preview without finalizing", - command: "sentry release finalize 1.0.0 --dry-run", + run: "release finalize 1.0.0 --dry-run", }, ], }, diff --git a/packages/cli/src/commands/release/list.ts b/packages/cli/src/commands/release/list.ts index 7f30d7016..64b56fba6 100644 --- a/packages/cli/src/commands/release/list.ts +++ b/packages/cli/src/commands/release/list.ts @@ -650,32 +650,32 @@ export const listCommand = buildListCommand("release", { examples: [ { description: "List releases (project auto-detected)", - command: "sentry release list", + run: "release list", }, { description: "List all releases in an organization", - command: "sentry release list my-org/", + run: "release list my-org/", }, { description: "List releases for one project", - command: "sentry release list my-org/my-project", + run: "release list my-org/my-project", }, { description: "Sort by crash-free sessions", - command: "sentry release list --sort cfs", + run: "release list --sort cfs", }, { description: "Filter by environment", - command: "sentry release list --environment production", + run: "release list --environment production", }, { description: "Show the last 7 days of health data", - command: "sentry release list --period 7d", + run: "release list --period 7d", }, - { description: "Output as JSON", command: "sentry release list --json" }, + { description: "Output as JSON", run: "release list --json" }, { description: "Fetch the next page", - command: "sentry release list my-org/ -c next", + run: "release list my-org/ -c next", }, ], }, diff --git a/packages/cli/src/commands/release/propose-version.ts b/packages/cli/src/commands/release/propose-version.ts index 01ac8abc3..a07c4b9f0 100644 --- a/packages/cli/src/commands/release/propose-version.ts +++ b/packages/cli/src/commands/release/propose-version.ts @@ -85,16 +85,15 @@ export const proposeVersionCommand = buildCommand({ examples: [ { description: "Propose a version from git HEAD", - command: "sentry release propose-version", + run: "release propose-version", }, { description: "Output as JSON", - command: "sentry release propose-version --json", + run: "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)"', + run: 'release create "$(sentry release propose-version --json | jq -r .version)"', }, ], }, diff --git a/packages/cli/src/commands/release/restore.ts b/packages/cli/src/commands/release/restore.ts index b11e45d8f..37477f4ab 100644 --- a/packages/cli/src/commands/release/restore.ts +++ b/packages/cli/src/commands/release/restore.ts @@ -53,15 +53,15 @@ export const restoreCommand = buildCommand({ examples: [ { description: "Restore a previously archived release", - command: "sentry release restore 1.0.0", + run: "release restore 1.0.0", }, { description: "Restore a release in an explicit organization", - command: "sentry release restore my-org/1.0.0", + run: "release restore my-org/1.0.0", }, { description: "Preview without restoring", - command: "sentry release restore 1.0.0 --dry-run", + run: "release restore 1.0.0 --dry-run", }, ], }, diff --git a/packages/cli/src/commands/release/set-commits.ts b/packages/cli/src/commands/release/set-commits.ts index 06c084c16..8f1aa7cc5 100644 --- a/packages/cli/src/commands/release/set-commits.ts +++ b/packages/cli/src/commands/release/set-commits.ts @@ -386,33 +386,31 @@ export const setCommitsCommand = buildCommand({ examples: [ { description: "Associate commits using the repository integration", - command: "sentry release set-commits 1.0.0 --auto", + run: "release set-commits 1.0.0 --auto", }, { description: "Set commits from local git history", - command: "sentry release set-commits my-org/1.0.0 --local", + run: "release set-commits my-org/1.0.0 --local", }, { description: "Read up to 50 local commits", - command: "sentry release set-commits 1.0.0 --local --initial-depth 50", + run: "release set-commits 1.0.0 --local --initial-depth 50", }, { description: "Only include commits that touch specific paths", - command: - "sentry release set-commits 1.0.0 --path apps/mobile,packages/shared-ui", + run: "release set-commits 1.0.0 --path apps/mobile,packages/shared-ui", }, { description: "Read local commits since a previous release tag", - command: "sentry release set-commits 1.0.0 --from v0.9.0", + run: "release set-commits 1.0.0 --from v0.9.0", }, { description: "Set an explicit commit range", - command: - "sentry release set-commits 1.0.0 --commit owner/repo@abc123..def456", + run: "release set-commits 1.0.0 --commit owner/repo@abc123..def456", }, { description: "Clear the release's commits", - command: "sentry release set-commits 1.0.0 --clear", + run: "release set-commits 1.0.0 --clear", }, ], }, diff --git a/packages/cli/src/commands/release/view.ts b/packages/cli/src/commands/release/view.ts index 3b46c31e0..b5d0c1a90 100644 --- a/packages/cli/src/commands/release/view.ts +++ b/packages/cli/src/commands/release/view.ts @@ -163,19 +163,19 @@ export const viewCommand = buildCommand({ examples: [ { description: "View release details", - command: "sentry release view 1.0.0", + run: "release view 1.0.0", }, { description: "View a release in an explicit organization", - command: "sentry release view my-org/1.0.0", + run: "release view my-org/1.0.0", }, { description: "View a release whose version contains a package name", - command: 'sentry release view "sentry-cli@0.24.0"', + run: 'release view "sentry-cli@0.24.0"', }, { description: "Output as JSON", - command: "sentry release view 1.0.0 --json", + run: "release view 1.0.0 --json", }, ], }, diff --git a/packages/cli/src/commands/replay/download.ts b/packages/cli/src/commands/replay/download.ts index 1567a3736..afb5223b0 100644 --- a/packages/cli/src/commands/replay/download.ts +++ b/packages/cli/src/commands/replay/download.ts @@ -66,18 +66,15 @@ export const downloadCommand = buildCommand({ { description: "Download a replay as rrweb JSON to ./.rrweb.json", - command: - "sentry replay download my-org/346789a703f6454384f1de473b8b9fcc", + run: "replay download my-org/346789a703f6454384f1de473b8b9fcc", }, { description: "Choose where the file goes", - command: - "sentry replay download my-org/346789a703f6454384f1de473b8b9fcc --output ./replay.json", + run: "replay download my-org/346789a703f6454384f1de473b8b9fcc --output ./replay.json", }, { description: "Download from a replay URL", - command: - "sentry replay download https://sentry.io/organizations/my-org/explore/replays/346789a703f6454384f1de473b8b9fcc/", + run: "replay download https://sentry.io/organizations/my-org/explore/replays/346789a703f6454384f1de473b8b9fcc/", }, ], }, diff --git a/packages/cli/src/commands/replay/list.ts b/packages/cli/src/commands/replay/list.ts index db0cd2388..462498f54 100644 --- a/packages/cli/src/commands/replay/list.ts +++ b/packages/cli/src/commands/replay/list.ts @@ -261,49 +261,47 @@ export const listCommand = buildListCommand("replay", { examples: [ { description: "List recent replays (project auto-detected)", - command: "sentry replay list", + run: "replay list", }, { description: "List recent replays for a project", - command: "sentry replay list my-org/frontend", + run: "replay list my-org/frontend", }, { description: "Search across all projects in an organization", - command: 'sentry replay list my-org/ --query "environment:production"', + run: 'replay list my-org/ --query "environment:production"', }, { description: "Change the time window and sort", - command: - "sentry replay list my-org/frontend --period 24h --sort errors", + run: "replay list my-org/frontend --period 24h --sort errors", }, { description: "Find replays for a user", - command: - 'sentry replay list my-org/frontend -q "user.email:foo@example.com"', + run: 'replay list my-org/frontend -q "user.email:foo@example.com"', }, { description: "Filter by environments", - command: "sentry replay list my-org/frontend -e production -e canary", + run: "replay list my-org/frontend -e production -e canary", }, { description: "Show more results", - command: "sentry replay list my-org/frontend --limit 50", + run: "replay list my-org/frontend --limit 50", }, { description: "Fetch the next page", - command: "sentry replay list my-org/frontend -c next", + run: "replay list my-org/frontend -c next", }, { description: "Fetch the previous page", - command: "sentry replay list my-org/frontend -c prev", + run: "replay list my-org/frontend -c prev", }, { description: "Output as JSON", - command: "sentry replay list my-org/frontend --json", + run: "replay list my-org/frontend --json", }, { description: "Find a project across organizations", - command: "sentry replay list frontend", + run: "replay list frontend", }, ], }, diff --git a/packages/cli/src/commands/replay/view.ts b/packages/cli/src/commands/replay/view.ts index 4bc39a806..993ad9e7b 100644 --- a/packages/cli/src/commands/replay/view.ts +++ b/packages/cli/src/commands/replay/view.ts @@ -324,31 +324,27 @@ export const viewCommand = buildCommand({ { description: "View a replay by ID (organization and project auto-detected)", - command: "sentry replay view 346789a703f6454384f1de473b8b9fcc", + run: "replay view 346789a703f6454384f1de473b8b9fcc", }, { description: "View a replay in an explicit organization", - command: "sentry replay view my-org/346789a703f6454384f1de473b8b9fcc", + run: "replay view my-org/346789a703f6454384f1de473b8b9fcc", }, { description: "View a replay with explicit org/project context", - command: - "sentry replay view my-org/frontend/346789a703f6454384f1de473b8b9fcc", + run: "replay view my-org/frontend/346789a703f6454384f1de473b8b9fcc", }, { description: "View a replay from its URL", - command: - "sentry replay view https://sentry.io/organizations/my-org/explore/replays/346789a703f6454384f1de473b8b9fcc/", + run: "replay view https://sentry.io/organizations/my-org/explore/replays/346789a703f6454384f1de473b8b9fcc/", }, { description: "View the replay linked to a trace", - command: - "sentry replay view my-org/frontend/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + run: "replay view my-org/frontend/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", }, { description: "Open a replay in the browser", - command: - "sentry replay view my-org/346789a703f6454384f1de473b8b9fcc --web", + run: "replay view my-org/346789a703f6454384f1de473b8b9fcc --web", }, ], }, diff --git a/packages/cli/src/commands/repo/list.ts b/packages/cli/src/commands/repo/list.ts index 6b1f9d6aa..f0d87408b 100644 --- a/packages/cli/src/commands/repo/list.ts +++ b/packages/cli/src/commands/repo/list.ts @@ -73,26 +73,26 @@ const docs: OrgListCommandDocs = { examples: [ { description: "List repositories (organization auto-detected)", - command: "sentry repo list", + run: "repo list", }, { description: "List repositories in an organization", - command: "sentry repo list my-org/", + run: "repo list my-org/", }, { description: "Fetch the next page", - command: "sentry repo list my-org/ -c next", + run: "repo list my-org/ -c next", }, { description: "Only repositories whose name matches a glob", - command: "sentry repo list 'my-org/getsentry/*'", + run: "repo list 'my-org/getsentry/*'", }, { description: "Repositories named like 'sentry-python' (fuzzy when nothing matches exactly)", - command: "sentry repo list my-org/sentry-pyhton", + run: "repo list my-org/sentry-pyhton", }, - { description: "Output as JSON", command: "sentry repo list --json" }, + { description: "Output as JSON", run: "repo list --json" }, ], }; diff --git a/packages/cli/src/commands/schema.ts b/packages/cli/src/commands/schema.ts index b723f7c0e..8c9c6a507 100644 --- a/packages/cli/src/commands/schema.ts +++ b/packages/cli/src/commands/schema.ts @@ -449,52 +449,51 @@ export const schemaCommand = buildCommand({ "operations, and endpoint details. Search by API concepts or CLI command paths; " + "discovery results explain matches and related commands. Use with --json for machine-readable output.", examples: [ - { description: "List all API resources", command: "sentry schema" }, + { description: "List all API resources", run: "schema" }, { description: "Browse issue endpoints", - command: "sentry schema issues", + run: "schema issues", }, { description: "Find list operations (there may be multiple candidates)", - command: "sentry schema issues list", + run: "schema issues list", }, { description: "Find APIs used by log listing", - command: "sentry schema log list", + run: "schema log list", }, { description: "Find APIs used by trace listing, including command aliases", - command: "sentry schema trace ls", + run: "schema trace ls", }, { description: "Find APIs used by a command group", - command: "sentry schema alert metrics", + run: "schema alert metrics", }, { description: "Find APIs used by a nested command", - command: "sentry schema alert metrics view", + run: "schema alert metrics view", }, { description: "Look up an endpoint by its exact operation ID", - command: "sentry schema listOrganizationEvents", + run: "schema listOrganizationEvents", }, { description: "Look up an endpoint by HTTP method and path", - command: - 'sentry schema "GET /api/0/organizations/{organization_id_or_slug}/issues/"', + run: 'schema "GET /api/0/organizations/{organization_id_or_slug}/issues/"', }, { description: "Search for monitoring-related endpoints", - command: "sentry schema --search monitor", + run: "schema --search monitor", }, { description: "Browse resources matching a glob", - command: "sentry schema 'monitor*'", + run: "schema 'monitor*'", }, { description: "Flat list of every endpoint", - command: "sentry schema --all", + run: "schema --all", }, ], }, diff --git a/packages/cli/src/commands/snapshots/diff.ts b/packages/cli/src/commands/snapshots/diff.ts index a35b9a2a7..ff8c963b4 100644 --- a/packages/cli/src/commands/snapshots/diff.ts +++ b/packages/cli/src/commands/snapshots/diff.ts @@ -237,17 +237,16 @@ export const diffCommand = buildCommand({ examples: [ { description: "Compare two directories of snapshot images locally", - command: "sentry snapshots diff ./baseline ./head", + run: "snapshots diff ./baseline ./head", }, { description: "Exit non-zero if any images changed, with a custom threshold", - command: - "sentry snapshots diff ./baseline ./head --fail-on-diff --threshold 0.02", + run: "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/", + run: "snapshots diff ./baseline ./head --output ./diffs/", }, ], }, diff --git a/packages/cli/src/commands/snapshots/download.ts b/packages/cli/src/commands/snapshots/download.ts index 9be157ae5..057857ec9 100644 --- a/packages/cli/src/commands/snapshots/download.ts +++ b/packages/cli/src/commands/snapshots/download.ts @@ -164,17 +164,16 @@ export const downloadCommand = buildCommand({ examples: [ { description: "Download a specific baseline snapshot by ID", - command: "sentry snapshots download --snapshot-id 1234567890", + run: "snapshots download --snapshot-id 1234567890", }, { description: "Download the latest baseline for an app, filtered by branch", - command: "sentry snapshots download --app-id my-app --branch main", + run: "snapshots download --app-id my-app --branch main", }, { description: "Extract images to a specific directory", - command: - "sentry snapshots download --app-id my-app --output ./baseline/", + run: "snapshots download --app-id my-app --output ./baseline/", }, ], }, diff --git a/packages/cli/src/commands/snapshots/upload.ts b/packages/cli/src/commands/snapshots/upload.ts index 9591078e1..cb4fc4d17 100644 --- a/packages/cli/src/commands/snapshots/upload.ts +++ b/packages/cli/src/commands/snapshots/upload.ts @@ -340,19 +340,16 @@ export const uploadCommand = buildCommand({ examples: [ { description: "Upload a folder of screenshots as a snapshot for an app", - command: - "sentry snapshots upload ./screenshots --app-id com.example.app", + run: "snapshots upload ./screenshots --app-id com.example.app", }, { description: "Upload only a subset of images (removals/renames not inferred on PRs)", - command: - "sentry snapshots upload ./screenshots --app-id my-app --selective", + run: "snapshots upload ./screenshots --app-id my-app --selective", }, { description: "Only flag images that differ by more than 1%", - command: - "sentry snapshots upload ./screenshots --app-id my-app --diff-threshold 0.01", + run: "snapshots upload ./screenshots --app-id my-app --diff-threshold 0.01", }, ], }, diff --git a/packages/cli/src/commands/sourcemap/inject.ts b/packages/cli/src/commands/sourcemap/inject.ts index 60c7af868..3561de8d7 100644 --- a/packages/cli/src/commands/sourcemap/inject.ts +++ b/packages/cli/src/commands/sourcemap/inject.ts @@ -76,19 +76,19 @@ export const injectCommand = buildCommand({ examples: [ { description: "Inject debug IDs into all JS files in dist/", - command: "sentry sourcemap inject ./dist", + run: "sourcemap inject ./dist", }, { description: "Preview changes without writing", - command: "sentry sourcemap inject ./dist --dry-run", + run: "sourcemap inject ./dist --dry-run", }, { description: "Only process specific extensions", - command: "sentry sourcemap inject ./build --ext .js,.mjs", + run: "sourcemap inject ./build --ext .js,.mjs", }, { description: "Allow a directory with no sourcemaps", - command: "sentry sourcemap inject ./maybe-empty --allow-empty", + run: "sourcemap inject ./maybe-empty --allow-empty", }, ], }, diff --git a/packages/cli/src/commands/sourcemap/resolve.ts b/packages/cli/src/commands/sourcemap/resolve.ts index 43219be0d..22ececb2d 100644 --- a/packages/cli/src/commands/sourcemap/resolve.ts +++ b/packages/cli/src/commands/sourcemap/resolve.ts @@ -123,15 +123,15 @@ export const resolveCommand = buildCommand({ { description: "Report how each JS file's sourcemap resolves and whether a debug ID is injected", - command: "sentry sourcemap resolve ./dist", + run: "sourcemap resolve ./dist", }, { description: "Output as JSON", - command: "sentry sourcemap resolve ./dist --json", + run: "sourcemap resolve ./dist --json", }, { description: "Only scan some extensions", - command: "sentry sourcemap resolve ./build --ext .js,.mjs", + run: "sourcemap resolve ./build --ext .js,.mjs", }, ], }, diff --git a/packages/cli/src/commands/sourcemap/upload.ts b/packages/cli/src/commands/sourcemap/upload.ts index e65228fc0..ffac92771 100644 --- a/packages/cli/src/commands/sourcemap/upload.ts +++ b/packages/cli/src/commands/sourcemap/upload.ts @@ -227,35 +227,35 @@ export const uploadCommand = buildCommand({ examples: [ { description: "Upload sourcemaps from dist/", - command: "sentry sourcemap upload ./dist", + run: "sourcemap upload ./dist", }, { description: "Upload only the files a glob matches", - command: "sentry sourcemap upload '.next/static/**'", + run: "sourcemap upload '.next/static/**'", }, { description: "Associate with a release", - command: "sentry sourcemap upload ./dist --release 1.0.0", + run: "sourcemap upload ./dist --release 1.0.0", }, { description: "Set a custom URL prefix", - command: "sentry sourcemap upload ./dist --url-prefix '~/static/js/'", + run: "sourcemap upload ./dist --url-prefix '~/static/js/'", }, { description: "Don't fail when no sourcemaps are found", - command: "sentry sourcemap upload ./dist --allow-empty", + run: "sourcemap upload ./dist --allow-empty", }, { description: "Set a release and distribution", - command: "sentry sourcemap upload ./dist --release 1.0.0 --dist 12345", + run: "sourcemap upload ./dist --release 1.0.0 --dist 12345", }, { description: "Upload without rewriting sourcemaps", - command: "sentry sourcemap upload ./dist --no-rewrite", + run: "sourcemap upload ./dist --no-rewrite", }, { description: "Only upload some extensions", - command: "sentry sourcemap upload ./dist --ext .js,.mjs", + run: "sourcemap upload ./dist --ext .js,.mjs", }, ], }, diff --git a/packages/cli/src/commands/span/list.ts b/packages/cli/src/commands/span/list.ts index 14de6173b..e355c3d79 100644 --- a/packages/cli/src/commands/span/list.ts +++ b/packages/cli/src/commands/span/list.ts @@ -614,49 +614,47 @@ export const listCommand = buildListCommand("span", { examples: [ { description: "List recent spans in the current project", - command: "sentry span list", + run: "span list", }, { description: "Find all DB spans", - command: 'sentry span list -q "op:db"', + run: 'span list -q "op:db"', }, { description: "Slow spans in the last 24 hours", - command: 'sentry span list -q "duration:>100ms" --period 24h', + run: 'span list -q "duration:>100ms" --period 24h', }, { description: "Sort by slowest first", - command: "sentry span list --sort duration", + run: "span list --sort duration", }, { description: "List spans within a specific trace", - command: "sentry span list abc123def456abc123def456abc12345", + run: "span list abc123def456abc123def456abc12345", }, { description: "Show only spans from one project within a trace", - command: - "sentry span list my-org/cli-server/abc123def456abc123def456abc12345", + run: "span list my-org/cli-server/abc123def456abc123def456abc12345", }, { description: "Filter a trace's spans to several projects", - command: - 'sentry span list abc123def456abc123def456abc12345 -q "project:[cli-server,api]"', + run: 'span list abc123def456abc123def456abc12345 -q "project:[cli-server,api]"', }, { description: "Fetch the next page", - command: "sentry span list -c next", + run: "span list -c next", }, { description: "List spans in an explicit project", - command: "sentry span list my-org/cli-server", + run: "span list my-org/cli-server", }, { description: "Find a project across organizations, then list a trace", - command: "sentry span list cli-server abc123def456abc123def456abc12345", + run: "span list cli-server abc123def456abc123def456abc12345", }, { description: "Fetch the next page of a trace", - command: "sentry span list abc123def456abc123def456abc12345 -c next", + run: "span list abc123def456abc123def456abc12345 -c next", }, ], }, diff --git a/packages/cli/src/commands/span/view.ts b/packages/cli/src/commands/span/view.ts index 712621950..e47c86979 100644 --- a/packages/cli/src/commands/span/view.ts +++ b/packages/cli/src/commands/span/view.ts @@ -358,18 +358,15 @@ export const viewCommand = buildCommand({ examples: [ { description: "View a single span", - command: - "sentry span view abc123def456abc123def456abc12345 a1b2c3d4e5f67890", + run: "span view abc123def456abc123def456abc12345 a1b2c3d4e5f67890", }, { description: "View multiple spans at once", - command: - "sentry span view abc123def456abc123def456abc12345 a1b2c3d4e5f67890 b2c3d4e5f6789012", + run: "span view abc123def456abc123def456abc12345 a1b2c3d4e5f67890 b2c3d4e5f6789012", }, { description: "Specify the organization and project explicitly", - command: - "sentry span view my-org/backend/abc123def456abc123def456abc12345 a1b2c3d4e5f67890", + run: "span view my-org/backend/abc123def456abc123def456abc12345 a1b2c3d4e5f67890", }, ], }, diff --git a/packages/cli/src/commands/status/show.ts b/packages/cli/src/commands/status/show.ts index 00a766ba6..b0e6acaff 100644 --- a/packages/cli/src/commands/status/show.ts +++ b/packages/cli/src/commands/status/show.ts @@ -37,16 +37,16 @@ export const showCommand = buildCommand({ examples: [ { description: "Show the current status of Sentry's services", - command: "sentry status", + run: "status", }, { description: "Get machine-readable status (useful in scripts)", - command: "sentry status --json", + run: "status --json", }, { description: "Check a self-hosted or regional status page (Statuspage CNAME)", - command: "sentry status --url https://status.acme.com", + run: "status --url https://status.acme.com", }, ], }, diff --git a/packages/cli/src/commands/team/list.ts b/packages/cli/src/commands/team/list.ts index 7fed0a829..44b5c7628 100644 --- a/packages/cli/src/commands/team/list.ts +++ b/packages/cli/src/commands/team/list.ts @@ -72,26 +72,26 @@ const docs: OrgListCommandDocs = { examples: [ { description: "List teams (organization auto-detected)", - command: "sentry team list", + run: "team list", }, { description: "List teams in an organization", - command: "sentry team list my-org/", + run: "team list my-org/", }, { description: "Fetch the next page", - command: "sentry team list my-org/ -c next", + run: "team list my-org/ -c next", }, { description: "Only teams whose slug or name matches a glob", - command: "sentry team list 'my-org/back*'", + run: "team list 'my-org/back*'", }, { description: "Teams named like 'backend' when no such project exists (fuzzy)", - command: "sentry team list my-org/backnd", + run: "team list my-org/backnd", }, - { description: "Output as JSON", command: "sentry team list --json" }, + { description: "Output as JSON", run: "team list --json" }, ], }; diff --git a/packages/cli/src/commands/token/create.ts b/packages/cli/src/commands/token/create.ts index b2312fabd..eb95bb325 100644 --- a/packages/cli/src/commands/token/create.ts +++ b/packages/cli/src/commands/token/create.ts @@ -81,15 +81,15 @@ export const createCommand = buildCommand({ examples: [ { description: "Create a token (auto-detect org)", - command: "sentry token create github-actions", + run: "token create github-actions", }, { description: "Create a token in a specific org", - command: "sentry token create my-org/github-actions", + run: "token create my-org/github-actions", }, { description: "Output as JSON, including the token value", - command: "sentry token create my-org/github-actions --json", + run: "token create my-org/github-actions --json", }, ], }, diff --git a/packages/cli/src/commands/token/delete.ts b/packages/cli/src/commands/token/delete.ts index 161fd2f14..005f2996d 100644 --- a/packages/cli/src/commands/token/delete.ts +++ b/packages/cli/src/commands/token/delete.ts @@ -201,19 +201,19 @@ export const deleteCommand = buildDeleteCommand({ examples: [ { description: "Revoke token ID 12345 (auto-detect org)", - command: "sentry token delete 12345", + run: "token delete 12345", }, { description: "Revoke the token named github-actions", - command: "sentry token delete my-org/github-actions", + run: "token delete my-org/github-actions", }, { description: "Preview revoking token ID 12345", - command: "sentry token delete my-org/12345 --dry-run", + run: "token delete my-org/12345 --dry-run", }, { description: "Revoke without the confirmation prompt", - command: "sentry token delete my-org/12345 --yes", + run: "token delete my-org/12345 --yes", }, ], }, diff --git a/packages/cli/src/commands/token/list.ts b/packages/cli/src/commands/token/list.ts index edbf56036..861612393 100644 --- a/packages/cli/src/commands/token/list.ts +++ b/packages/cli/src/commands/token/list.ts @@ -63,13 +63,13 @@ export const listCommand = buildCommand({ examples: [ { description: "List tokens (auto-detect org)", - command: "sentry token list", + run: "token list", }, { description: "List tokens in a specific org", - command: "sentry token list my-org", + run: "token list my-org", }, - { description: "Output as JSON", command: "sentry token list --json" }, + { description: "Output as JSON", run: "token list --json" }, ], }, output: { diff --git a/packages/cli/src/commands/trace/list.ts b/packages/cli/src/commands/trace/list.ts index 26cd31725..8e23f6293 100644 --- a/packages/cli/src/commands/trace/list.ts +++ b/packages/cli/src/commands/trace/list.ts @@ -202,27 +202,26 @@ export const listCommand = buildListCommand("trace", { `${TARGET_PATTERN_NOTE}\n\n` + "Alias: `sentry traces` → `sentry trace list`", examples: [ - { description: "List recent traces", command: "sentry trace list" }, + { description: "List recent traces", run: "trace list" }, { description: "Show more traces", - command: "sentry trace list --limit 50", + run: "trace list --limit 50", }, { description: "Sort by slowest first", - command: "sentry trace list --sort duration", + run: "trace list --sort duration", }, { description: "Filter by transaction name in the last 24 hours", - command: - 'sentry trace list -q "transaction:GET /api/users" --period 24h', + run: 'trace list -q "transaction:GET /api/users" --period 24h', }, { description: "Fetch the next page", - command: "sentry trace list my-org/backend -c next", + run: "trace list my-org/backend -c next", }, { description: "Find a project across organizations", - command: "sentry trace list backend", + run: "trace list backend", }, ], }, diff --git a/packages/cli/src/commands/trace/logs.ts b/packages/cli/src/commands/trace/logs.ts index e3506cabe..cca055749 100644 --- a/packages/cli/src/commands/trace/logs.ts +++ b/packages/cli/src/commands/trace/logs.ts @@ -153,35 +153,31 @@ export const logsCommand = buildCommand({ examples: [ { description: "View logs for a trace", - command: "sentry trace logs abc123def456abc123def456abc12345", + run: "trace logs abc123def456abc123def456abc12345", }, { description: "Filter trace logs to one project", - command: - "sentry trace logs my-org/cli-server/abc123def456abc123def456abc12345", + run: "trace logs my-org/cli-server/abc123def456abc123def456abc12345", }, { description: "Filter trace logs to several projects", - command: - 'sentry trace logs abc123def456abc123def456abc12345 -q "project:[cli-server,api]"', + run: 'trace logs abc123def456abc123def456abc12345 -q "project:[cli-server,api]"', }, { description: "Search with a longer time window", - command: - "sentry trace logs --period 30d abc123def456abc123def456abc12345", + run: "trace logs --period 30d abc123def456abc123def456abc12345", }, { description: "Only error logs", - command: - "sentry trace logs -q 'severity:error' abc123def456abc123def456abc12345", + run: "trace logs -q 'severity:error' abc123def456abc123def456abc12345", }, { description: "Output as JSON", - command: "sentry trace logs --json abc123def456abc123def456abc12345", + run: "trace logs --json abc123def456abc123def456abc12345", }, { description: "Logs for a trace in an explicit organization", - command: "sentry trace logs my-org/abc123def456abc123def456abc12345", + run: "trace logs my-org/abc123def456abc123def456abc12345", }, ], }, diff --git a/packages/cli/src/commands/trace/view.ts b/packages/cli/src/commands/trace/view.ts index d886b21d2..d02b4e4e0 100644 --- a/packages/cli/src/commands/trace/view.ts +++ b/packages/cli/src/commands/trace/view.ts @@ -477,51 +477,45 @@ export const viewCommand = buildCommand({ examples: [ { description: "View trace details with the span tree", - command: "sentry trace view abc123def456abc123def456abc12345", + run: "trace view abc123def456abc123def456abc12345", }, { description: "Show the full trace across all projects", - command: "sentry trace view my-org/abc123def456abc123def456abc12345", + run: "trace view my-org/abc123def456abc123def456abc12345", }, { description: "Filter the span tree to one project", - command: - "sentry trace view my-org/cli-server/abc123def456abc123def456abc12345", + run: "trace view my-org/cli-server/abc123def456abc123def456abc12345", }, { description: "Recover the trace from an issue short ID", - command: "sentry trace view PROJ-123", + run: "trace view PROJ-123", }, { description: "Open the trace in the browser", - command: "sentry trace view abc123def456abc123def456abc12345 -w", + run: "trace view abc123def456abc123def456abc12345 -w", }, { description: "Find a project across organizations", - command: - "sentry trace view cli-server abc123def456abc123def456abc12345", + run: "trace view cli-server abc123def456abc123def456abc12345", }, { description: "Select the trace ID and an attribute across the whole span tree", - command: - "sentry trace view abc123def456abc123def456abc12345 --json --fields traceId,http.method", + run: "trace view abc123def456abc123def456abc12345 --json --fields traceId,http.method", }, { description: "Keep full spans while requesting an additional attribute", - command: - "sentry trace view abc123def456abc123def456abc12345 --json --fields spans,http.method", + run: "trace view abc123def456abc123def456abc12345 --json --fields spans,http.method", }, { description: "Select IDs and detail attributes from root spans only", - command: - "sentry trace view abc123def456abc123def456abc12345 --json --fields spans.span_id,spans.data.http.method", + run: "trace view abc123def456abc123def456abc12345 --json --fields spans.span_id,spans.data.http.method", }, { description: "Select an additional attribute from immediate child spans", - command: - "sentry trace view abc123def456abc123def456abc12345 --json --fields spans.children.additional_attributes.http.method", + run: "trace view abc123def456abc123def456abc12345 --json --fields spans.children.additional_attributes.http.method", }, ], }, diff --git a/packages/cli/src/commands/trial/list.ts b/packages/cli/src/commands/trial/list.ts index 10b1e6b65..d6df14196 100644 --- a/packages/cli/src/commands/trial/list.ts +++ b/packages/cli/src/commands/trial/list.ts @@ -185,13 +185,13 @@ export const listCommand = buildCommand({ examples: [ { description: "List all trials for the current organization", - command: "sentry trial list", + run: "trial list", }, { description: "List trials for a specific organization", - command: "sentry trial list my-org", + run: "trial list my-org", }, - { description: "Output as JSON", command: "sentry trial list --json" }, + { description: "Output as JSON", run: "trial list --json" }, ], }, output: { diff --git a/packages/cli/src/commands/trial/start.ts b/packages/cli/src/commands/trial/start.ts index fb1fdcbd0..a6287b960 100644 --- a/packages/cli/src/commands/trial/start.ts +++ b/packages/cli/src/commands/trial/start.ts @@ -162,18 +162,18 @@ export const startCommand = buildCommand({ `Valid trial names: ${NAMES_LIST}\n\n` + "Use 'plan' to start a Business plan trial (opens billing page).", examples: [ - { description: "Start a Seer trial", command: "sentry trial start seer" }, + { description: "Start a Seer trial", run: "trial start seer" }, { description: "Start a trial for a specific organization", - command: "sentry trial start replays my-org", + run: "trial start replays my-org", }, { description: "Start a Business plan trial (opens the browser)", - command: "sentry trial start plan", + run: "trial start plan", }, { description: "Output the result as JSON", - command: "sentry trial start --json seer", + run: "trial start --json seer", }, ], }, diff --git a/packages/cli/src/commands/wasm-split.ts b/packages/cli/src/commands/wasm-split.ts index 7fe272aa9..78a2927cc 100644 --- a/packages/cli/src/commands/wasm-split.ts +++ b/packages/cli/src/commands/wasm-split.ts @@ -74,27 +74,28 @@ export const wasmSplitCommand = buildCommand({ examples: [ { description: "Add a build ID to a module in place and print it", - command: "sentry wasm-split app.wasm", + run: "wasm-split app.wasm", }, { description: "Capture the build ID for a later upload", - command: "BUILD_ID=$(sentry wasm-split app.wasm)", + run: { + prefix: "BUILD_ID=$(", + args: "wasm-split app.wasm", + suffix: ")", + }, }, { description: "Split debug data into a companion and ship a stripped binary", - command: - "sentry wasm-split app.wasm --debug-out app.debug.wasm --strip", + run: "wasm-split app.wasm --debug-out app.debug.wasm --strip", }, { description: "Also drop function names from the shipped binary", - command: - "sentry wasm-split app.wasm -d app.debug.wasm --strip --strip-names", + run: "wasm-split app.wasm -d app.debug.wasm --strip --strip-names", }, { description: "Point browsers at a companion served from a CDN", - command: - "sentry wasm-split app.wasm -o dist/app.wasm -d dist/app.debug.wasm --strip --external-dwarf-url https://cdn.example.com/debug/app.debug.wasm", + run: "wasm-split app.wasm -o dist/app.wasm -d dist/app.debug.wasm --strip --external-dwarf-url https://cdn.example.com/debug/app.debug.wasm", }, ], }, diff --git a/packages/cli/src/lib/command-example.ts b/packages/cli/src/lib/command-example.ts index 52eba0b66..14b2abf02 100644 --- a/packages/cli/src/lib/command-example.ts +++ b/packages/cli/src/lib/command-example.ts @@ -3,22 +3,48 @@ * doc generators. Kept dependency-free so scripts can import it cheaply. */ +/** + * One invocation in an example, written without the program name: + * `issue list my-org/frontend`. Each renderer adds the program: `--help` + * names the running one, generated docs and skills name `sentry`. + * + * A step that runs inside other shell text keeps that text around the + * invocation, as `{ prefix: "sudo ", args: "cli fix" }`. + */ +export type ExampleStep = + | string + | { + readonly prefix?: string; + readonly args: string; + readonly suffix?: string; + }; + /** * A runnable example stored with its command for generated documentation. * - * `command` is one invocation, or the ordered steps of a workflow that spans + * `run` is one invocation, or the ordered steps of a workflow that spans * several commands (e.g. create → set-commits → finalize). Every step is * checked against the route tree by `check:doc-examples`, so workflows belong * here rather than in hand-written fragment code blocks. */ export type CommandExample = { readonly description: string; - readonly command: string | readonly string[]; + readonly run: ExampleStep | readonly ExampleStep[]; }; -/** The invocations of an example, one per step. */ -export function exampleSteps(example: CommandExample): readonly string[] { - return typeof example.command === "string" - ? [example.command] - : example.command; +function isStepList(run: CommandExample["run"]): run is readonly ExampleStep[] { + return Array.isArray(run); +} + +/** The invocations of an example, one per step, run as `program`. */ +export function exampleSteps( + example: CommandExample, + program: string, +): readonly string[] { + const steps = isStepList(example.run) ? example.run : [example.run]; + return steps.map((step) => + typeof step === "string" + ? `${program} ${step}` + : `${step.prefix ?? ""}${program} ${step.args}${step.suffix ?? ""}`, + ); } diff --git a/packages/cli/src/lib/command.ts b/packages/cli/src/lib/command.ts index 5b76ddb73..047fed786 100644 --- a/packages/cli/src/lib/command.ts +++ b/packages/cli/src/lib/command.ts @@ -463,20 +463,6 @@ function enrichDocsWithSchema( }; } -/** - * An example step as the running program would run it. Examples are help - * metadata written for the `sentry` binary, shared with the generated docs - * and skill references, so only `--help` swaps the leading program name. - */ -function exampleForRunningProgram(step: string): string { - return step.startsWith(EXAMPLE_PROGRAM) - ? `${getInvocationCommand()} ${step.slice(EXAMPLE_PROGRAM.length)}` - : step; -} - -/** The program name that starts a `docs.examples` step. */ -const EXAMPLE_PROGRAM = "sentry "; - /** Render command-owned examples in native help without exposing custom fields to Stricli. */ function prepareNativeDocs( docs: CommandDocumentation, @@ -487,7 +473,7 @@ function prepareNativeDocs( } const rendered = examples .map((example) => { - const steps = exampleSteps(example).map(exampleForRunningProgram); + const steps = exampleSteps(example, getInvocationCommand()); return steps.length === 1 ? ` ${steps[0]} # ${example.description}` : [` # ${example.description}`, ...steps.map((s) => ` ${s}`)].join( diff --git a/packages/cli/src/lib/introspect.ts b/packages/cli/src/lib/introspect.ts index 6ac31b720..10a8f9f57 100644 --- a/packages/cli/src/lib/introspect.ts +++ b/packages/cli/src/lib/introspect.ts @@ -324,7 +324,7 @@ export function buildCommandInfo(cmd: Command, path: string): CommandInfo { aliases: cmd.parameters.aliases ?? {}, examples: (cmd.__examples ?? []).map( (example) => - `# ${example.description}\n${exampleSteps(example).join("\n")}`, + `# ${example.description}\n${exampleSteps(example, "sentry").join("\n")}`, ), jsonFields: cmd.__jsonFields?.length ? [...cmd.__jsonFields] : undefined, ...(cmd.__destructive ? { destructive: true as const } : {}), diff --git a/packages/cli/test/lib/command-examples.test.ts b/packages/cli/test/lib/command-examples.test.ts new file mode 100644 index 000000000..756c43497 --- /dev/null +++ b/packages/cli/test/lib/command-examples.test.ts @@ -0,0 +1,67 @@ +/** + * `--help` examples name the running program; generated docs name `sentry`. + */ + +import { afterEach, describe, expect, test } from "vitest"; +import { setAppIdentity } from "../../src/lib/app-identity.js"; +import { buildCommand } from "../../src/lib/command.js"; +import { exampleSteps } from "../../src/lib/command-example.js"; +import { useEnvSandbox } from "../helpers.js"; + +useEnvSandbox(["npm_command"]); + +afterEach(() => { + setAppIdentity({ name: "sentry", packageName: "sentry" }); +}); + +const examples = [ + { description: "List issues", run: "issue list my-org/frontend" }, + { + description: "Create, then finalize", + run: ["release create 1.0", "release finalize 1.0"], + }, + { description: "Fix permissions", run: { prefix: "sudo ", args: "cli fix" } }, +]; + +/** The help text `buildCommand` renders for the examples above. */ +function helpText(): string { + const command = buildCommand({ + auth: false, + docs: { brief: "Test command", examples }, + parameters: {}, + async *func() { + yield null; + }, + }); + return (command as unknown as { fullDescription: string }).fullDescription; +} + +describe("command examples", () => { + test("docs and skills name the sentry binary", () => { + expect(examples.flatMap((e) => exampleSteps(e, "sentry"))).toEqual([ + "sentry issue list my-org/frontend", + "sentry release create 1.0", + "sentry release finalize 1.0", + "sudo sentry cli fix", + ]); + }); + + test("--help names @sentry/mcp-server's binary", () => { + setAppIdentity({ name: "sentry-mcp", packageName: "@sentry/mcp-server" }); + const help = helpText(); + expect(help).toContain( + " sentry-mcp issue list my-org/frontend # List issues", + ); + expect(help).toContain(" sentry-mcp release finalize 1.0"); + expect(help).toContain(" sudo sentry-mcp cli fix # Fix permissions"); + expect(help).not.toContain(" sentry "); + }); + + test("--help goes through npx when npx launched the process", () => { + setAppIdentity({ name: "sentry-mcp", packageName: "@sentry/mcp-server" }); + process.env.npm_command = "exec"; + expect(helpText()).toContain( + " npx -y @sentry/mcp-server issue list my-org/frontend # List issues", + ); + }); +}); diff --git a/packages/cli/test/lib/introspect.test.ts b/packages/cli/test/lib/introspect.test.ts index 7bc76e56d..3a484f294 100644 --- a/packages/cli/test/lib/introspect.test.ts +++ b/packages/cli/test/lib/introspect.test.ts @@ -260,7 +260,7 @@ describe("buildCommandInfo", () => { __examples: [ { description: "List things in an org", - command: "sentry thing list myorg", + run: "thing list myorg", }, ], parameters: { @@ -298,7 +298,7 @@ describe("buildCommandInfo", () => { __examples: [ { description: "Create, then finalize", - command: ["sentry thing create a", "sentry thing finalize a"], + run: ["thing create a", "thing finalize a"], }, ], }); diff --git a/scripts/cli-lint-rules.test.mjs b/scripts/cli-lint-rules.test.mjs index 75c9ed213..3c1673480 100644 --- a/scripts/cli-lint-rules.test.mjs +++ b/scripts/cli-lint-rules.test.mjs @@ -414,7 +414,7 @@ tester.run( valid: [ { filename: commands, - code: "buildCommand({ docs: { fullDescription: 'Lists items.', examples: [{ description: 'List', command: 'sentry list' }] } });", + code: "buildCommand({ docs: { fullDescription: 'Lists items.', examples: [{ description: 'List', run: 'list' }] } });", }, { filename: commands, @@ -570,7 +570,7 @@ tester.run( }, { filename: commands, - code: "buildCommand({ docs: { fullDescription: 'Run `sentry auth status` to check.', examples: [{ command: 'sentry auth login' }] } });", + code: "buildCommand({ docs: { fullDescription: 'Run `sentry auth status` to check.', examples: [{ run: 'auth login' }, { run: ['auth login', { prefix: 'sudo ', args: 'cli fix' }] }] } });", }, { filename: source, @@ -583,7 +583,7 @@ tester.run( }, { filename: commands, - code: "const docs = { examples: [{ command: 'sentry issue list' }] };", + code: "const docs = { examples: [{ run: 'issue list' }] };", }, ], invalid: [ @@ -631,6 +631,17 @@ tester.run( code: "const USAGE_HINT = 'sentry issue list /';", errors: 1, }, + // Example steps leave out the program name; each renderer adds it. + { + filename: commands, + code: "buildCommand({ docs: { examples: [{ run: 'sentry issue list' }] } });", + errors: 1, + }, + { + filename: commands, + code: "buildCommand({ docs: { examples: [{ run: ['issue list', { prefix: 'sudo ', args: 'sentry cli fix' }] }] } });", + errors: 1, + }, // The tag adds the program name itself. { filename: source,