CLI Reference
Complete reference for the Spotlight CLI (spotlight-sidecar).
Global Syntax
spotlight-sidecar [command] [options] [arguments]Commands
run - Run Application with Spotlight
Wraps your application and automatically configures Spotlight.
spotlight-sidecar run [options] [command...]Examples:
# Auto-detect from package.jsonspotlight-sidecar run
# Run specific commandspotlight-sidecar run node server.jsspotlight-sidecar run python manage.py runserverspotlight-sidecar run go run main.go
# With custom portspotlight-sidecar run -p 3000 npm start
# With debug loggingspotlight-sidecar run -d node server.jsBehavior:
- Starts Spotlight sidecar server
- Sets
SENTRY_SPOTLIGHTenvironment variable - Sets
SENTRY_TRACES_SAMPLE_RATE=1 - Captures stdout/stderr as logs
- Runs the specified command
Auto-detection:
If no command is provided, looks for these scripts in package.json:
devdevelopservestart
tail - Stream Events
Streams events from Spotlight to your terminal in real-time.
spotlight-sidecar tail [event-types...] [options]Event Types:
errors- Errors and exceptionslogs- Application logstraces- Performance tracesattachments- File attachmentsall,everything,*- All event types
Examples:
# Stream all eventsspotlight-sidecar tail
# Stream only errorsspotlight-sidecar tail errors
# Stream errors and logsspotlight-sidecar tail errors logs
# Stream with JSON formatspotlight-sidecar tail -f json
# Stream traces with logfmt formatspotlight-sidecar tail traces -f logfmt
# Stream on custom portspotlight-sidecar tail -p 3000Behavior:
- Connects to existing sidecar or starts new one
- Streams filtered events to stdout
- Formats output based on
-foption
mcp - Start MCP Server
Starts Spotlight in MCP (Model Context Protocol) mode for integration with AI coding assistants.
spotlight-sidecar mcp [options]Examples:
# Start MCP server on default portspotlight-sidecar mcp
# Start on custom portspotlight-sidecar mcp -p 3000
# Start with debug loggingspotlight-sidecar mcp -dBehavior:
- Starts Spotlight sidecar server
- Enables MCP protocol over stdio
- Provides tools for AI assistants to query errors, logs, and traces
Available MCP Tools:
spotlight.errors.search- Search for errorsspotlight.logs.search- Search for logsspotlight.traces.search- List tracesspotlight.traces.get- Get trace details
server - Start Standalone Server
Starts the Spotlight sidecar server without any additional modes.
spotlight-sidecar server [options]spotlight-sidecar [options] # server is the default commandExamples:
# Start on default port (8969)spotlight-sidecar server
# Start on custom portspotlight-sidecar server -p 3000
# Start with debug loggingspotlight-sidecar server -d
# Shorthand (server is default)spotlight-sidecarspotlight-sidecar -p 3000Behavior:
- Starts the sidecar HTTP server
- Listens for events from Sentry SDKs
- Serves the Spotlight UI at
http://localhost:PORT - Streams events via Server-Sent Events (SSE)
help - Show Help
Displays help information.
spotlight-sidecar helpspotlight-sidecar --helpspotlight-sidecar -hGlobal Options
These options work with all commands:
-p, --port <port>
Specify the port for the sidecar server.
- Type: Number (1-65535 or 0)
- Default:
8969(for most commands),0(forruncommand) - Special:
0= auto-assign random available port
Examples:
spotlight-sidecar -p 3000spotlight-sidecar --port 9000 tail errorsspotlight-sidecar run -p 0 npm start # Random port-d, --debug
Enable debug logging for troubleshooting.
- Type: Boolean
- Default:
false
Examples:
spotlight-sidecar -dspotlight-sidecar --debug tail logsspotlight-sidecar run -d node server.jsOutput includes:
- Detailed server startup information
- Connection status
- Event processing details
- SDK communication logs
-h, --help
Show help message and exit.
Examples:
spotlight-sidecar -hspotlight-sidecar --helpCommand-Specific Options
Tail Command Options
-f, --format <format>
Specify output format for events.
- Type: String
- Options:
human,logfmt,json,md - Default:
human
Examples:
spotlight-sidecar tail -f jsonspotlight-sidecar tail --format logfmt errorsspotlight-sidecar tail errors logs -f mdFormats:
human- Colored, human-readable (default)logfmt- Machine-readable key-value pairsjson- Structured JSON (one per line)md- Markdown format
Environment Variables
SPOTLIGHT_DEBUG
Enable debug logging (alternative to -d flag).
export SPOTLIGHT_DEBUG=1spotlight-sidecar tailSENTRY_SPOTLIGHT
Set by run command to tell SDKs where to send events.
# Automatically set by spotlight-sidecar runSENTRY_SPOTLIGHT=http://localhost:8969/streamSENTRY_TRACES_SAMPLE_RATE
Set by run command to enable 100% trace sampling.
# Automatically set by spotlight-sidecar runSENTRY_TRACES_SAMPLE_RATE=1Exit Codes
0- Success1- General error (invalid arguments, connection failed, etc.)130- Interrupted by user (SIGINT/Ctrl+C)
Configuration Files
Spotlight CLI does not use configuration files. All configuration is done via command-line arguments and environment variables.
Common Patterns
Development Workflow
# Terminal 1: Run your app with Spotlightspotlight-sidecar run
# Terminal 2: Monitor specific eventsspotlight-sidecar tail errors logs
# Browser: View in UIopen http://localhost:8969CI/CD Integration
# Capture events during testsspotlight-sidecar tail -f json > events.json &SPOTLIGHT_PID=$!
# Run testsspotlight-sidecar run npm test
# Cleanupkill $SPOTLIGHT_PIDMulti-Service Setup
# Service 1 (backend)spotlight-sidecar run -p 8969 npm run dev:backend
# Service 2 (frontend - connects to same sidecar)spotlight-sidecar run -p 8969 npm run dev:frontendLog Aggregation
# Stream to file with logfmtspotlight-sidecar tail -f logfmt >> spotlight.log
# Stream to file with JSONspotlight-sidecar tail -f json | jq . >> spotlight.jsonVersion
To check the installed version:
spotlight-sidecar --version# or check package versionnpm list -g @spotlightjs/sidecarPackage Information
- Package:
@spotlightjs/sidecar - Binary:
spotlight-sidecar - Minimum Node Version: 20.0.0
Related Documentation
- Run Command Guide - Detailed guide for running applications
- Tail Command Guide - Detailed guide for streaming events
- MCP Integration - Using Spotlight with AI coding assistants
- Sidecar Documentation - Understanding the sidecar server