sentry-cli은(는) 무엇을 하나요?
Sentry CLI를 사용하여 명령줄에서 Sentry와 상호작용하는 방법을 안내합니다. 사용자가 이슈, 이벤트, 프로젝트, 조직을 조회하거나 API 호출, CLI를 통한 인증에 대해 물을 때 사용하세요.
개요
Sentry CLI는 Sentry 플랫폼과 상호작용하기 위한 명령줄 도구입니다. 이 도구를 사용하면 개발자가 CI/CD 파이프라인, 스크립트, 또는 터미널에서 직접 Sentry 작업을 수행할 수 있습니다.
설치
Sentry CLI는 여러 가지 방법으로 설치할 수 있습니다:
# macOS (Homebrew)
brew install getsentry/tools/sentry-cli
# Linux / macOS (curl)
curl -sL https://sentry.io/get-cli/ | bash
# Windows (PowerShell)
$env:SENTRY_CLI_VERSION = "2.0.0"
iwr https://github.com/getsentry/sentry-cli/releases/download/$env:SENTRY_CLI_VERSION/sentry-cli-Windows-x86_64.exe -OutFile sentry-cli.exe
인증
Sentry CLI를 사용하려면 인증이 필요합니다. 다음 방법 중 하나를 사용할 수 있습니다:
- 인증 토큰 사용:
SENTRY_AUTH_TOKEN환경 변수 또는.sentryclirc파일에 토큰을 설정합니다. - 로그인 명령어:
sentry-cli login명령어를 실행하여 브라우저 기반 인증을 수행합니다.
# 환경 변수 설정
export SENTRY_AUTH_TOKEN=your_auth_token_here
export SENTRY_ORG=your_org_slug
export SENTRY_PROJECT=your_project_slug
주요 명령어
이슈 조회
# 최근 이슈 목록 보기
sentry-cli issues list
# 특정 프로젝트의 이슈 보기
sentry-cli issues list --project my-project
# 이슈 상세 정보 보기
sentry-cli issues info ISSUE_ID
이벤트 조회
# 이슈의 이벤트 목록 보기
sentry-cli events list ISSUE_ID
# 특정 이벤트 상세 정보 보기
sentry-cli events info EVENT_ID
프로젝트 관리
# 프로젝트 목록 보기
sentry-cli projects list
# 프로젝트 생성
sentry-cli projects create --team my-team --name "New Project"
조직 관리
# 조직 목록 보기
sentry-cli organizations list
# 조직 멤버 보기
sentry-cli organizations members
릴리스 관리
# 새 릴리스 생성
sentry-cli releases new VERSION
# 릴리스에 커밋 연결
sentry-cli releases set-commits VERSION --auto
# 릴리스 배포 완료 표시
sentry-cli releases finalize VERSION
설정 파일
.sentryclirc 파일을 사용하여 기본 설정을 지정할 수 있습니다:
[defaults]
org = my-org-slug
project = my-project-slug
[auth]
token = your-auth-token
[log]
level = info
환경 변수
SENTRY_AUTH_TOKEN: 인증 토큰SENTRY_ORG: 기본 조직 슬러그SENTRY_PROJECT: 기본 프로젝트 슬러그SENTRY_URL: 자체 호스팅 Sentry 인스턴스의 URL (기본값: https://sentry.io)SENTRY_DSN: DSN (데이터 소스 이름)