Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
138b073
fix(test): pass through real formatMultipleProjectsFooter in mock
BYK Feb 18, 2026
9b42e75
feat(list): add pagination and consistent target parsing to all list …
BYK Feb 18, 2026
37e91c0
chore: merge main into byk/pagination-and-target-parsing
BYK Feb 18, 2026
591481b
chore: regenerate SKILL.md
github-actions[bot] Feb 18, 2026
f22f51e
fix(test): update issue list partial failure tests for org-all cursor…
BYK Feb 18, 2026
93e559f
test: add comprehensive coverage for pagination and target-parsing
BYK Feb 18, 2026
de709bf
fix: add no-op comments to empty mock blocks to satisfy lint rule
BYK Feb 18, 2026
1e4ebe0
fix: address all bot review comments from PR #262
BYK Feb 18, 2026
078dfa3
refactor: extract shared org-scoped list infrastructure for team and …
BYK Feb 18, 2026
ece0a29
refactor: extract shared buildCommand boilerplate into list-command.ts
BYK Feb 18, 2026
f7a4a15
chore: regenerate SKILL.md
github-actions[bot] Feb 18, 2026
7c02d9f
refactor: migrate all list commands to dispatchOrgScopedList, fix bar…
BYK Feb 18, 2026
4ac5c55
fix: address bot review comments
BYK Feb 18, 2026
39ac926
fix: address second round of bot review comments
BYK Feb 18, 2026
718cc94
refactor: pass typed parsed variant to mode handlers instead of Extra…
BYK Feb 19, 2026
bb5d70e
docs: update AGENTS.md to reflect typed ParsedVariant handlers
BYK Feb 19, 2026
fe2fb97
refactor: remove duplicate resolveCursor in favor of shared resolveOr…
BYK Feb 19, 2026
a757e7a
fix: escape pipe chars in context keys and omit empty query param
BYK Feb 19, 2026
86df3db
refactor: address review comments — shared escaping utility and dedup…
BYK Feb 19, 2026
990cc7a
fix: include sort/query flags in issue list next-page hint
BYK Feb 19, 2026
d89ad8a
refactor: pass HandlerContext to mode handlers instead of bare parsed…
BYK Feb 19, 2026
6632e3f
refactor: remove fallback option from dispatchOrgScopedList
BYK Feb 19, 2026
519a747
fix: remove duplicate pagination hint from handleExplicitOrg
BYK Feb 19, 2026
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
14 changes: 14 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,20 @@ import type { SentryContext } from "../../context.js";
import { getAuthToken } from "../../lib/config.js";
```

### List Command Infrastructure

Two abstraction levels exist for list commands:

1. **`src/lib/list-command.ts`** — `buildOrgListCommand` factory + shared Stricli parameter constants (`LIST_TARGET_POSITIONAL`, `LIST_JSON_FLAG`, `LIST_CURSOR_FLAG`, `buildListLimitFlag`). Use this for simple entity lists like `team list` and `repo list`.

2. **`src/lib/org-list.ts`** — `dispatchOrgScopedList` with `OrgListConfig` and a 4-mode handler map: `auto-detect`, `explicit`, `org-all`, `project-search`. Complex commands (`project list`, `issue list`) call `dispatchOrgScopedList` with an `overrides` map directly instead of using `buildOrgListCommand`.

Key rules when writing overrides:
- Each mode handler receives a `HandlerContext<T>` with the narrowed `parsed` plus shared I/O (`stdout`, `cwd`, `flags`). Access parsed fields via `ctx.parsed.org`, `ctx.parsed.projectSlug`, etc. — no manual `Extract<>` casts needed.
- Commands with extra fields (e.g., `stderr`, `setContext`) spread the context and add them: `(ctx) => handle({ ...ctx, flags, stderr, setContext })`. Override `ctx.flags` with the command-specific flags type when needed.
- `resolveCursor()` must be called **inside** the `org-all` override closure, not before `dispatchOrgScopedList`, so that `--cursor` validation errors fire correctly for non-org-all modes.
- `handleProjectSearch` errors must use `"Project"` as the `ContextError` resource, not `config.entityName`.

## Commenting & Documentation (JSDoc-first)

### Default Rule
Expand Down
22 changes: 14 additions & 8 deletions plugins/sentry-cli/skills/sentry-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,10 @@ List issues in a project

**Flags:**
- `-q, --query <value> - Search query (Sentry search syntax)`
- `-n, --limit <value> - Maximum number of issues to return - (default: "10")`
- `-n, --limit <value> - Maximum number of issues to list - (default: "10")`
- `-s, --sort <value> - Sort by: date, new, freq, user - (default: "date")`
- `--json - Output as JSON`
- `--json - Output JSON`
- `-c, --cursor <value> - Pagination cursor — only for <org>/ mode (use "last" to continue)`

**Examples:**

Expand Down Expand Up @@ -433,25 +434,27 @@ Update the Sentry CLI to the latest version

Work with Sentry repositories

#### `sentry repo list <org>`
#### `sentry repo list <target>`

List repositories

**Flags:**
- `-n, --limit <value> - Maximum number of repositories to list - (default: "30")`
- `--json - Output JSON`
- `-c, --cursor <value> - Pagination cursor (use "last" to continue from previous page)`

### Team

Work with Sentry teams

#### `sentry team list <org>`
#### `sentry team list <target>`

List teams

**Flags:**
- `-n, --limit <value> - Maximum number of teams to list - (default: "30")`
- `--json - Output JSON`
- `-c, --cursor <value> - Pagination cursor (use "last" to continue from previous page)`

**Examples:**

Expand Down Expand Up @@ -581,9 +584,10 @@ List issues in a project

**Flags:**
- `-q, --query <value> - Search query (Sentry search syntax)`
- `-n, --limit <value> - Maximum number of issues to return - (default: "10")`
- `-n, --limit <value> - Maximum number of issues to list - (default: "10")`
- `-s, --sort <value> - Sort by: date, new, freq, user - (default: "date")`
- `--json - Output as JSON`
- `--json - Output JSON`
- `-c, --cursor <value> - Pagination cursor — only for <org>/ mode (use "last" to continue)`

### Orgs

Expand Down Expand Up @@ -615,25 +619,27 @@ List projects

List repositories

#### `sentry repos <org>`
#### `sentry repos <target>`

List repositories

**Flags:**
- `-n, --limit <value> - Maximum number of repositories to list - (default: "30")`
- `--json - Output JSON`
- `-c, --cursor <value> - Pagination cursor (use "last" to continue from previous page)`

### Teams

List teams

#### `sentry teams <org>`
#### `sentry teams <target>`

List teams

**Flags:**
- `-n, --limit <value> - Maximum number of teams to list - (default: "30")`
- `--json - Output JSON`
- `-c, --cursor <value> - Pagination cursor (use "last" to continue from previous page)`

### Logs

Expand Down
Loading
Loading