Skip to content

Support per-repo / per-directory authentication for multi-org users #942

@scefali

Description

@scefali

Problem

sentry auth login stores credentials globally in ~/.sentry/cli.db. There's no way to scope authentication to a specific repository or directory.

For users who work across multiple Sentry organizations (e.g., different orgs for different clients or projects), this means constantly re-authenticating when switching between repos, or manually managing SENTRY_AUTH_TOKEN env vars per project.

Expected behavior

Support project-local or directory-scoped authentication, similar to how git supports per-repo user config or how aws supports named profiles. For example:

  • A .sentry/ directory in the repo root that stores auth for that project
  • Named profiles (sentry auth login --profile myorg) that can be selected per directory
  • A .sentryrc or config file that maps directories to orgs/tokens

Workaround

Setting SENTRY_AUTH_TOKEN per-repo via .env or direnv, but this requires manually creating and managing API tokens outside the CLI's OAuth flow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions