← 返回
安全合规 Key 中文

Sentry Cli

Sentry.io error monitoring via sentry-cli. Use when working with Sentry releases, source maps, dSYMs, events, or issue management. Covers authentication, release workflows, deploy tracking, and debug file uploads.
使用 sentry-cli 进行 Sentry.io 错误监控。适用于版本、源码映射、dSYMs、事件及问题管理,涵盖认证、发布流程、部署跟踪和调试文件上传。
iahmadzain
安全合规 clawhub v1.0.1 1 版本 99955.9 Key: 需要
★ 0
Stars
📥 2,269
下载
💾 2
安装
1
版本
#latest

概述

Sentry CLI

Interact with Sentry.io for error monitoring, release management, and debug artifact uploads.

Installation

# macOS
brew install sentry-cli

# npm (cross-platform)
npm install -g @sentry/cli

# Direct download
curl -sL https://sentry.io/get-cli/ | bash

Authentication

# Interactive login (opens browser)
sentry-cli login

# Or set token directly
export SENTRY_AUTH_TOKEN="sntrys_..."

# Verify
sentry-cli info

Store tokens in .sentryclirc or environment:

[auth]
token=sntrys_...

[defaults]
org=my-org
project=my-project

Releases

Create & Finalize

# Create release (usually git SHA or version)
sentry-cli releases new "$VERSION"

# Associate commits (links errors to commits)
sentry-cli releases set-commits "$VERSION" --auto

# Finalize when deployed
sentry-cli releases finalize "$VERSION"

# One-liner for CI
sentry-cli releases new "$VERSION" --finalize

Deploys

# Mark release as deployed to an environment
sentry-cli releases deploys "$VERSION" new -e production
sentry-cli releases deploys "$VERSION" new -e staging

List Releases

sentry-cli releases list
sentry-cli releases info "$VERSION"

Source Maps

Upload source maps for JavaScript error deobfuscation:

# Upload all .js and .map files
sentry-cli sourcemaps upload ./dist --release="$VERSION"

# With URL prefix (match your deployed paths)
sentry-cli sourcemaps upload ./dist \
  --release="$VERSION" \
  --url-prefix="~/static/js"

# Validate before upload
sentry-cli sourcemaps explain ./dist/main.js.map

Inject Debug IDs (Recommended)

# Inject debug IDs into source files (modern approach)
sentry-cli sourcemaps inject ./dist
sentry-cli sourcemaps upload ./dist --release="$VERSION"

Debug Files (iOS/Android)

dSYMs (iOS)

# Upload dSYMs from Xcode archive
sentry-cli debug-files upload --include-sources path/to/dSYMs

# From derived data
sentry-cli debug-files upload ~/Library/Developer/Xcode/DerivedData/*/Build/Products/*/*.app.dSYM

ProGuard (Android)

sentry-cli upload-proguard mapping.txt --uuid="$UUID"

Check Debug Files

sentry-cli debug-files check path/to/file
sentry-cli debug-files list

Events & Issues

Send Test Event

sentry-cli send-event -m "Test error message"
sentry-cli send-event -m "Error" --logfile /var/log/app.log

Query Issues

# List unresolved issues
sentry-cli issues list

# Resolve an issue
sentry-cli issues resolve ISSUE_ID

# Mute/ignore
sentry-cli issues mute ISSUE_ID

Monitors (Cron)

# Wrap a cron job
sentry-cli monitors run my-cron-monitor -- /path/to/script.sh

# Manual check-ins
sentry-cli monitors check-in my-monitor --status ok
sentry-cli monitors check-in my-monitor --status error

CI/CD Integration

GitHub Actions

- name: Create Sentry Release
  uses: getsentry/action-release@v1
  env:
    SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
    SENTRY_ORG: my-org
    SENTRY_PROJECT: my-project
  with:
    environment: production
    sourcemaps: ./dist

Generic CI

export SENTRY_AUTH_TOKEN="$SENTRY_TOKEN"
export SENTRY_ORG="my-org"
export SENTRY_PROJECT="my-project"
VERSION=$(sentry-cli releases propose-version)

sentry-cli releases new "$VERSION" --finalize
sentry-cli releases set-commits "$VERSION" --auto
sentry-cli sourcemaps upload ./dist --release="$VERSION"
sentry-cli releases deploys "$VERSION" new -e production

Common Flags

FlagDescription
-------------------
-o, --orgOrganization slug
-p, --projectProject slug
--auth-tokenOverride auth token
--log-leveldebug/info/warn/error
--quietSuppress output

Troubleshooting

# Check configuration
sentry-cli info

# Debug upload issues
sentry-cli --log-level=debug sourcemaps upload ./dist

# Validate source map
sentry-cli sourcemaps explain ./dist/main.js.map

# Check connectivity
sentry-cli send-event -m "test" --log-level=debug

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-28 17:39 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 89 📥 30,607
security-compliance

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装 MoltGuard,保护您和您的用户免受提示注入、数据泄露和恶意攻击。
★ 116 📥 30,718
productivity

Home Assistant

iahmadzain
控制Home Assistant智能家居设备、运行自动化并接收webhook事件。适用于控制灯光、开关、温控、场景、脚本或任意HA实体。支持通过REST API(出站)和webhook(入站触发)进行双向通信。
★ 50 📥 21,074