Dashboard › cli › Distillation
9d86228a-57ac-4163-9599-1088f43922c5["lore_tm_v1_EjTPtXKjEs8-2noC4dj-HW6B-xhlKqQUiPOFQnKsZZU"]
devDependencies, never dependencies, because everything is bundled with esbuild; CI enforces this through pnpm run check:deps.pnpm add -D <package> using the -D flag.@sentry/api provides response types, those types must be imported directly from @sentry/api rather than duplicated as Valibot schemas in src/types/sentry.ts.node:* APIs; it was migrated from Bun, so Bun.* globals, bun:test, and bun CLI commands must not be reintroduced.async *func() generators, yield new CommandOutput(data), and return { hint }.output.human must receive the same data object serialized to JSON, with no divergent data paths.--json and --fields; commands must not define their own json flag, call stdout.write(), or branch with if (flags.json).-c next increments the index, -c prev decrements it, -c first resets it to 0, "last" silently aliases "next", and back-then-forward truncates the stack to prevent stale entries.buildListCommand with manual pagination, including trace/span/dashboard list commands, must directly call resolveCursor, advancePaginationState, hasPreviousPage, and paginationHint.per_page value greater than API_MAX_PER_PAGE, because the server silently caps oversized values and can make a command return fewer items than requested.ContextError.command must be a single-line CLI usage example such as "sentry org view <slug>"; its constructor throws if command contains \n.ContextError should receive alternatives: [] when defaults are irrelevant, such as for a missing Trace ID or Event ID.ContextError.resource values should use " and ", for example "Trace ID and span ID", so the generated grammar uses βare required.βreplay-search.ts for replay-specific field resolution.src/lib/org-list.ts provides dispatchOrgScopedList with OrgListConfig and four handler modes: auto-detect, explicit, org-all, and project-search; complex commands such as project list and issue list invoke it directly with an overrides map rather than using buildOrgListCommand.delete process.env.SENTRY_CONFIG_DIR, capturing const baseDir = process.env[CONFIG_DIR_ENV_VAR]! at module scope, or manually setting/deleting SENTRY_CONFIG_DIR in beforeEach/afterEach, because these patterns can pollute later test files or capture stale values.fcAssert(property(...), { numRuns: DEFAULT_NUM_RUNS }).awaited and their return values must not be forgotten.async/await instead of promise chains, handle errors appropriately with try-catch, and never use an async function as a Promise executor.