SEER CLI Documentation

Monitor any command-line script without modifying code

What is SEER CLI?

SEER CLI is a command-line tool that wraps your existing scripts and automatically sends execution data to SEER for monitoring. No code changes required - just prefix your commands with seer run.

Key Features

  • Zero Code Changes: Monitor existing scripts without modifications
  • Automatic Log Capture: Captures stdout and stderr automatically
  • Offline Resilience: Queues failed reports and retries when online
  • Cross-Platform: Works on Linux, macOS, and Windows
  • Language Agnostic: Works with Python, Node.js, Shell scripts, and more

Installation

Quick Install (Linux/macOS)

curl -fsSL https://seer.ansrstudio.com/install.sh | sh

Prefer manual installation? Download binaries directly

Manual Installation

Download the latest binary for your platform:

Verify Installation

seer --version

Configuration

SEER CLI needs two environment variables to communicate with SEER:

Required Environment Variables

export SEER_API_KEY="your-api-key-here"

Get your API key from your SEER dashboard settings.

Optional: Add to Shell Profile

Add these to your ~/.bashrc or ~/.zshrc for persistence:

# Add to ~/.bashrc or ~/.zshrc
export SEER_API_KEY="your-api-key-here"

Basic Usage

Wrap any command with seer run to monitor it:

Python Script

seer run  "Daily Report" python daily_report.py

Node.js Script

seer run  "Data Sync" node sync-data.js

Shell Script

seer run  "Backup Database" ./backup.sh

Any Command

seer run  "Docker Cleanup" docker system prune -af

Advanced Features

Custom Metadata

Attach custom metadata to your runs for better tracking:

seer run  "ETL Pipeline" --metadata '{"environment":"production","version":"2.1.0"}' 
  python etl.py

Capture Output

SEER automatically captures stdout and stderr. Logs are visible in your dashboard.

Offline Mode

If SEER API is unreachable, the CLI stores failed reports locally and automatically retries when back online:

# Run even if API is down
seer run  "Critical Job" python script.py

# Later, retry failed reports
seer replay-failed

Command Reference

seer run

Execute and monitor a command

seer run [OPTIONS] COMMAND [ARGS...]

Options:
  --metadata JSON    Add custom metadata
  --capture-logs BOOLEAN      Capture logs from job run
  --help                  Show help message

seer replay-failed

Retry previously failed API reports

seer replay-failed

seer version

Show CLI version

seer --version

Common Use Cases

Cron Jobs

Monitor scheduled tasks:

# Crontab entry
0 2 * * * /usr/local/bin/seer run  "Nightly Backup" /path/to/backup.sh

CI/CD Pipelines

Track deployment scripts:

# GitHub Actions / GitLab CI
seer run  "Deploy Production" \
  --metadata '{"commit":"$GITHUB_SHA"}' \
  ./deploy.sh

Data Processing

Monitor ETL jobs:

seer run  "Daily ETL" \
  --metadata '{"source":"warehouse"}' \
  python process_data.py

System Maintenance

Track maintenance scripts:

seer run  "Log Rotation" \
  logrotate /etc/logrotate.conf

Troubleshooting

CLI Not Found

If seer command is not found after installation:

# Check if binary is in PATH
which seer

# Add to PATH if needed
export PATH="$HOME/.local/bin:$PATH"

Authentication Errors

If you see authentication errors:

  • Verify your API key is correct
  • Check SEER_API_KEY environment variable is set
  • Regenerate API key from dashboard settings

Failed Reports

If reports fail to send:

# Check stored failed reports
ls ~/.seer/failed_reports/

# Retry all failed reports
seer replay-failed

Permission Denied

On Linux/macOS, ensure the binary is executable:

chmod +x /usr/local/bin/seer

Next Steps