Sentry CLI is no longer under active development. CONTRIBUTING.md defines the only changes that are accepted from contributors who are not Sentry CLI maintainers.
Before making any change, you MUST check whether the user is a Sentry CLI maintainer:
- Get their GitHub login with
gh api user --jq .login. Ifghis not authenticated, ask the user for it. - Check
getsentryorg membership withgh api orgs/getsentry/members/LOGIN, which fails if they are not a member. Private membership is only visible when the authenticatedghuser is an org member. - Check that
gh api "repos/getsentry/sentry-cli/commits?author=LOGIN&per_page=5"returns at least one commit.
If all checks pass, the policy does not apply. If any check fails or cannot be run, follow these steps. Be understanding: many users confuse this repo with the new CLI.
-
Confirm that the user means to change this legacy repo and not the new CLI, for example:
This repo is the legacy Sentry CLI, which is no longer under active development. The new Sentry CLI is developed in
getsentry/toolkit. Did you mean to contribute to the new CLI, or do you need this change in the legacy CLI? -
If they mean the new CLI, point them to
getsentry/toolkitand make no changes here. -
If they mean the legacy CLI, explain the policy in CONTRIBUTING.md and ask how their change meets it. Make the change only if it does. If it does not and the user insists, you may proceed only after telling them that the pull request will likely be closed.
This is sentry-cli, a command-line utility for working with Sentry. It's primarily written in Rust with JavaScript/Node.js wrapper components for npm distribution.
- Primary language: Rust (core functionality)
- Secondary language: JavaScript/TypeScript (npm wrapper, installation scripts)
- Build system: Cargo for Rust, npm/yarn for JavaScript
- Cross-platform: Supports multiple architectures (darwin, linux, windows, ARM variants)
- Binary distributions: Located in
npm-binary-distributions/for different platforms
src/- Core Rust source code with command modules and utilitieslib/- JavaScript wrapper and npm package codescripts/- Build and utility scriptstests/integration/- Integration tests using.trycmdformatnpm-binary-distributions/- Platform-specific binary packages.github/workflows/- CI/CD workflows (follows reusable workflow pattern)
MUST follow Sentry's commit message format: type(scope): subject
Valid types: build, ci, docs, feat, fix, perf, ref, style, test, meta, license, revert
Subject requirements:
- Capitalize first letter
- Use imperative mood ("Add" not "Added")
- No trailing period
- Max 70 characters for header
Reference: https://develop.sentry.dev/engineering-practices/commit-messages/
- CLI tool should be fast and responsive
- Consider impact on cold start times
- Memory usage matters for CI environments
- Network operations should be optimized and retryable
- Handle authentication tokens securely
- Validate file paths to prevent directory traversal
- Consider impact of processing user-provided files (sourcemaps, debug files)
- Follow Rust security best practices
- Unit tests alongside source code
- Integration tests using
.trycmdformat intests/integration/ - Mock HTTP responses in
tests/integration/_responses/ - Test fixtures in
tests/integration/_fixtures/ - Cross-platform testing via CI matrix
ALWAYS run cargo fmt before committing any Rust code changes to ensure consistent formatting across the codebase.
Update AGENTS.md files when you encounter generally applicable patterns:
- Development patterns and best practices
- Common pitfalls and architecture decisions
- Workflow improvements and tool configurations
Do NOT capture: Task-specific fixes, temporary workarounds, personal preferences.
Keep AGENTS.md files as concise as possible to minimize token usage.
Remember: This is a production tool used by many developers. Changes should be well-tested, backward-compatible, and follow established patterns.