Skip to content
Open
Show file tree
Hide file tree
Changes from 9 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/src/content/docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ cli/
│ ├── app.ts # Stricli application setup
│ ├── context.ts # Dependency injection context
│ ├── commands/ # CLI commands
│ │ ├── ai-conversations/# list, view
│ │ ├── auth/ # login, logout, refresh, status, token, whoami
│ │ ├── cli/ # defaults, feedback, fix, import, setup, upgrade
│ │ ├── dashboard/ # list, view, create, add, edit, delete, revisions, restore
Expand Down
33 changes: 33 additions & 0 deletions docs/src/fragments/commands/ai-conversations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@



## Examples

### List conversations

```bash
# List last 10 AI conversations
sentry ai-conversations list

# Explicit organization
sentry ai-conversations list my-org

# Show more, last 24 hours
sentry ai-conversations list --limit 50 --period 24h

# Filter conversations
sentry ai-conversations list -q "has:errors"

# Paginate through results
sentry ai-conversations list my-org -c next
```

### View a conversation transcript

```bash
# View full transcript
sentry ai-conversations view my-org conv-123

# JSON output
sentry ai-conversations view my-org conv-123 --json
```
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 @@ -338,6 +338,15 @@ Make an authenticated API request

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

### Ai-conversations

List and view AI conversations

- `sentry ai-conversations list <org>` — List recent AI conversations
- `sentry ai-conversations view <org> <conversation-id>` — View an AI conversation transcript

→ Full flags and examples: `references/ai-conversations.md`

### CLI

CLI-related commands
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
name: sentry-cli-ai-conversations
version: 0.35.0-dev.0
description: List and view AI conversations
requires:
bins: ["sentry"]
auth: true
---

# Ai-conversations Commands

List and view AI conversations

### `sentry ai-conversations list <org>`

List recent AI conversations

**Flags:**
- `-n, --limit <value> - Number of conversations (1-1000) - (default: "25")`
- `-q, --query <value> - Search query`
- `-t, --period <value> - Time range: "7d", "2026-04-01..2026-05-01", ">=2026-04-01" - (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)`

**JSON Fields** (use `--json --fields` to select specific fields):

| Field | Type | Description |
|-------|------|-------------|
| `conversationId` | string | |
| `flow` | array | |
| `errors` | number | |
| `llmCalls` | number | |
| `toolCalls` | number | |
| `totalTokens` | number | |
| `totalCost` | number | |
| `startTimestamp` | number | |
| `endTimestamp` | number | |
| `traceCount` | number | |
| `traceIds` | array | |
| `firstInput` | string \| null | |
| `lastOutput` | string \| null | |
| `user` | object \| null | |
| `toolNames` | array | |
| `toolErrors` | number | |

**Examples:**

```bash
# List last 10 AI conversations
sentry ai-conversations list

# Explicit organization
sentry ai-conversations list my-org

# Show more, last 24 hours
sentry ai-conversations list --limit 50 --period 24h

# Filter conversations
sentry ai-conversations list -q "has:errors"

# Paginate through results
sentry ai-conversations list my-org -c next
```

### `sentry ai-conversations view <org> <conversation-id>`

View an AI conversation transcript

**Flags:**
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`

**Examples:**

```bash
# View full transcript
sentry ai-conversations view my-org conv-123

# JSON output
sentry ai-conversations view my-org conv-123 --json
```

All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags.
6 changes: 4 additions & 2 deletions script/generate-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,8 @@ function renderNamespaceNode(node: NamespaceNode, indent: string): string {
// Render child namespaces
for (const [name, child] of node.children) {
const childBody = renderNamespaceNode(child, `${indent} `);
parts.push(`${indent}${name}: {\n${childBody}\n${indent}},`);
const key = needsQuoting(name) ? `"${name}"` : name;
parts.push(`${indent}${key}: {\n${childBody}\n${indent}},`);
}

return parts.join("\n");
Expand All @@ -508,7 +509,8 @@ function renderNamespaceTypeNode(node: NamespaceNode, indent: string): string {
// Render child namespaces as nested object types
for (const [name, child] of node.children) {
const childBody = renderNamespaceTypeNode(child, `${indent} `);
parts.push(`${indent}${name}: {\n${childBody}\n${indent}};`);
const key = needsQuoting(name) ? `"${name}"` : name;
parts.push(`${indent}${key}: {\n${childBody}\n${indent}};`);
}

return parts.join("\n");
Expand Down
2 changes: 2 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
UnexpectedPositionalError,
UnsatisfiedPositionalError,
} from "@stricli/core";
import { aiConversationsRoute } from "./commands/ai-conversations/index.js";
import { apiCommand } from "./commands/api.js";
import { authRoute } from "./commands/auth/index.js";
import { whoamiCommand } from "./commands/auth/whoami.js";
Expand Down Expand Up @@ -83,6 +84,7 @@ const PLURAL_TO_SINGULAR: Record<string, string> = {
/** Top-level route map containing all CLI commands */
export const routes = buildRouteMap({
routes: {
"ai-conversations": aiConversationsRoute,
help: helpCommand,
auth: authRoute,
cli: cliRoute,
Expand Down
26 changes: 26 additions & 0 deletions src/commands/ai-conversations/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* sentry ai-conversations
*
* List and view AI conversations from Sentry Explore.
*/

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

export const aiConversationsRoute = buildRouteMap({
routes: {
list: listCommand,
view: viewCommand,
},
defaultCommand: "list",
docs: {
brief: "List and view AI conversations",
fullDescription:
"List and view AI conversations from Sentry Explore.\n\n" +
"Commands:\n" +
" list List recent AI conversations\n" +
" view View a conversation transcript\n",
hideRoute: {},
},
});
Loading
Loading