Skip to content

Commit 7c83ca4

Browse files
authored
refactor: move feedback and upgrade under sentry cli command (#154)
## Summary Group CLI meta-commands under a new `cli` subcommand to avoid collision with the existing Sentry Feedback feature (user feedback on issues). ## Changes **Commands:** - `sentry feedback` → `sentry cli feedback` - `sentry upgrade` → `sentry cli upgrade` - Removed `sentry update` alias **Files:** - Created `src/commands/cli/` with `index.ts`, `feedback.ts`, `upgrade.ts` - Updated `src/app.ts` to use `cliRoute` - Updated version check notification message - Updated all documentation (`commands/cli/`, SKILL.md files) ## Breaking Changes Users will need to use `sentry cli feedback` and `sentry cli upgrade` instead of the old top-level commands.
1 parent 383549f commit 7c83ca4

13 files changed

Lines changed: 265 additions & 86 deletions

File tree

docs/src/content/docs/commands/feedback.md renamed to docs/src/content/docs/commands/cli/feedback.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
---
2-
title: feedback
2+
title: cli feedback
33
description: Send feedback about the Sentry CLI
44
---
55

66
Send feedback about your experience with the CLI.
77

8-
## Commands
9-
10-
### `sentry feedback`
11-
12-
Submit feedback about the CLI directly to the Sentry team.
8+
## Usage
139

1410
```bash
15-
sentry feedback <message>
11+
sentry cli feedback <message>
1612
```
1713

1814
**Arguments:**
@@ -25,13 +21,13 @@ sentry feedback <message>
2521

2622
```bash
2723
# Send positive feedback
28-
sentry feedback i love this tool
24+
sentry cli feedback i love this tool
2925

3026
# Report an issue
31-
sentry feedback the issue view is confusing
27+
sentry cli feedback the issue view is confusing
3228

3329
# Suggest an improvement
34-
sentry feedback would be great to have a search command
30+
sentry cli feedback would be great to have a search command
3531
```
3632

3733
## Notes
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: cli
3+
description: CLI-related commands for managing the Sentry CLI itself
4+
---
5+
6+
Commands for managing the Sentry CLI itself, including sending feedback and upgrading to newer versions.
7+
8+
## Commands
9+
10+
| Command | Description |
11+
|---------|-------------|
12+
| [`feedback`](./feedback/) | Send feedback about the CLI |
13+
| [`upgrade`](./upgrade/) | Update the CLI to the latest version |

docs/src/content/docs/commands/upgrade.md renamed to docs/src/content/docs/commands/cli/upgrade.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: upgrade
2+
title: cli upgrade
33
description: Update the Sentry CLI to the latest version
44
---
55

@@ -8,14 +8,12 @@ Self-update the Sentry CLI to the latest or a specific version.
88
## Usage
99

1010
```bash
11-
sentry upgrade # Update to latest version
12-
sentry upgrade 0.5.0 # Update to specific version
13-
sentry upgrade --check # Check for updates without installing
14-
sentry upgrade --method npm # Force using npm to upgrade
11+
sentry cli upgrade # Update to latest version
12+
sentry cli upgrade 0.5.0 # Update to specific version
13+
sentry cli upgrade --check # Check for updates without installing
14+
sentry cli upgrade --method npm # Force using npm to upgrade
1515
```
1616

17-
**Alias:** `sentry update`
18-
1917
## Options
2018

2119
| Option | Description |
@@ -41,21 +39,21 @@ The CLI auto-detects how it was installed and uses the same method to upgrade:
4139
### Check for updates
4240

4341
```bash
44-
sentry upgrade --check
42+
sentry cli upgrade --check
4543
```
4644

4745
```
4846
Installation method: curl
4947
Current version: 0.4.0
5048
Latest version: 0.5.0
5149
52-
Run 'sentry upgrade' to update.
50+
Run 'sentry cli upgrade' to update.
5351
```
5452

5553
### Upgrade to latest
5654

5755
```bash
58-
sentry upgrade
56+
sentry cli upgrade
5957
```
6058

6159
```
@@ -71,13 +69,13 @@ Successfully upgraded to 0.5.0.
7169
### Upgrade to specific version
7270

7371
```bash
74-
sentry upgrade 0.5.0
72+
sentry cli upgrade 0.5.0
7573
```
7674

7775
### Force installation method
7876

7977
If auto-detection fails or you want to switch installation methods:
8078

8179
```bash
82-
sentry upgrade --method npm
80+
sentry cli upgrade --method npm
8381
```

docs/src/content/docs/commands/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ The Sentry CLI provides commands for interacting with various Sentry resources.
1010
| Command | Description |
1111
|---------|-------------|
1212
| [`auth`](./auth/) | Authentication management |
13+
| [`cli`](./cli/) | CLI-related commands (feedback, upgrade) |
1314
| [`org`](./org/) | Organization operations |
1415
| [`project`](./project/) | Project operations |
1516
| [`issue`](./issue/) | Issue tracking |
1617
| [`event`](./event/) | Event inspection |
1718
| [`api`](./api/) | Direct API access |
18-
| [`feedback`](./feedback/) | Send feedback about the CLI |
1919

2020
## Global Options
2121

plugins/sentry-cli/skills/sentry-cli/SKILL.md

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -364,41 +364,22 @@ sentry api /organizations/ --include
364364
sentry api /projects/my-org/my-project/issues/ --paginate
365365
```
366366

367-
### Upgrade
367+
### Cli
368368

369-
Update the Sentry CLI to the latest version
369+
CLI-related commands
370+
371+
#### `sentry cli feedback <message...>`
370372

371-
#### `sentry upgrade <version>`
373+
Send feedback about the CLI
374+
375+
#### `sentry cli upgrade <version>`
372376

373377
Update the Sentry CLI to the latest version
374378

375379
**Flags:**
376380
- `--check - Check for updates without installing`
377381
- `--method <value> - Installation method to use (curl, npm, pnpm, bun, yarn)`
378382

379-
### Feedback
380-
381-
Send feedback about the CLI
382-
383-
#### `sentry feedback <message...>`
384-
385-
Send feedback about the CLI
386-
387-
**Examples:**
388-
389-
```bash
390-
sentry feedback <message>
391-
392-
# Send positive feedback
393-
sentry feedback i love this tool
394-
395-
# Report an issue
396-
sentry feedback the issue view is confusing
397-
398-
# Suggest an improvement
399-
sentry feedback would be great to have a search command
400-
```
401-
402383
## Output Formats
403384

404385
### JSON Output

src/app.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ import {
88
} from "@stricli/core";
99
import { apiCommand } from "./commands/api.js";
1010
import { authRoute } from "./commands/auth/index.js";
11+
import { cliRoute } from "./commands/cli/index.js";
1112
import { eventRoute } from "./commands/event/index.js";
12-
import { feedbackCommand } from "./commands/feedback.js";
1313
import { helpCommand } from "./commands/help.js";
1414
import { issueRoute } from "./commands/issue/index.js";
1515
import { orgRoute } from "./commands/org/index.js";
1616
import { projectRoute } from "./commands/project/index.js";
17-
import { upgradeCommand } from "./commands/upgrade.js";
1817
import { CLI_VERSION } from "./lib/constants.js";
1918
import { CliError, getExitCode } from "./lib/errors.js";
2019
import { error as errorColor } from "./lib/formatters/colors.js";
@@ -24,16 +23,12 @@ export const routes = buildRouteMap({
2423
routes: {
2524
help: helpCommand,
2625
auth: authRoute,
26+
cli: cliRoute,
2727
org: orgRoute,
2828
project: projectRoute,
2929
issue: issueRoute,
3030
event: eventRoute,
3131
api: apiCommand,
32-
upgrade: upgradeCommand,
33-
feedback: feedbackCommand,
34-
},
35-
aliases: {
36-
update: "upgrade",
3732
},
3833
defaultCommand: "help",
3934
docs: {
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
* Allows users to submit feedback about the CLI.
55
* All arguments after 'feedback' are joined into a single message.
66
*
7-
* @example sentry feedback i love this tool
8-
* @example sentry feedback the issue view is confusing
7+
* @example sentry cli feedback i love this tool
8+
* @example sentry cli feedback the issue view is confusing
99
*/
1010

1111
// biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import
1212
import * as Sentry from "@sentry/bun";
1313
import { buildCommand } from "@stricli/core";
14-
import type { SentryContext } from "../context.js";
15-
import { ValidationError } from "../lib/errors.js";
14+
import type { SentryContext } from "../../context.js";
15+
import { ValidationError } from "../../lib/errors.js";
1616

1717
export const feedbackCommand = buildCommand({
1818
docs: {

src/commands/cli/index.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { buildRouteMap } from "@stricli/core";
2+
import { feedbackCommand } from "./feedback.js";
3+
import { upgradeCommand } from "./upgrade.js";
4+
5+
export const cliRoute = buildRouteMap({
6+
routes: {
7+
feedback: feedbackCommand,
8+
upgrade: upgradeCommand,
9+
},
10+
docs: {
11+
brief: "CLI-related commands",
12+
fullDescription:
13+
"Commands for managing the Sentry CLI itself, including sending feedback " +
14+
"and upgrading to newer versions.",
15+
},
16+
});
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/**
2-
* sentry upgrade
2+
* sentry cli upgrade
33
*
44
* Self-update the Sentry CLI to the latest or a specific version.
55
*/
66

77
import { buildCommand } from "@stricli/core";
8-
import type { SentryContext } from "../context.js";
9-
import { CLI_VERSION } from "../lib/constants.js";
10-
import { UpgradeError } from "../lib/errors.js";
8+
import type { SentryContext } from "../../context.js";
9+
import { CLI_VERSION } from "../../lib/constants.js";
10+
import { UpgradeError } from "../../lib/errors.js";
1111
import {
1212
detectInstallationMethod,
1313
executeUpgrade,
@@ -16,7 +16,7 @@ import {
1616
parseInstallationMethod,
1717
VERSION_PREFIX_REGEX,
1818
versionExists,
19-
} from "../lib/upgrade.js";
19+
} from "../../lib/upgrade.js";
2020

2121
type UpgradeFlags = {
2222
readonly check: boolean;
@@ -30,10 +30,10 @@ export const upgradeCommand = buildCommand({
3030
"Check for updates and upgrade the Sentry CLI to the latest or a specific version.\n\n" +
3131
"By default, detects how the CLI was installed (npm, curl, etc.) and uses the same method to upgrade.\n\n" +
3232
"Examples:\n" +
33-
" sentry upgrade # Update to latest version\n" +
34-
" sentry upgrade 0.5.0 # Update to specific version\n" +
35-
" sentry upgrade --check # Check for updates without installing\n" +
36-
" sentry upgrade --method npm # Force using npm to upgrade",
33+
" sentry cli upgrade # Update to latest version\n" +
34+
" sentry cli upgrade 0.5.0 # Update to specific version\n" +
35+
" sentry cli upgrade --check # Check for updates without installing\n" +
36+
" sentry cli upgrade --method npm # Force using npm to upgrade",
3737
},
3838
parameters: {
3939
positional: {
@@ -94,7 +94,9 @@ export const upgradeCommand = buildCommand({
9494
if (CLI_VERSION === target) {
9595
stdout.write("\nYou are already on the target version.\n");
9696
} else {
97-
const cmd = version ? `sentry upgrade ${target}` : "sentry upgrade";
97+
const cmd = version
98+
? `sentry cli upgrade ${target}`
99+
: "sentry cli upgrade";
98100
stdout.write(`\nRun '${cmd}' to update.\n`);
99101
}
100102
return;

src/lib/version-check.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function getUpdateNotificationImpl(): string | null {
133133
return null;
134134
}
135135

136-
return `\n${muted("Update available:")} ${cyan(CLI_VERSION)}${cyan(latestVersion)} Run ${cyan('"sentry upgrade"')} to update.\n`;
136+
return `\n${muted("Update available:")} ${cyan(CLI_VERSION)}${cyan(latestVersion)} Run ${cyan('"sentry cli upgrade"')} to update.\n`;
137137
} catch (error) {
138138
// DB access failed - report to Sentry but don't crash CLI
139139
Sentry.captureException(error);

0 commit comments

Comments
 (0)