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
# 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 .env.example .env.localEdit .env.local with your development credentials.
Project Structure
Section titled “Project Structure”cli/├── src/│ ├── bin.ts # Entry point│ ├── app.ts # Stricli application setup│ ├── context.ts # Dependency injection context│ ├── commands/ # CLI commands│ │ ├── alert/ # create, delete, edit, list, view│ │ ├── auth/ # login, logout, refresh, status, token, whoami│ │ ├── cli/ # defaults, feedback, fix, import, setup, upgrade│ │ ├── dashboard/ # add, create, delete, edit, list, restore, revisions, view│ │ ├── event/ # list, send, view│ │ ├── issue/ # archive, events, explain, list, merge, plan, resolve, unresolve, view│ │ ├── local/ # run, serve│ │ ├── log/ # list, view│ │ ├── org/ # list, view│ │ ├── proguard/ # uuid│ │ ├── project/ # create, delete, list, view│ │ ├── release/ # archive, create, delete, deploy, deploys, finalize, list, propose-version, restore, set-commits, view│ │ ├── replay/ # list, view│ │ ├── repo/ # list│ │ ├── sourcemap/ # inject, resolve, upload│ │ ├── span/ # list, view│ │ ├── 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│ │ ├── init.ts # Initialize Sentry in your project (experimental)│ │ └── schema.ts # Browse the Sentry API schema│ ├── lib/ # Shared utilities│ └── types/ # TypeScript types and Zod schemas├── test/ # Test files (mirrors src/ structure)├── script/ # Build and utility scripts├── plugins/ # Agent skill files└── docs/ # Documentation site (Astro + Starlight)Building
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 testspnpm run test
# Run specific test filepnpm run test -- test/path/to/test.ts
# Run with watch modepnpm run test -- --watch
# Run with coveragepnpm run test -- --coverageCode 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