Dashboard › cli › Distillation
8deecbe2-4bf6-486d-ad8d-c6dc6bb528bf["lore_tm_v1_jl7H_AeuLjGvFgv8XZPII8IpPX6Q2DGDBB6HhCgSUHc","lore_tm_v1_5sqy34TO0_q786XwVjHto_32l71ultJbduykUby-Tsw","lore_tm_v1_4wYSWopC9GcrHXQoweutU0qSd3HgOvLLS_ZcUgDeMrU","lore_tm_v1_CDpUZhive0ypHuIY6eFHof2HR9-R3pwffHKZ4VBsTUE"]
packages/cli/src/lib/command.ts defines every SentryCommandFunction as an async generator: non-streaming commands yield one CommandOutput<T> and may return { hint }; streaming yields render immediately; --json commands must yield one aggregate value when callers need one parseable JSON document because chunks are pretty-printed rather than JSONL; void commands may return without yielding for early exits such as --web.packages/cli/src/lib/command.ts states command hints live exclusively on the CommandReturn return value, never on individual yields.LocalCommandBuilderArguments supports parameters, required docs: CommandDocumentation, func: SentryCommandFunction, optional output?: OutputConfig<any>, optional auth?: boolean | "dsn", and optional skipRcUrlCheck?: boolean.packages/cli/src/lib/command.ts: when output is provided, --json and --fields are injected automatically; commands yield new CommandOutput(data), the wrapper handles JSON/human branching, and void yields are ignored.packages/cli/src/lib/command.ts: auth defaults to true; absent token and refresh-token credentials cause AuthError("not_authenticated") before command execution; expired tokens with a valid refresh token pass so the API client can silently refresh; auth: false is intended for commands such as auth login, auth logout, auth status, help, and cli upgrade; auth: "dsn" is for DSN-authenticated commands such as event send and bypasses both the bearer-token guard and .sentryclirc URL trust check.skipRcUrlCheck behavior: it defaults to false; commands that establish or tear down host trust, including auth login and auth logout, set it to true so they can run when a repository-local .sentryclirc URL differs from the current token.LOG_LEVEL_FLAG accepts LOG_LEVEL_NAMES, and hidden VERBOSE_FLAG defaults to false and means debug-level logging. applyLoggingFlags() gives --log-level priority over --verbose; --verbose selects "debug"; if neither is given, the existing environment/default level remains unchanged.JSON_FLAG is a boolean defaulting to false; FIELDS_FLAG accepts a comma-separated string with dot-notation paths, is pre-parsed by the wrapper into string[], is silently ignored without --json, and exists to reduce token consumption in agent workflows.--org and --project flags are injected into every command to recover older sentry-cli syntax commonly generated by LLMs; their values feed SENTRY_ORG and SENTRY_PROJECT at resolution priority #2 in resolve-target.ts.applyOrgProjectFlags() behavior: explicit compatibility flags overwrite existing environment values because CLI input is highest-priority intent; values are trimmed; empty or whitespace-only values do not overwrite real environment variables; when a command owns --org or --project, that flag is passed through to func() rather than converted to an environment variable.buildCommand() contract states it is the only command builder to use. It injects global flags, intercepts logging flags, captures flags and positionals as Sentry telemetry context, handles output flags/rendering, and enforces authentication by default.buildCommand() behavior states injected flags are stripped so the original command function never sees them.LOG_LEVEL_KEY is "log-level" and is always stripped.ALWAYS_STRIP is new Set([LOG_LEVEL_KEY]); these flags are always stripped and the command never sees them.verbose, injected VERBOSE_FLAG is skipped; the command-owned value still triggers logging side effects and is not stripped. If a command defines its own json, injected JSON_FLAG is skipped.--fields is always injected when output: { human: ... }, including when the command already owns its json flag.buildFieldsFlag() returns the base FIELDS_FLAG when no output schema or no extracted schema fields exist; otherwise it appends Available: ${fieldNames} to the flag brief, with names joined by ", ".enrichDocsWithSchema() leaves docs unchanged without a schema or extracted fields; otherwise it appends formatSchemaForHelp(schemaFields) to fullDescription, using the existing fullDescription or falling back to brief.GLOBAL_FLAG_DEFAULTS maps "log-level" to LOG_LEVEL_FLAG, verbose to VERBOSE_FLAG, org to ORG_FLAG, and project to PROJECT_FLAG.packages/cli/plugins/sentry-cli/skills/sentry-cli/references/project.md has front matter name: sentry-cli-project, version: 0.45.0-dev.0, description: Work with Sentry projects, bins: ["sentry"], and auth: true.sentry project create [<org>/]<name>:<platform>... with flags -t, --team <value> and -n, --dry-run.project create examples are: 1. sentry project create my-new-app:javascript-nextjs (“Create a new project,” preceded by the note that every project is a name:platform pair and names cannot contain whitespace); 2. sentry project create web:javascript api:python-django worker:node (“Create several projects with their own platforms”); 3. sentry project create my-org/my-new-app:python --team backend-team (“Create under a specific org and team”); 4. sentry project create my-new-app:node --dry-run (“Preview without creating”).sentry project delete <org/project> with flags -y, --yes, -f, --force, and -n, --dry-run.apps/cli-docs/src/content/docs/commands/project.md has front matter title: project and description: Project commands for the Sentry CLI.sentry project create [<org>/]<name>:<platform>..., but its arguments table displays [<name:platform...>] with description “One or more project name and platform pairs”; its options table displays -t, --team <team> and -n, --dry-run.sentry project delete <org/project> with argument <org/project> described as <org>/<project> or <project> (search across orgs), and options -y, --yes, -f, --force, and -n, --dry-run.sentry project list [<org/project>].