Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
174 changes: 174 additions & 0 deletions plugins/sentry-cli/skills/sentry-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,28 @@ sentry api /organizations/ --include
sentry api /projects/my-org/my-project/issues/ --paginate
```

### Init

Initialize Sentry in your project

#### `sentry init`

Initialize Sentry in your project

**Flags:**
- `-i, --integration <value> - Integration to setup (nextjs, reactNative, flutter, etc.)`
- `--org <value> - Sentry organization slug`
- `--project <value> - Sentry project slug`
- `-u, --url <value> - Sentry URL (for self-hosted)`
- `--debug - Enable verbose logging`
- `--uninstall - Revert project setup`
- `--quiet - Don't prompt for input`
- `--skip-connect - Skip connecting to Sentry server`
- `--saas - Skip self-hosted/SaaS selection`
- `-s, --signup - Redirect to signup if not logged in`
- `--disable-telemetry - Don't send telemetry to Sentry`
- `--no-auth - Don't pass existing CLI auth to wizard (force browser login)`

### Cli

CLI-related commands
Expand Down Expand Up @@ -424,6 +446,158 @@ List logs from a project
- `-f, --follow <value> - Stream logs (optionally specify poll interval in seconds)`
- `--json - Output as JSON`

### Releases

Manage releases on Sentry

#### `sentry releases new <args...>`

Create a new release

#### `sentry releases finalize <args...>`

Finalize a release

#### `sentry releases list <args...>`

List releases

#### `sentry releases info <args...>`

Show release info

#### `sentry releases delete <args...>`

Delete a release

#### `sentry releases archive <args...>`

Archive a release

#### `sentry releases restore <args...>`

Restore an archived release

#### `sentry releases set-commits <args...>`

Associate commits with a release

#### `sentry releases propose-version <args...>`

Propose a version string

### Sourcemaps

Manage sourcemaps for Sentry releases

#### `sentry sourcemaps upload <args...>`

Upload sourcemaps

#### `sentry sourcemaps inject <args...>`

Inject debug IDs into source files

#### `sentry sourcemaps resolve <args...>`

Resolve minified source locations

### Debug-files

Locate, analyze or upload debug information files

#### `sentry debug-files upload <args...>`

Upload debug information files

#### `sentry debug-files check <args...>`

Check debug files for issues

#### `sentry debug-files find <args...>`

Find debug information files

#### `sentry debug-files bundle-sources <args...>`

Bundle source files

#### `sentry debug-files bundle-jvm <args...>`

Bundle JVM debug files

#### `sentry debug-files print-sources <args...>`

Print embedded source files

### Deploys

Manage deployments for Sentry releases

#### `sentry deploys list <args...>`

List deployments

#### `sentry deploys new <args...>`

Create a new deployment

### Monitors

Manage cron monitors on Sentry

#### `sentry monitors list <args...>`

List cron monitors

#### `sentry monitors run <args...>`

Run a command and report to a cron monitor

### Repos

Manage repositories on Sentry

#### `sentry repos list <args...>`

List repositories

### Build

Manage builds

#### `sentry build upload <args...>`

Upload build artifacts

### React-native

Upload build artifacts for React Native projects

#### `sentry react-native gradle <args...>`

Upload React Native Android build artifacts

#### `sentry react-native xcode <args...>`

Upload React Native iOS build artifacts

### Send-event

Send an event to Sentry

#### `sentry send-event <args...>`

Send an event to Sentry

### Send-envelope

Send an envelope to Sentry

#### `sentry send-envelope <args...>`

Send an envelope to Sentry

## Output Formats

### JSON Output
Expand Down
22 changes: 22 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,24 @@ import {
} from "@stricli/core";
import { apiCommand } from "./commands/api.js";
import { authRoute } from "./commands/auth/index.js";
import { buildCommandRoute } from "./commands/build/index.js";
import { cliRoute } from "./commands/cli/index.js";
import { debugFilesRoute } from "./commands/debug-files/index.js";
import { deploysRoute } from "./commands/deploys/index.js";
import { eventRoute } from "./commands/event/index.js";
import { helpCommand } from "./commands/help.js";
import { initCommand } from "./commands/init.js";
import { issueRoute } from "./commands/issue/index.js";
import { logRoute } from "./commands/log/index.js";
import { monitorsRoute } from "./commands/monitors/index.js";
import { orgRoute } from "./commands/org/index.js";
import { projectRoute } from "./commands/project/index.js";
import { reactNativeRoute } from "./commands/react-native/index.js";
import { releasesRoute } from "./commands/releases/index.js";
import { reposRoute } from "./commands/repos/index.js";
import { sendEnvelopeCommand } from "./commands/send-envelope.js";
import { sendEventCommand } from "./commands/send-event.js";
import { sourcemapsRoute } from "./commands/sourcemaps/index.js";
import { CLI_VERSION } from "./lib/constants.js";
import { AuthError, CliError, getExitCode } from "./lib/errors.js";
import { error as errorColor } from "./lib/formatters/colors.js";
Expand All @@ -23,6 +34,7 @@ import { error as errorColor } from "./lib/formatters/colors.js";
export const routes = buildRouteMap({
routes: {
help: helpCommand,
init: initCommand,
auth: authRoute,
cli: cliRoute,
org: orgRoute,
Expand All @@ -31,6 +43,16 @@ export const routes = buildRouteMap({
event: eventRoute,
log: logRoute,
api: apiCommand,
releases: releasesRoute,
sourcemaps: sourcemapsRoute,
"debug-files": debugFilesRoute,
deploys: deploysRoute,
monitors: monitorsRoute,
repos: reposRoute,
build: buildCommandRoute,
"react-native": reactNativeRoute,
"send-event": sendEventCommand,
"send-envelope": sendEnvelopeCommand,
},
defaultCommand: "help",
docs: {
Expand Down
16 changes: 16 additions & 0 deletions src/commands/build/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { buildRouteMap } from "@stricli/core";
import { uploadCommand } from "./upload.js";

export const buildCommandRoute = buildRouteMap({
routes: {
upload: uploadCommand,
},
docs: {
brief: "Manage builds",
fullDescription:
"Manage builds on Sentry.\n\n" +
"Commands:\n" +
" upload Upload build artifacts",
hideRoute: {},
},
});
36 changes: 36 additions & 0 deletions src/commands/build/upload.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* sentry build upload
*
* Upload build artifacts to Sentry.
* Wraps: sentry-cli build upload
*/

import { buildCommand } from "@stricli/core";
import type { SentryContext } from "../../context.js";
import { runSentryCli } from "../../lib/sentry-cli-runner.js";

export const uploadCommand = buildCommand({
docs: {
brief: "Upload build artifacts",
fullDescription:
"Upload build artifacts to Sentry.\n\n" +
"Wraps: sentry-cli build upload\n\n" +
"Note: This command is restricted to Sentry SaaS.\n\n" +
"Examples:\n" +
" sentry build upload",
},
parameters: {
flags: {},
positional: {
kind: "array",
parameter: {
brief: "Arguments to pass to sentry-cli",
parse: String,
placeholder: "args",
},
},
},
async func(this: SentryContext, _flags: Record<string, never>, ...args: string[]): Promise<void> {
await runSentryCli(["build", "upload", ...args]);
},
});
39 changes: 39 additions & 0 deletions src/commands/debug-files/bundle-jvm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* sentry debug-files bundle-jvm
*
* Bundle JVM debug information files.
* Wraps: sentry-cli debug-files bundle-jvm
*/

import { buildCommand } from "@stricli/core";
import type { SentryContext } from "../../context.js";
import { runSentryCli } from "../../lib/sentry-cli-runner.js";

export const bundleJvmCommand = buildCommand({
docs: {
brief: "Bundle JVM debug files",
fullDescription:
"Bundle JVM debug information files.\n\n" +
"Wraps: sentry-cli debug-files bundle-jvm\n\n" +
"Examples:\n" +
" sentry debug-files bundle-jvm ./path/to/classes",
},
parameters: {
flags: {},
positional: {
kind: "array",
parameter: {
brief: "Arguments to pass to sentry-cli",
parse: String,
placeholder: "args",
},
},
},
async func(
this: SentryContext,
_flags: Record<string, never>,
...args: string[]
): Promise<void> {
await runSentryCli(["debug-files", "bundle-jvm", ...args]);
},
});
39 changes: 39 additions & 0 deletions src/commands/debug-files/bundle-sources.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* sentry debug-files bundle-sources
*
* Bundle source files for debug information.
* Wraps: sentry-cli debug-files bundle-sources
*/

import { buildCommand } from "@stricli/core";
import type { SentryContext } from "../../context.js";
import { runSentryCli } from "../../lib/sentry-cli-runner.js";

export const bundleSourcesCommand = buildCommand({
docs: {
brief: "Bundle source files",
fullDescription:
"Bundle source files for debug information.\n\n" +
"Wraps: sentry-cli debug-files bundle-sources\n\n" +
"Examples:\n" +
" sentry debug-files bundle-sources ./path/to/debug-file",
},
parameters: {
flags: {},
positional: {
kind: "array",
parameter: {
brief: "Arguments to pass to sentry-cli",
parse: String,
placeholder: "args",
},
},
},
async func(
this: SentryContext,
_flags: Record<string, never>,
...args: string[]
): Promise<void> {
await runSentryCli(["debug-files", "bundle-sources", ...args]);
},
});
Loading
Loading