Files
Evan Purkhiser d86aedebf5 feat(installer): add CLI to install the Sentry plugin across AI agents (#180)
Add a pnpm workspace with a `packages/installer` package (`@sentry/ai`)
that provides a single CLI for installing the Sentry plugin into any
supported AI coding assistant: Claude Code, Codex, Cursor, and Grok.

The CLI (built on citty) exposes an `install` subcommand. By default it
shows an interactive selector pre-selecting the detected agents;
`--no-interactive`/`--yes` skips the prompt and installs every detected
agent — used for CI and unattended runs.

Each agent is a self-contained harness implementing a common strategy
interface — detect, isInstalled, canInstall, install — so adding a new
agent is just another module. System access (shell, fs, platform,
homedir) is injected through a SystemDeps seam, keeping every harness
unit-testable without side effects.

Behavior:
- Already-installed agents update in place rather than erroring or
  no-opping: Cursor pulls, Grok/Claude use their update commands, Codex
  re-adds (idempotent; it has no update command).
- Claude refreshes its marketplace index before installing, since a fresh
  CLI ships a stale index that cannot resolve the plugin.
- canInstall gates prerequisites (Cursor needs git) and reports a clear
  skip instead of a cryptic failure.
- One agent failing does not abort the rest, and the CLI exits non-zero
  if any selected agent failed or was blocked.
- Cross-platform: binary detection uses where/which per OS, Cursor is
  located via its per-OS install path, and git paths are quoted for
  Windows spaces.

Distribution:
- rolldown bundles the npm package (deps external).
- fossilize builds standalone Node SEA binaries; --hole-punch drops
  non-English ICU data to cut the download ~30%.

CI:
- A smoke-test matrix (Linux, macOS, Windows) installs the real agent
  CLIs and runs the installer non-interactively, asserting the plugin
  lands for every detected agent.

Instrumented with the Sentry Node SDK.
2026-06-17 13:09:44 -04:00

2.1 KiB

@sentry/ai

Install the Sentry plugin into your AI coding assistants.

The plugin teaches your assistant Sentry — how to set it up in any project, how to find and fix production issues, and how to configure alerts, AI monitoring, and more. This package detects which assistants you have installed and wires the plugin into each one for you.

Supports Claude Code, Codex, Cursor, and Grok.

Usage

Run it with npx, no install required:

npx @sentry/ai install

This detects the AI coding tools on your machine, lets you choose which ones to set up, and installs the Sentry plugin into each. Already have it installed? The same command updates it to the latest version.

Restart your AI tools afterward to load the plugin.

Options

npx @sentry/ai install                  # interactive — pick which agents to set up
npx @sentry/ai install --no-interactive # install into every detected agent

The non-interactive mode is intended for CI and unattended runs.

What it installs

For each detected assistant, the installer runs that tool's native plugin command:

Assistant How it's installed
Claude Code claude plugin install sentry from the official plugin marketplace
Codex codex plugin add sentry from the Sentry plugin marketplace
Cursor Clones getsentry/plugin-cursor into ~/.cursor/plugins/local/sentry
Grok grok plugin install getsentry/plugin-grok

Each per-agent plugin is built and published from the sentry-for-ai repository, which is the source of truth for all skills and commands.

Requirements

  • Node.js 18 or newer
  • The assistant CLI you want to set up must already be installed and on your PATH
  • git is required for the Cursor install

License

MIT