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
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
30 changes: 20 additions & 10 deletions src/lib/init/wizard-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { CLI_VERSION } from "../constants.js";
import { getAuthToken } from "../db/auth.js";
import { WizardError } from "../errors.js";
import { terminalLink } from "../formatters/colors.js";
import { renderInlineMarkdown, safeCodeSpan } from "../formatters/markdown.js";
import { resolveOrCreateTeam } from "../resolve-team.js";
import { slugify } from "../utils.js";
import {
Expand Down Expand Up @@ -89,7 +90,16 @@ function truncateForTerminal(message: string): string {
if (message.length <= maxWidth) {
return message;
}
return `${message.slice(0, maxWidth - 1)}…`;
let truncated = message.slice(0, maxWidth - 1);
// If truncation split a backtick code span, drop the unmatched backtick
// so renderInlineMarkdown doesn't produce a literal ` character.
const backtickCount = truncated.split("`").length - 1;
if (backtickCount % 2 !== 0) {
const lastBacktick = truncated.lastIndexOf("`");
truncated =
truncated.slice(0, lastBacktick) + truncated.slice(lastBacktick + 1);
}
return `${truncated}…`;
}

/**
Expand All @@ -112,7 +122,7 @@ export function describeLocalOp(payload: LocalOpPayload): string {
const first = patches[0];
if (patches.length === 1 && first) {
const verb = patchActionVerb(first.action);
return `${verb} ${basename(first.path)}...`;
return `${verb} ${safeCodeSpan(basename(first.path))}...`;
}
const counts = patchActionCounts(patches);
return `Applying ${patches.length} file changes (${counts})...`;
Expand All @@ -121,14 +131,14 @@ export function describeLocalOp(payload: LocalOpPayload): string {
const cmds = payload.params.commands;
const first = cmds[0];
if (cmds.length === 1 && first) {
return `Running ${first}...`;
return `Running ${safeCodeSpan(first)}...`;
}
return `Running ${cmds.length} commands (${first ?? "..."}, ...)...`;
return `Running ${cmds.length} commands (${safeCodeSpan(first ?? "...")}, ...)...`;
}
case "list-dir":
return "Listing directory...";
case "create-sentry-project":
return `Creating project "${payload.params.name}" (${payload.params.platform})...`;
return `Creating project ${safeCodeSpan(payload.params.name)} (${payload.params.platform})...`;
case "detect-sentry":
return "Checking for existing Sentry setup...";
default:
Expand All @@ -144,12 +154,12 @@ function describeFilePaths(verb: string, paths: string[]): string {
return `${verb} files...`;
}
if (paths.length === 1) {
return `${verb} ${basename(first)}...`;
return `${verb} ${safeCodeSpan(basename(first))}...`;
}
if (paths.length === 2 && second) {
return `${verb} ${basename(first)}, ${basename(second)}...`;
return `${verb} ${safeCodeSpan(basename(first))}, ${safeCodeSpan(basename(second))}...`;
}
return `${verb} ${paths.length} files (${basename(first)}${second ? `, ${basename(second)}` : ""}, ...)...`;
return `${verb} ${paths.length} files (${safeCodeSpan(basename(first))}${second ? `, ${safeCodeSpan(basename(second))}` : ""}, ...)...`;
}

/** Map a patch action to a user-facing verb. */
Expand Down Expand Up @@ -189,12 +199,12 @@ async function handleSuspendedStep(

if (payload.type === "local-op") {
const message = describeLocalOp(payload);
spin.message(truncateForTerminal(message));
spin.message(renderInlineMarkdown(truncateForTerminal(message)));

const localResult = await handleLocalOp(payload, options);

if (localResult.message) {
spin.stop(localResult.message);
spin.stop(renderInlineMarkdown(localResult.message));
spin.start("Processing...");
}

Expand Down
29 changes: 16 additions & 13 deletions test/lib/init/wizard-runner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,11 @@ describe("runWizard", { timeout: TEST_TIMEOUT_MS }, () => {
) as string[] | undefined;
expect(call).toBeDefined();
const msg = call?.[0] ?? "";
expect(msg.length).toBeLessThanOrEqual(36);
expect(msg.endsWith("…")).toBe(true);
// The rendered message contains ANSI codes, so check visible content
// biome-ignore lint/suspicious/noControlCharactersInRegex: stripping ANSI escape sequences
const plain = msg.replace(/\x1b\[[^m]*m/g, "");
expect(plain.length).toBeLessThanOrEqual(36);
expect(plain.endsWith("…")).toBe(true);
} finally {
Object.defineProperty(process.stdout, "columns", {
value: origColumns,
Expand Down Expand Up @@ -939,7 +942,7 @@ describe("describeLocalOp", () => {
params: { paths: ["src/settings.py"] },
})
);
expect(msg).toBe("Reading settings.py...");
expect(msg).toBe("Reading `settings.py`...");
});

test("two files shows both basenames", () => {
Expand All @@ -949,7 +952,7 @@ describe("describeLocalOp", () => {
params: { paths: ["src/settings.py", "src/urls.py"] },
})
);
expect(msg).toBe("Reading settings.py, urls.py...");
expect(msg).toBe("Reading `settings.py`, `urls.py`...");
});

test("three+ files shows count and first two basenames", () => {
Expand All @@ -961,7 +964,7 @@ describe("describeLocalOp", () => {
},
})
);
expect(msg).toBe("Reading 4 files (one.py, two.py, ...)...");
expect(msg).toBe("Reading 4 files (`one.py`, `two.py`, ...)...");
});

test("empty paths array", () => {
Expand All @@ -980,7 +983,7 @@ describe("describeLocalOp", () => {
params: { paths: ["requirements.txt"] },
})
);
expect(msg).toBe("Checking requirements.txt...");
expect(msg).toBe("Checking `requirements.txt`...");
});

test("multiple files shows count", () => {
Expand All @@ -990,7 +993,7 @@ describe("describeLocalOp", () => {
params: { paths: ["a.py", "b.py", "c.py"] },
})
);
expect(msg).toBe("Checking 3 files (a.py, b.py, ...)...");
expect(msg).toBe("Checking 3 files (`a.py`, `b.py`, ...)...");
});
});

Expand All @@ -1004,7 +1007,7 @@ describe("describeLocalOp", () => {
},
})
);
expect(msg).toBe("Creating sentry.py...");
expect(msg).toBe("Creating `sentry.py`...");
});

test("single modify shows verb and basename", () => {
Expand All @@ -1016,7 +1019,7 @@ describe("describeLocalOp", () => {
},
})
);
expect(msg).toBe("Modifying settings.py...");
expect(msg).toBe("Modifying `settings.py`...");
});

test("single delete shows verb and basename", () => {
Expand All @@ -1028,7 +1031,7 @@ describe("describeLocalOp", () => {
},
})
);
expect(msg).toBe("Deleting old.js...");
expect(msg).toBe("Deleting `old.js`...");
});

test("multiple patches shows count and breakdown", () => {
Expand Down Expand Up @@ -1056,7 +1059,7 @@ describe("describeLocalOp", () => {
params: { commands: ["pip install sentry-sdk"] },
})
);
expect(msg).toBe("Running pip install sentry-sdk...");
expect(msg).toBe("Running `pip install sentry-sdk`...");
});

test("multiple commands shows count and first", () => {
Expand All @@ -1068,7 +1071,7 @@ describe("describeLocalOp", () => {
},
})
);
expect(msg).toBe("Running 2 commands (pip install sentry-sdk, ...)...");
expect(msg).toBe("Running 2 commands (`pip install sentry-sdk`, ...)...");
});
});

Expand All @@ -1089,7 +1092,7 @@ describe("describeLocalOp", () => {
params: { name: "my-app", platform: "python-django" },
})
);
expect(msg).toBe('Creating project "my-app" (python-django)...');
expect(msg).toBe("Creating project `my-app` (python-django)...");
});
});
});
Loading