Skip to content
Docs GitHub

Contributing

We welcome contributions to the Sentry CLI! This guide will help you get started.

Development Setup

Prerequisites

  • Bun runtime (v1.0 or later)
  • Git

Getting Started

Terminal window
# Clone the repository
git clone https://github.com/getsentry/cli.git
cd cli
# Install dependencies
bun install
# Run CLI in development mode
bun run --env-file=.env.local src/bin.ts --help
# Run tests
bun test

Environment Variables

Create a .env.local file for development:

Terminal window
cp .env.example .env.local

Edit .env.local with your development credentials.

Project Structure

cli/
├── src/
│ ├── bin.ts # Entry point
│ ├── app.ts # Stricli application setup
│ ├── context.ts # Dependency injection context
│ ├── commands/ # CLI commands
│ │ ├── auth/ # login, logout, refresh, status, token, whoami
│ │ ├── cli/ # defaults, feedback, fix, setup, upgrade
│ │ ├── dashboard/ # list, view, create, add, edit, delete
│ │ ├── event/ # view, list
│ │ ├── issue/ # list, events, explain, plan, view
│ │ ├── log/ # list, view
│ │ ├── org/ # list, view
│ │ ├── project/ # create, delete, list, view
│ │ ├── release/ # list, view, create, finalize, delete, deploy, deploys, set-commits, propose-version
│ │ ├── repo/ # list
│ │ ├── sourcemap/ # inject, upload
│ │ ├── span/ # list, view
│ │ ├── team/ # list
│ │ ├── trace/ # list, view, logs
│ │ ├── trial/ # list, start
│ │ ├── api.ts # Make an authenticated API request
│ │ ├── 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

Terminal window
# Build for current platform
bun run build
# Build for all platforms
bun run build:all
# Create npm bundle
bun run bundle

Testing

Terminal window
# Run all tests
bun test
# Run specific test file
bun test test/path/to/test.ts
# Run with watch mode
bun test --watch
# Run with coverage
bun test --coverage

Code Style

The project uses Ultracite for linting and formatting:

Terminal window
# Check for issues
bun run lint
# Auto-fix issues
bun run lint:fix
# Type checking
bun run typecheck

Submitting Changes

  1. Fork the repository
  2. Create a feature branch: git checkout -b feat/my-feature
  3. Make your changes
  4. Run tests and linting: bun test && bun run lint
  5. Commit with conventional commits: git commit -m "feat: add new feature"
  6. Push and create a pull request

Conventional Commits

We use conventional commits for automatic changelog generation:

  • feat: - New features
  • fix: - Bug fixes
  • docs: - Documentation changes
  • refactor: - Code refactoring
  • test: - Test changes
  • chore: - Maintenance tasks

Getting Help