Skip to content
Merged
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
34 changes: 34 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,40 @@ export const myCommand = buildCommand({
- The wrapper auto-injects `--json` and `--fields` flags. Do NOT add your own `json` flag.
- Do NOT use `stdout.write()` or `if (flags.json)` branching — the wrapper handles it.

### Route Maps (Stricli)

Route groups use Stricli's `buildRouteMap` wrapped by `src/lib/route-map.ts`.

**CRITICAL**: Import `buildRouteMap` from `../../lib/route-map.js`, **NEVER** from `@stricli/core` directly — the wrapper auto-injects standard subcommand aliases based on which route keys exist:

| Route | Auto-aliases |
|----------|----------------|
| `list` | `ls` |
| `view` | `show` |
| `delete` | `remove`, `rm` |
| `create` | `new` |

Manually specified aliases in `aliases` are merged with (and take precedence over) auto-generated ones. Do NOT manually add aliases that are already in the standard set above.

```typescript
import { buildRouteMap } from "../../lib/route-map.js";

export const myRoute = buildRouteMap({
routes: {
list: listCommand,
view: viewCommand,
create: createCommand,
},
defaultCommand: "view",
// No need for aliases — ls, show, and new are auto-injected.
// Only add aliases for non-standard mappings:
// aliases: { custom: "list" },
docs: {
brief: "Manage my resources",
},
});
```

### Positional Arguments

Use `parseSlashSeparatedArg` from `src/lib/arg-parsing.ts` for the standard `[<org>/<project>/]<id>` pattern. Required identifiers (trace IDs, span IDs) should be **positional args**, not flags.
Expand Down
12 changes: 6 additions & 6 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"options": {
"paths": {
"@stricli/core": {
"importNames": ["buildCommand"],
"message": "Import buildCommand from '../lib/command.js' instead. The wrapper injects telemetry, --log-level, and --verbose."
"importNames": ["buildCommand", "buildRouteMap"],
"message": "Import buildCommand from '../lib/command.js' and buildRouteMap from '../lib/route-map.js' instead. The wrappers inject telemetry and standard subcommand aliases."
}
}
}
Expand Down Expand Up @@ -89,8 +89,8 @@
}
},
{
// command.ts is the canonical wrapperit must import buildCommand from @stricli/core
"includes": ["src/lib/command.ts"],
// command.ts and route-map.ts are the canonical wrappersthey must import from @stricli/core
"includes": ["src/lib/command.ts", "src/lib/route-map.ts"],
"linter": {
"rules": {
"style": {
Expand All @@ -111,8 +111,8 @@
"options": {
"paths": {
"@stricli/core": {
"importNames": ["buildCommand"],
"message": "Import buildCommand from '../lib/command.js' instead. The wrapper injects telemetry, --log-level, and --verbose."
"importNames": ["buildCommand", "buildRouteMap"],
"message": "Import buildCommand from '../lib/command.js' and buildRouteMap from '../lib/route-map.js' instead. The wrappers inject telemetry and standard subcommand aliases."
},
"chalk": {
"message": "Use colorTag() from formatters/markdown.js for colored output. Raw chalk bypasses the plain-output pipeline (NO_COLOR, SENTRY_PLAIN_OUTPUT)."
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/commands/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ View a dashboard
| `-w, --web` | Open in browser |
| `-f, --fresh` | Bypass cache, re-detect projects, and fetch fresh data |
| `-r, --refresh <refresh>` | Auto-refresh interval in seconds (default: 60, min: 10) |
| `-t, --period <period>` | Time range: "7d", "2026-03-07..2026-04-07", ">=2026-03-07" |
| `-t, --period <period>` | Time range: "7d", "2026-03-08..2026-04-08", ">=2026-03-08" |

### `sentry dashboard create <org/project/title...>`

Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/commands/event.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ List events for an issue
| `-n, --limit <limit>` | Number of events (1-1000) (default: "25") |
| `-q, --query <query>` | Search query (Sentry search syntax) |
| `--full` | Include full event body (stacktraces) |
| `-t, --period <period>` | Time range: "7d", "2026-03-07..2026-04-07", ">=2026-03-07" (default: "7d") |
| `-t, --period <period>` | Time range: "7d", "2026-03-08..2026-04-08", ">=2026-03-08" (default: "7d") |
| `-f, --fresh` | Bypass cache, re-detect projects, and fetch fresh data |
| `-c, --cursor <cursor>` | Navigate pages: "next", "prev", "first" (or raw cursor string) |

Expand Down
4 changes: 2 additions & 2 deletions docs/src/content/docs/commands/issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ List issues in a project
| `-q, --query <query>` | Search query (Sentry search syntax) |
| `-n, --limit <limit>` | Maximum number of issues to list (default: "25") |
| `-s, --sort <sort>` | Sort by: date, new, freq, user (default: "date") |
| `-t, --period <period>` | Time range: "7d", "2026-03-07..2026-04-07", ">=2026-03-07" (default: "90d") |
| `-t, --period <period>` | Time range: "7d", "2026-03-08..2026-04-08", ">=2026-03-08" (default: "90d") |
| `-c, --cursor <cursor>` | Pagination cursor (use "next" for next page, "prev" for previous) |
| `--compact` | Single-line rows for compact output (auto-detects if omitted) |
| `-f, --fresh` | Bypass cache, re-detect projects, and fetch fresh data |
Expand All @@ -46,7 +46,7 @@ List events for a specific issue
| `-n, --limit <limit>` | Number of events (1-1000) (default: "25") |
| `-q, --query <query>` | Search query (Sentry search syntax) |
| `--full` | Include full event body (stacktraces) |
| `-t, --period <period>` | Time range: "7d", "2026-03-07..2026-04-07", ">=2026-03-07" (default: "7d") |
| `-t, --period <period>` | Time range: "7d", "2026-03-08..2026-04-08", ">=2026-03-08" (default: "7d") |
| `-f, --fresh` | Bypass cache, re-detect projects, and fetch fresh data |
| `-c, --cursor <cursor>` | Navigate pages: "next", "prev", "first" (or raw cursor string) |

Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/commands/log.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ List logs from a project
| `-n, --limit <limit>` | Number of log entries (1-1000) (default: "100") |
| `-q, --query <query>` | Filter query (Sentry search syntax) |
| `-f, --follow <follow>` | Stream logs (optionally specify poll interval in seconds) |
| `-t, --period <period>` | Time range: "7d", "2026-03-07..2026-04-07", ">=2026-03-07" |
| `-t, --period <period>` | Time range: "7d", "2026-03-08..2026-04-08", ">=2026-03-08" |
| `-s, --sort <sort>` | Sort order: "newest" (default) or "oldest" (default: "newest") |
| `--fresh` | Bypass cache, re-detect projects, and fetch fresh data |

Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/commands/span.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ List spans in a project or trace
| `-n, --limit <limit>` | Number of spans (<=1000) (default: "25") |
| `-q, --query <query>` | Filter spans (e.g., "op:db", "duration:>100ms", "project:backend") |
| `-s, --sort <sort>` | Sort order: date, duration (default: "date") |
| `-t, --period <period>` | Time range: "7d", "2026-03-07..2026-04-07", ">=2026-03-07" (default: "7d") |
| `-t, --period <period>` | Time range: "7d", "2026-03-08..2026-04-08", ">=2026-03-08" (default: "7d") |
| `-f, --fresh` | Bypass cache, re-detect projects, and fetch fresh data |
| `-c, --cursor <cursor>` | Navigate pages: "next", "prev", "first" (or raw cursor string) |

Expand Down
4 changes: 2 additions & 2 deletions docs/src/content/docs/commands/trace.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ List recent traces in a project
| `-n, --limit <limit>` | Number of traces (1-1000) (default: "25") |
| `-q, --query <query>` | Search query (Sentry search syntax) |
| `-s, --sort <sort>` | Sort by: date, duration (default: "date") |
| `-t, --period <period>` | Time range: "7d", "2026-03-07..2026-04-07", ">=2026-03-07" (default: "7d") |
| `-t, --period <period>` | Time range: "7d", "2026-03-08..2026-04-08", ">=2026-03-08" (default: "7d") |
| `-f, --fresh` | Bypass cache, re-detect projects, and fetch fresh data |
| `-c, --cursor <cursor>` | Navigate pages: "next", "prev", "first" (or raw cursor string) |

Expand Down Expand Up @@ -61,7 +61,7 @@ View logs associated with a trace
| Option | Description |
|--------|-------------|
| `-w, --web` | Open trace in browser |
| `-t, --period <period>` | Time range: "7d", "2026-03-07..2026-04-07", ">=2026-03-07" (default: "14d") |
| `-t, --period <period>` | Time range: "7d", "2026-03-08..2026-04-08", ">=2026-03-08" (default: "14d") |
| `-n, --limit <limit>` | Number of log entries (<=1000) (default: "100") |
| `-q, --query <query>` | Additional filter query (Sentry search syntax) |
| `-s, --sort <sort>` | Sort order: "newest" (default) or "oldest" (default: "newest") |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ View a dashboard
- `-w, --web - Open in browser`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `-r, --refresh <value> - Auto-refresh interval in seconds (default: 60, min: 10)`
- `-t, --period <value> - Time range: "7d", "2026-03-07..2026-04-07", ">=2026-03-07"`
- `-t, --period <value> - Time range: "7d", "2026-03-08..2026-04-08", ">=2026-03-08"`

**Examples:**

Expand Down
2 changes: 1 addition & 1 deletion plugins/sentry-cli/skills/sentry-cli/references/event.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ List events for an issue
- `-n, --limit <value> - Number of events (1-1000) - (default: "25")`
- `-q, --query <value> - Search query (Sentry search syntax)`
- `--full - Include full event body (stacktraces)`
- `-t, --period <value> - Time range: "7d", "2026-03-07..2026-04-07", ">=2026-03-07" - (default: "7d")`
- `-t, --period <value> - Time range: "7d", "2026-03-08..2026-04-08", ">=2026-03-08" - (default: "7d")`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `-c, --cursor <value> - Navigate pages: "next", "prev", "first" (or raw cursor string)`

Expand Down
4 changes: 2 additions & 2 deletions plugins/sentry-cli/skills/sentry-cli/references/issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ List issues in a project
- `-q, --query <value> - Search query (Sentry search syntax)`
- `-n, --limit <value> - Maximum number of issues to list - (default: "25")`
- `-s, --sort <value> - Sort by: date, new, freq, user - (default: "date")`
- `-t, --period <value> - Time range: "7d", "2026-03-07..2026-04-07", ">=2026-03-07" - (default: "90d")`
- `-t, --period <value> - Time range: "7d", "2026-03-08..2026-04-08", ">=2026-03-08" - (default: "90d")`
- `-c, --cursor <value> - Pagination cursor (use "next" for next page, "prev" for previous)`
- `--compact - Single-line rows for compact output (auto-detects if omitted)`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
Expand Down Expand Up @@ -78,7 +78,7 @@ List events for a specific issue
- `-n, --limit <value> - Number of events (1-1000) - (default: "25")`
- `-q, --query <value> - Search query (Sentry search syntax)`
- `--full - Include full event body (stacktraces)`
- `-t, --period <value> - Time range: "7d", "2026-03-07..2026-04-07", ">=2026-03-07" - (default: "7d")`
- `-t, --period <value> - Time range: "7d", "2026-03-08..2026-04-08", ">=2026-03-08" - (default: "7d")`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `-c, --cursor <value> - Navigate pages: "next", "prev", "first" (or raw cursor string)`

Expand Down
2 changes: 1 addition & 1 deletion plugins/sentry-cli/skills/sentry-cli/references/log.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ List logs from a project
- `-n, --limit <value> - Number of log entries (1-1000) - (default: "100")`
- `-q, --query <value> - Filter query (Sentry search syntax)`
- `-f, --follow <value> - Stream logs (optionally specify poll interval in seconds)`
- `-t, --period <value> - Time range: "7d", "2026-03-07..2026-04-07", ">=2026-03-07"`
- `-t, --period <value> - Time range: "7d", "2026-03-08..2026-04-08", ">=2026-03-08"`
- `-s, --sort <value> - Sort order: "newest" (default) or "oldest" - (default: "newest")`
- `--fresh - Bypass cache, re-detect projects, and fetch fresh data`

Expand Down
2 changes: 1 addition & 1 deletion plugins/sentry-cli/skills/sentry-cli/references/span.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ List spans in a project or trace
- `-n, --limit <value> - Number of spans (<=1000) - (default: "25")`
- `-q, --query <value> - Filter spans (e.g., "op:db", "duration:>100ms", "project:backend")`
- `-s, --sort <value> - Sort order: date, duration - (default: "date")`
- `-t, --period <value> - Time range: "7d", "2026-03-07..2026-04-07", ">=2026-03-07" - (default: "7d")`
- `-t, --period <value> - Time range: "7d", "2026-03-08..2026-04-08", ">=2026-03-08" - (default: "7d")`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `-c, --cursor <value> - Navigate pages: "next", "prev", "first" (or raw cursor string)`

Expand Down
4 changes: 2 additions & 2 deletions plugins/sentry-cli/skills/sentry-cli/references/trace.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ List recent traces in a project
- `-n, --limit <value> - Number of traces (1-1000) - (default: "25")`
- `-q, --query <value> - Search query (Sentry search syntax)`
- `-s, --sort <value> - Sort by: date, duration - (default: "date")`
- `-t, --period <value> - Time range: "7d", "2026-03-07..2026-04-07", ">=2026-03-07" - (default: "7d")`
- `-t, --period <value> - Time range: "7d", "2026-03-08..2026-04-08", ">=2026-03-08" - (default: "7d")`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `-c, --cursor <value> - Navigate pages: "next", "prev", "first" (or raw cursor string)`

Expand Down Expand Up @@ -78,7 +78,7 @@ View logs associated with a trace

**Flags:**
- `-w, --web - Open trace in browser`
- `-t, --period <value> - Time range: "7d", "2026-03-07..2026-04-07", ">=2026-03-07" - (default: "14d")`
- `-t, --period <value> - Time range: "7d", "2026-03-08..2026-04-08", ">=2026-03-08" - (default: "14d")`
- `-n, --limit <value> - Number of log entries (<=1000) - (default: "100")`
- `-q, --query <value> - Additional filter query (Sentry search syntax)`
- `-s, --sort <value> - Sort order: "newest" (default) or "oldest" - (default: "newest")`
Expand Down
2 changes: 1 addition & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as Sentry from "@sentry/node-core/light";
import {
type ApplicationText,
buildApplication,
buildRouteMap,
text_en,
UnexpectedPositionalError,
UnsatisfiedPositionalError,
Expand Down Expand Up @@ -55,6 +54,7 @@ import {
} from "./lib/errors.js";
import { error as errorColor, warning } from "./lib/formatters/colors.js";
import { isRouteMap, type RouteMap } from "./lib/introspect.js";
import { buildRouteMap } from "./lib/route-map.js";

/**
* Plural alias → singular route name mapping.
Expand Down
2 changes: 1 addition & 1 deletion src/commands/auth/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { buildRouteMap } from "@stricli/core";
import { buildRouteMap } from "../../lib/route-map.js";
import { loginCommand } from "./login.js";
import { logoutCommand } from "./logout.js";
import { refreshCommand } from "./refresh.js";
Expand Down
2 changes: 1 addition & 1 deletion src/commands/cli/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { buildRouteMap } from "@stricli/core";
import { buildRouteMap } from "../../lib/route-map.js";
import { feedbackCommand } from "./feedback.js";
import { fixCommand } from "./fix.js";
import { setupCommand } from "./setup.js";
Expand Down
3 changes: 1 addition & 2 deletions src/commands/dashboard/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { buildRouteMap } from "@stricli/core";
import { buildRouteMap } from "../../lib/route-map.js";
import { createCommand } from "./create.js";
import { listCommand } from "./list.js";
import { viewCommand } from "./view.js";
Expand All @@ -12,7 +12,6 @@ export const dashboardRoute = buildRouteMap({
widget: widgetRoute,
},
defaultCommand: "view",
aliases: { show: "view" },
docs: {
brief: "Manage Sentry dashboards",
fullDescription:
Expand Down
3 changes: 1 addition & 2 deletions src/commands/dashboard/widget/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { buildRouteMap } from "@stricli/core";
import { buildRouteMap } from "../../../lib/route-map.js";
import { addCommand } from "./add.js";
import { deleteCommand } from "./delete.js";
import { editCommand } from "./edit.js";
Expand All @@ -9,7 +9,6 @@ export const widgetRoute = buildRouteMap({
edit: editCommand,
delete: deleteCommand,
},
aliases: { remove: "delete" },
docs: {
brief: "Manage dashboard widgets",
fullDescription:
Expand Down
3 changes: 1 addition & 2 deletions src/commands/event/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { buildRouteMap } from "@stricli/core";
import { buildRouteMap } from "../../lib/route-map.js";
import { listCommand } from "./list.js";
import { viewCommand } from "./view.js";

Expand All @@ -8,7 +8,6 @@ export const eventRoute = buildRouteMap({
list: listCommand,
},
defaultCommand: "view",
aliases: { show: "view" },
docs: {
brief: "View and list Sentry events",
fullDescription:
Expand Down
3 changes: 1 addition & 2 deletions src/commands/issue/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { buildRouteMap } from "@stricli/core";
import { buildRouteMap } from "../../lib/route-map.js";
import { eventsCommand } from "./events.js";
import { explainCommand } from "./explain.js";
import { listCommand } from "./list.js";
Expand All @@ -14,7 +14,6 @@ export const issueRoute = buildRouteMap({
view: viewCommand,
},
defaultCommand: "view",
aliases: { show: "view" },
docs: {
brief: "Manage Sentry issues",
fullDescription:
Expand Down
3 changes: 1 addition & 2 deletions src/commands/log/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* View and stream logs from Sentry projects.
*/

import { buildRouteMap } from "@stricli/core";
import { buildRouteMap } from "../../lib/route-map.js";
import { listCommand } from "./list.js";
import { viewCommand } from "./view.js";

Expand All @@ -14,7 +14,6 @@ export const logRoute = buildRouteMap({
view: viewCommand,
},
defaultCommand: "view",
aliases: { show: "view" },
docs: {
brief: "View Sentry logs",
fullDescription:
Expand Down
3 changes: 1 addition & 2 deletions src/commands/org/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { buildRouteMap } from "@stricli/core";
import { buildRouteMap } from "../../lib/route-map.js";
import { listCommand } from "./list.js";
import { viewCommand } from "./view.js";

Expand All @@ -8,7 +8,6 @@ export const orgRoute = buildRouteMap({
view: viewCommand,
},
defaultCommand: "view",
aliases: { show: "view" },
docs: {
brief: "Work with Sentry organizations",
fullDescription:
Expand Down
3 changes: 1 addition & 2 deletions src/commands/project/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { buildRouteMap } from "@stricli/core";
import { buildRouteMap } from "../../lib/route-map.js";
import { createCommand } from "./create.js";
import { deleteCommand } from "./delete.js";
import { listCommand } from "./list.js";
Expand All @@ -12,7 +12,6 @@ export const projectRoute = buildRouteMap({
view: viewCommand,
},
defaultCommand: "view",
aliases: { show: "view", remove: "delete" },
docs: {
brief: "Work with Sentry projects",
fullDescription:
Expand Down
2 changes: 1 addition & 1 deletion src/commands/release/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Route map for release management commands.
*/

import { buildRouteMap } from "@stricli/core";
import { buildRouteMap } from "../../lib/route-map.js";
import { createCommand } from "./create.js";
import { deleteCommand } from "./delete.js";
import { deployCommand } from "./deploy.js";
Expand Down
2 changes: 1 addition & 1 deletion src/commands/repo/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { buildRouteMap } from "@stricli/core";
import { buildRouteMap } from "../../lib/route-map.js";
import { listCommand } from "./list.js";

export const repoRoute = buildRouteMap({
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sourcemap/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { buildRouteMap } from "@stricli/core";
import { buildRouteMap } from "../../lib/route-map.js";
import { injectCommand } from "./inject.js";
import { uploadCommand } from "./upload.js";

Expand Down
3 changes: 1 addition & 2 deletions src/commands/span/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* List and explore individual spans within distributed traces or across projects.
*/

import { buildRouteMap } from "@stricli/core";
import { buildRouteMap } from "../../lib/route-map.js";
import { listCommand } from "./list.js";
import { viewCommand } from "./view.js";

Expand All @@ -14,7 +14,6 @@ export const spanRoute = buildRouteMap({
view: viewCommand,
},
defaultCommand: "view",
aliases: { show: "view" },
docs: {
brief: "List and view spans in projects or traces",
fullDescription:
Expand Down
2 changes: 1 addition & 1 deletion src/commands/team/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { buildRouteMap } from "@stricli/core";
import { buildRouteMap } from "../../lib/route-map.js";
import { listCommand } from "./list.js";

export const teamRoute = buildRouteMap({
Expand Down
Loading
Loading