From 37b56edf405c2edb78192c91c45657d84f05b895 Mon Sep 17 00:00:00 2001 From: betegon Date: Sun, 1 Feb 2026 00:23:06 +0100 Subject: [PATCH 1/4] feat(feedback): add command to submit CLI feedback Users can now send feedback about the CLI with: sentry feedback The message is sent via Sentry.captureFeedback() to the CLI's own Sentry project for collection. Closes #119 --- src/app.ts | 2 ++ src/commands/feedback.ts | 52 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 src/commands/feedback.ts diff --git a/src/app.ts b/src/app.ts index 6bd99870..f2360e17 100644 --- a/src/app.ts +++ b/src/app.ts @@ -9,6 +9,7 @@ import { import { apiCommand } from "./commands/api.js"; import { authRoute } from "./commands/auth/index.js"; import { eventRoute } from "./commands/event/index.js"; +import { feedbackCommand } from "./commands/feedback.js"; import { helpCommand } from "./commands/help.js"; import { issueRoute } from "./commands/issue/index.js"; import { orgRoute } from "./commands/org/index.js"; @@ -27,6 +28,7 @@ export const routes = buildRouteMap({ issue: issueRoute, event: eventRoute, api: apiCommand, + feedback: feedbackCommand, }, defaultCommand: "help", docs: { diff --git a/src/commands/feedback.ts b/src/commands/feedback.ts new file mode 100644 index 00000000..dd79ea94 --- /dev/null +++ b/src/commands/feedback.ts @@ -0,0 +1,52 @@ +/** + * Feedback Command + * + * Allows users to submit feedback about the CLI. + * All arguments after 'feedback' are joined into a single message. + * + * @example sentry feedback i love this tool + * @example sentry feedback the issue view is confusing + */ + +// biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import +import * as Sentry from "@sentry/bun"; +import { buildCommand } from "@stricli/core"; +import type { SentryContext } from "../context.js"; + +export const feedbackCommand = buildCommand({ + docs: { + brief: "Send feedback about the CLI", + fullDescription: + "Submit feedback about your experience with the Sentry CLI. " + + "All text after 'feedback' is sent as your message.", + }, + parameters: { + flags: {}, + positional: { + kind: "array", + parameter: { + brief: "Your feedback message", + parse: String, + placeholder: "message", + }, + }, + }, + // biome-ignore lint/complexity/noBannedTypes: Stricli requires empty object for commands with no flags + async func(this: SentryContext, _flags: {}, ...messageParts: string[]) { + const { stdout, stderr } = this; + const message = messageParts.join(" "); + + if (!message.trim()) { + stderr.write("Please provide a feedback message.\n"); + stderr.write("Usage: sentry feedback \n"); + return; + } + + Sentry.captureFeedback({ message }); + + // Flush to ensure feedback is sent before process exits + await Sentry.flush(3000); + + stdout.write("Feedback submitted. Thank you!\n"); + }, +}); From 581d6a4417092f642fb880633e9f890bb3eb4379 Mon Sep 17 00:00:00 2001 From: betegon Date: Sun, 1 Feb 2026 18:40:25 +0100 Subject: [PATCH 2/4] fix(feedback): improve error handling and edge cases - Throw ValidationError for empty message (proper exit code) - Check Sentry.isEnabled() before sending feedback - Check flush() return value to report send failures --- src/commands/feedback.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/commands/feedback.ts b/src/commands/feedback.ts index dd79ea94..64c93fd1 100644 --- a/src/commands/feedback.ts +++ b/src/commands/feedback.ts @@ -12,6 +12,7 @@ import * as Sentry from "@sentry/bun"; import { buildCommand } from "@stricli/core"; import type { SentryContext } from "../context.js"; +import { ValidationError } from "../lib/errors.js"; export const feedbackCommand = buildCommand({ docs: { @@ -37,16 +38,24 @@ export const feedbackCommand = buildCommand({ const message = messageParts.join(" "); if (!message.trim()) { - stderr.write("Please provide a feedback message.\n"); - stderr.write("Usage: sentry feedback \n"); + throw new ValidationError("Please provide a feedback message."); + } + + if (!Sentry.isEnabled()) { + stderr.write("Feedback not sent: telemetry is disabled.\n"); + stderr.write("Unset SENTRY_CLI_NO_TELEMETRY to enable feedback.\n"); return; } Sentry.captureFeedback({ message }); // Flush to ensure feedback is sent before process exits - await Sentry.flush(3000); + const sent = await Sentry.flush(3000); - stdout.write("Feedback submitted. Thank you!\n"); + if (sent) { + stdout.write("Feedback submitted. Thank you!\n"); + } else { + stderr.write("Feedback may not have been sent (network timeout).\n"); + } }, }); From 21179195fdc10bacb1a271b9b74c6e3498b25e7a Mon Sep 17 00:00:00 2001 From: betegon Date: Sun, 1 Feb 2026 18:43:15 +0100 Subject: [PATCH 3/4] docs: add feedback command documentation --- docs/src/content/docs/commands/feedback.md | 41 ++++++++++++++++++++++ docs/src/content/docs/commands/index.md | 1 + 2 files changed, 42 insertions(+) create mode 100644 docs/src/content/docs/commands/feedback.md diff --git a/docs/src/content/docs/commands/feedback.md b/docs/src/content/docs/commands/feedback.md new file mode 100644 index 00000000..34488887 --- /dev/null +++ b/docs/src/content/docs/commands/feedback.md @@ -0,0 +1,41 @@ +--- +title: feedback +description: Send feedback about the Sentry CLI +--- + +Send feedback about your experience with the CLI. + +## Commands + +### `sentry feedback` + +Submit feedback about the CLI directly to the Sentry team. + +```bash +sentry feedback +``` + +**Arguments:** + +| Argument | Description | +|----------|-------------| +| `` | Your feedback message (all words after `feedback` are joined) | + +## Examples + +```bash +# Send positive feedback +sentry feedback i love this tool + +# Report an issue +sentry feedback the issue view is confusing + +# Suggest an improvement +sentry feedback would be great to have a search command +``` + +## Notes + +- Feedback is sent via Sentry's telemetry system +- If telemetry is disabled (`SENTRY_CLI_NO_TELEMETRY=1`), feedback cannot be sent +- All feedback is anonymous and used to improve the CLI diff --git a/docs/src/content/docs/commands/index.md b/docs/src/content/docs/commands/index.md index b5c1bfd3..cbb6182b 100644 --- a/docs/src/content/docs/commands/index.md +++ b/docs/src/content/docs/commands/index.md @@ -15,6 +15,7 @@ The Sentry CLI provides commands for interacting with various Sentry resources. | [`issue`](./issue/) | Issue tracking | | [`event`](./event/) | Event inspection | | [`api`](./api/) | Direct API access | +| [`feedback`](./feedback/) | Send feedback about the CLI | ## Global Options From f4dab5686a4dc0a31e368b9e7dd72d89227e20ac Mon Sep 17 00:00:00 2001 From: betegon Date: Sun, 1 Feb 2026 19:00:25 +0100 Subject: [PATCH 4/4] chore: regenerate SKILL.md --- plugins/sentry-cli/skills/sentry-cli/SKILL.md | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/plugins/sentry-cli/skills/sentry-cli/SKILL.md b/plugins/sentry-cli/skills/sentry-cli/SKILL.md index 363cbc46..0633a528 100644 --- a/plugins/sentry-cli/skills/sentry-cli/SKILL.md +++ b/plugins/sentry-cli/skills/sentry-cli/SKILL.md @@ -376,6 +376,29 @@ Update the Sentry CLI to the latest version - `--check - Check for updates without installing` - `--method - Installation method to use (curl, npm, pnpm, bun, yarn)` +### Feedback + +Send feedback about the CLI + +#### `sentry feedback ` + +Send feedback about the CLI + +**Examples:** + +```bash +sentry feedback + +# Send positive feedback +sentry feedback i love this tool + +# Report an issue +sentry feedback the issue view is confusing + +# Suggest an improvement +sentry feedback would be great to have a search command +``` + ## Output Formats ### JSON Output