Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Make CLI project team optional with default

Abierto
#1,375 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
javascript, typescript
Área
api, cli

Línea de trabajo

Empieza leyendo packages/cli/src/lib/init/preflight.ts, packages/cli/src/commands/project/create.ts y packages/cli/src/lib/resolve-team.js. Traza cómo init decide entre proyectos existentes y nuevos, y cómo createProjectWithDsn y createProjectWithAutoTeam resuelven los equipos y los endpoints. Se considera terminado cuando los equipos omitidos siguen la inferencia local propuesta, mientras que los equipos explícitos y los flujos de proyectos existentes conservan su comportamiento previsto.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

sentry init and sentry project create still force team selection too often, even when the org has one sensible default. Until the upstream API provides an implied default, the CLI should make team optional and infer it locally.

Current behavior

sentry init
  • Without an explicit target, multi-org accounts hit a flat org select first ("Which organization should the project be created in?" in packages/cli/src/lib/init/preflight.ts) with no create-org option and weak defaulting.
  • Preflight then may prompt for a team ("Which team should own this project?") before project create/select is decided — team is only relevant when creating a project, and should come after that decision.
  • New vs existing project is not auto-resolved from local signals (repo URL, cwd/git name, etc.); create-new is not an obvious top-level choice unless existing in-codebase Sentry metadata is already detected.
sentry project create
  • Team is still a first-class create input via --team / team resolution (packages/cli/src/commands/project/create.ts, packages/cli/src/lib/resolve-team.js).
  • Happy path still resolves a concrete team before posting to the team-scoped create endpoint (createProjectWithDsn → POST /teams/{org}/{team}/projects/).
  • There is already a member fallback that posts to the org-scoped endpoint and lets the server auto-create a personal team-{username} (createProjectWithAutoTeam), but that is not the same as quietly defaulting to an existing org default team when the caller omits team.

Gap

  • Flow order forces org/team picking before the real decision (new vs existing project), and does not use local repo signals to skip those steps.
  • Team selection is noise for existing-project paths and still too prominent for headless create paths.
  • Headless/agent project creation remains awkward because callers must understand teams even when they have no meaningful preference.
  • Client-side inference is needed now; upstream API defaulting is tracked separately and may land later.

User stories

  • As a new user running sentry init, I do not want an early team prompt before I even decide whether I am creating or selecting a project.
  • As a headless/CLI user creating a project, I want to omit --team and still succeed.
  • As a member of a single-team org, I want create flows to default to that team without prompting.
  • As a member of a multi-team org, I still want an explicit team choice to win when supplied.
  • As someone creating projects into a large existing org, I do not want a surprising personal team-{me} fork just because team was omitted.

Proposed solution

Reporter proposal for CLI-local behavior until (or unless) upstream API defines an implied default:

  • Make team optional across create paths (sentry init create branch and sentry project create).
  • When omitted, infer a deterministic default team (existing single accessible team / earliest active default-team behavior; do not invent a new personal team when a real default already exists).
  • Keep explicit --team / explicit team selection unchanged.
  • For init specifically: resolve org → decide new vs existing project from local signals → only then collect create-specific details, and skip team entirely when it can be inferred.
  • Prefer create-new first only when there is no likely match; otherwise auto-select the match. Create-new vs select-existing should be top-level choices.
  • Migrate to upstream implied-default API behavior when available.

Related:

Requested by David Cramer.

--

View Junior Session [Sentry]

Lenguaje dominante
TypeScript
Estrellas
121
Forks
14
Merge medio
23 h 54 min
PR fusionados (30 d)
103

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de getsentry/cli

Todos los issues de getsentry/cli

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.