Skip to content
Draft
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
1 change: 1 addition & 0 deletions docs/public/.well-known/skills/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"description": "Guide for using the Sentry CLI to interact with Sentry from the command line. Use when the user asks about viewing issues, events, projects, organizations, making API calls, or authenticating with Sentry via CLI.",
"files": [
"SKILL.md",
"references/alert.md",
"references/api.md",
"references/auth.md",
"references/dashboards.md",
Expand Down
9 changes: 9 additions & 0 deletions plugins/sentry-cli/skills/sentry-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,15 @@ Make an authenticated API request

→ Full flags and examples: `references/api.md`

### Alert

Manage Sentry alert rules

- `sentry alert issues list <org/project>` — List issue alert rules
- `sentry alert metrics list <org/>` — List metric alert rules

→ Full flags and examples: `references/alert.md`

### Cli

CLI-related commands
Expand Down
34 changes: 34 additions & 0 deletions plugins/sentry-cli/skills/sentry-cli/references/alert.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: sentry-cli-alert
version: 0.21.0-dev.0
description: Sentry CLI alert commands
requires:
bins: ["sentry"]
auth: true
---

# alert Commands

Manage Sentry alert rules

### `sentry alert issues list <org/project>`

List issue alert rules

**Flags:**
- `-w, --web - Open in browser`
- `-n, --limit <value> - Maximum number of issue alert rules to list - (default: "30")`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `-c, --cursor <value> - Navigate pages: "next", "prev", "first" (or raw cursor string)`

### `sentry alert metrics list <org/>`

List metric alert rules

**Flags:**
- `-w, --web - Open in browser`
- `-n, --limit <value> - Maximum number of metric alert rules to list - (default: "30")`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `-c, --cursor <value> - Navigate pages: "next", "prev", "first" (or raw cursor string)`

All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags.
2 changes: 2 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
UnexpectedPositionalError,
} from "@stricli/core";
import { apiCommand } from "./commands/api.js";
import { alertRoute } from "./commands/alert/index.js";
import { authRoute } from "./commands/auth/index.js";
import { whoamiCommand } from "./commands/auth/whoami.js";
import { cliRoute } from "./commands/cli/index.js";
Expand Down Expand Up @@ -67,6 +68,7 @@ const PLURAL_TO_SINGULAR: Record<string, string> = {
export const routes = buildRouteMap({
routes: {
help: helpCommand,
alert: alertRoute,
auth: authRoute,
cli: cliRoute,
dashboard: dashboardRoute,
Expand Down
19 changes: 19 additions & 0 deletions src/commands/alert/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { buildRouteMap } from "@stricli/core";
import { issuesRoute } from "./issues/index.js";
import { metricsRoute } from "./metrics/index.js";

export const alertRoute = buildRouteMap({
routes: {
issues: issuesRoute,
metrics: metricsRoute,
},
docs: {
brief: "Manage Sentry alert rules",
fullDescription:
"View and manage alert rules in your Sentry organization.\n\n" +
"Alert types:\n" +
" issues Issue alert rules — trigger on matching error events (project-scoped)\n" +
" metrics Metric alert rules — trigger on metric query thresholds (org-scoped)",
hideRoute: {},
},
});
16 changes: 16 additions & 0 deletions src/commands/alert/issues/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { buildRouteMap } from "@stricli/core";
import { listCommand } from "./list.js";

export const issuesRoute = buildRouteMap({
routes: {
list: listCommand,
},
docs: {
brief: "Manage issue alert rules",
fullDescription:
"View and manage issue alert rules in your Sentry projects.\n\n" +
"Commands:\n" +
" list List issue alert rules",
hideRoute: {},
},
});
Loading
Loading