Resources
Contributing
We welcome contributions to the Sentry CLI! This guide will help you get started.
Development Setup
Section titled “Development Setup”Prerequisites
Section titled “Prerequisites”- Git
Getting Started
Section titled “Getting Started”# Clone the repositorygit clone https://github.com/getsentry/cli.gitcd cli
# Install dependenciespnpm install
# Generate build-time files (API schema, search parser, docs, skills)pnpm run generate:schemapnpm run generate:docs
# Run CLI in development modepnpm run cli --help
# Run testspnpm run testEnvironment Variables
Section titled “Environment Variables”Create a .env.local file for development:
cp packages/cli/.env.example packages/cli/.env.localEdit .env.local with your development credentials. pnpm run cli loads it
automatically. See DEVELOPMENT.md
for when SENTRY_CLIENT_ID is needed.
Project Structure
Section titled “Project Structure”The repository is a pnpm workspace. The CLI lives in packages/cli/, the
documentation site (Astro + Starlight) in apps/cli-docs/, and the Sentry
Local UI in apps/local/.
packages/cli/├── src/│ ├── bin.ts # Entry point│ ├── app.ts # Stricli application setup│ ├── context.ts # Dependency injection context│ ├── commands/ # CLI commands│ │ ├── agent-conversation/# list, view│ │ ├── alert/ # create, delete, edit, list, view│ │ ├── auth/ # login, logout, refresh, status, token, whoami│ │ ├── build/ # download, upload│ │ ├── cli/ # completion, defaults, feedback, fix, import, setup, uninstall, upgrade│ │ ├── code-mappings/# upload│ │ ├── dart-symbol-map/# upload│ │ ├── dashboard/ # add, create, delete, edit, list, restore, revisions, view│ │ ├── debug-files/ # bundle-jvm, bundle-sources, check, find, print-sources, upload│ │ ├── docs/ # list, query│ │ ├── event/ # list, send, view│ │ ├── feedback/ # list, view│ │ ├── issue/ # archive, events, explain, list, merge, plan, resolve, unresolve, view│ │ ├── local/ # run, serve│ │ ├── log/ # list, view│ │ ├── monitor/ # list, run│ │ ├── org/ # list, view│ │ ├── platform/ # list│ │ ├── proguard/ # upload, uuid│ │ ├── project/ # create, delete, list, view│ │ ├── react-native/# gradle, xcode│ │ ├── release/ # archive, create, delete, deploy, deploys, finalize, list, propose-version, restore, set-commits, view│ │ ├── replay/ # list, view│ │ ├── repo/ # list│ │ ├── snapshots/ # diff, download, upload│ │ ├── sourcemap/ # inject, resolve, upload│ │ ├── span/ # list, view│ │ ├── status/ # show│ │ ├── team/ # list│ │ ├── trace/ # list, logs, view│ │ ├── trial/ # list, start│ │ ├── api.ts # Make an authenticated API request│ │ ├── explore.ts # Query aggregate event data (Explore)│ │ ├── help.ts # Help command│ │ ├── info.ts # Print configuration and verify authentication│ │ ├── init.ts # Initialize Sentry in your project (experimental)│ │ ├── schema.ts # Browse the Sentry API schema│ │ └── wasm-split.ts# Add build ids to WebAssembly modules and split out debug data│ ├── lib/ # Shared utilities│ └── types/ # TypeScript types and Valibot schemas├── test/ # Test files (mirrors src/ structure)├── script/ # Build and utility scripts└── plugins/ # Agent skill filesBuilding
Section titled “Building”# Build for current platform (uses esbuild + fossilize for Node SEA packaging)pnpm run build
# Build for all platformspnpm run build:all
# Create npm bundlepnpm run bundleTesting
Section titled “Testing”# Run all unit tests (regenerates docs and the SDK first, with coverage)pnpm run test
# Run a specific test file (path relative to packages/cli; skips the# generate steps, so run `pnpm run test` once first)pnpm --filter sentry exec vitest run test/path/to/test.ts
# Run in watch modepnpm --filter sentry exec vitest
# Run end-to-end testspnpm run test:e2eCode Style
Section titled “Code Style”The project uses Ultracite for linting and formatting:
# Check for issuespnpm run lint
# Auto-fix issuespnpm run lint:fix
# Type checkingpnpm run typecheckSubmitting Changes
Section titled “Submitting Changes”- Fork the repository
- Create a feature branch:
git checkout -b feat/my-feature - Make your changes
- Run tests and linting:
pnpm run test && pnpm run lint - Commit with conventional commits:
git commit -m "feat: add new feature" - Push and create a pull request
Conventional Commits
Section titled “Conventional Commits”We use conventional commits for automatic changelog generation:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesrefactor:- Code refactoringtest:- Test changeschore:- Maintenance tasks
Getting Help
Section titled “Getting Help”- GitHub Issues - Bug reports and feature requests
- GitHub Discussions - Questions and discussions