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 src/commands/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* Similar to 'gh api' for GitHub.
*/

import { buildCommand } from "@stricli/core";
import type { SentryContext } from "../context.js";
import { rawApiRequest } from "../lib/api-client.js";
import { buildCommand } from "../lib/command.js";
import type { Writer } from "../types/index.js";

type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
Expand Down
2 changes: 1 addition & 1 deletion src/commands/log/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
* View detailed information about a Sentry log entry.
*/

import { buildCommand } from "@stricli/core";
import type { SentryContext } from "../../context.js";
import { getLog } from "../../lib/api-client.js";
import {
parseOrgProjectArg,
parseSlashSeparatedArg,
} from "../../lib/arg-parsing.js";
import { openInBrowser } from "../../lib/browser.js";
import { buildCommand } from "../../lib/command.js";
import { ContextError, ValidationError } from "../../lib/errors.js";
import { formatLogDetails, writeJson } from "../../lib/formatters/index.js";
import {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/trace/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
* List recent traces from Sentry projects.
*/

import { buildCommand } from "@stricli/core";
import type { SentryContext } from "../../context.js";
import { listTransactions } from "../../lib/api-client.js";
import { validateLimit } from "../../lib/arg-parsing.js";
import { buildCommand } from "../../lib/command.js";
import {
formatTraceRow,
formatTracesHeader,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/trace/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* View detailed information about a distributed trace.
*/

import { buildCommand } from "@stricli/core";
import type { SentryContext } from "../../context.js";
import { getDetailedTrace } from "../../lib/api-client.js";
import {
Expand All @@ -13,6 +12,7 @@ import {
spansFlag,
} from "../../lib/arg-parsing.js";
import { openInBrowser } from "../../lib/browser.js";
import { buildCommand } from "../../lib/command.js";
import { ContextError, ValidationError } from "../../lib/errors.js";
import {
computeTraceSummary,
Expand Down
10 changes: 9 additions & 1 deletion src/lib/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
* Command Builder with Telemetry
*
* Wraps Stricli's buildCommand to automatically capture flag usage for telemetry.
* Commands should import buildCommand from this module instead of @stricli/core.
*
* ALL commands MUST import `buildCommand` from this module, NOT from `@stricli/core`.
* Importing directly from `@stricli/core` silently bypasses flag/arg telemetry capture.
*
* Correct: import { buildCommand } from "../../lib/command.js";
* Incorrect: import { buildCommand } from "@stricli/core"; // skips telemetry!
*
* Exception: `help.ts` may import from `@stricli/core` because it also needs `run`,
* and the help command has no meaningful flags to capture.
*/

import {
Expand Down
Loading