Dashboard › cli › Distillation
5be368db-51c7-4a1b-af24-eca4aa28f8b5["lore_tm_v1_dxDB1Ou2H5HBbCNS-hWSC6jVxfgSxsVEXc5bETtW0-A","lore_tm_v1_NgGeBVOvGRDcNxyfMIyFJpd7HCPgLjrHt4TeH5SBGpo"]
Date: Sep 10, 2026
package.json for the latest scripts; commands run from packages/cli or from repo root via pnpm --filter sentry run <script>.devDependencies, never dependencies, because everything is bundled at build time via esbuild; CI enforces this through pnpm run check:deps.pnpm add -D <package>.buildRouteMap from ../../lib/route-map.js, never directly from @stricli/core, because the wrapper auto-injects standard subcommand aliases according to existing route keys.buildListCommand commands such as trace/span/dashboard list must directly call resolveCursor, advancePaginationState, hasPreviousPage, and paginationHint.per_page value larger than API_MAX_PER_PAGE; the server silently caps larger values and commands would return fewer items than requested."date", not "time"; sort types should be exported from the API layer (for example, SpanSortValue from api/traces.ts) and imported into commands, matching issue list, trace list, and span list.fuzzyMatch() from src/lib/fuzzy.ts to suggest similar candidates rather than listing all entities; show at most 5 fuzzy matches.fcAssert(property(...), { numRuns: DEFAULT_NUM_RUNS }).*.property.test.ts companion file, unit tests must not re-check the same invariants with hardcoded examples; check the property file before adding unit tests.test:unit in package.json), bounding most cross-file leakage to one worker; within a file, process.env remains shared, so deleting an env var in afterEach can cause later module-level code or beforeEach rereads to receive undefined and throw TypeError: The "paths[0]" property must be of type string. TEST_TMP_DIR is namespaced by VITEST_POOL_ID in test/constants.ts to prevent parallel workers from wiping one anotherβs preload temp state.src/commands/<domain>/; API types in src/types/sentry.ts; config types in src/types/config.ts; Seer types in src/types/seer.ts; utilities in src/lib/; DSN-language support in src/lib/dsn/languages/; DB operations in src/lib/db/; build scripts in script/; property tests in test/lib/<name>.property.test.ts; model-based tests in test/lib/db/<name>.model-based.test.ts; unit tests in test/ mirroring src/; E2E tests in test/e2e/; test helpers in test/model-based/helpers.ts; documentation in docs/src/content/docs/; hand-written command documentation in docs/src/fragments/commands/.packages/cli/src/lib/token-claims.ts defines parseSntrysClaim(token: string | undefined): SntrysClaim | undefined for Sentry org-auth tokens formatted as sntrys_<base64(JSON{iat, url, region_url, org})>_<random-secret>.parseSntrysClaim() accepts only nonempty sntrys_ tokens of at most MAX_TOKEN_LENGTH = 2048, with exactly 2 underscores; it base64-decodes and JSON-parses the payload, requires truthy iat and nonempty string url, and returns { url, regionUrl, org }, with regionUrl derived from region_url and optional org accepted only when nonempty strings.packages/cli/src/lib/token-claims.ts documents that sntrys_ claims are unsigned and forgeable, but legitimate token claims are authoritative and immune to SENTRY_HOST environment-injection attacks; captureEnvTokenHost uses the claim as the primary trust source for sntrys_ tokens ahead of environment variables. Forged-token risk is accepted because supplying a forged token already compromises the credential and is out of the threat model.