Skip to content
scoutappPublic

About

A CLI for interacting with Scout Monitoring data

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Scout APM CLI

A command-line interface for Scout Monitoring. Explore metrics, endpoints, background jobs, traces, errors, insights, and billing usage from the terminal.

Built in Go with Cobra, Lipgloss, BubbleTea, and asciigraph.

Install

Homebrew

brew install scoutapp/tap/scout-cli

On Homebrew 6 and later, third-party taps require tap trust. The fully qualified name above trusts only the scout-cli formula, not the whole tap.

Upgrading from Homebrew 5? If brew upgrade warns that scoutapp/tap is not trusted, grant trust and upgrade again:

brew trust --formula scoutapp/tap/scout-cli   # or: brew trust scoutapp/tap
brew upgrade scout-cli

Brewfile / brew bundle:

brew bundle install --file=- <<'BREWFILE'
tap "scoutapp/tap"
brew "scoutapp/tap/scout-cli", trusted: true
BREWFILE

Use tap "scoutapp/tap", trusted: true instead if you want to trust the whole tap.

Download binary

Pre-built binaries for macOS, Linux, and Windows are available on the GitHub Releases page.

Build from source

git clone https://github.com/scoutapp/scout-cli.git
cd scout-cli
go build -o scout .

Authentication

# Login
scout auth login --key YOUR_API_KEY

# Check auth status
scout auth status

# Clear credentials
scout auth logout

Credentials are stored in a per-user config file whose location follows the platform convention:

Platform Path
macOS ~/Library/Application Support/scout-apm/config.json
Linux $XDG_CONFIG_HOME/scout-apm/config.json, defaulting to ~/.config/scout-apm/config.json
Windows %AppData%\scout-apm\config.json

scout auth status prints the path in use. You can also set the SCOUT_API_KEY environment variable, which takes precedence over the config file.

Usage

Apps

scout apps list
scout apps show 6

Metrics

scout metrics get --type response_time --app 6
scout metrics get --type throughput --app 6 --from 7d

Valid metric types: apdex, response_time, response_time_95th, errors, throughput, queue_time

Endpoints

scout endpoints list --app 6
scout endpoints metrics --endpoint YXBpL21ldHJpY3Mvc2hvdw== --type response_time --app 6

Background Jobs

scout jobs list --app 6
scout jobs metrics --job ZGVmYXVsdC9NeVdvcmtlcg== --type execution_time --app 6
scout jobs metrics --job default/MyWorker --type throughput --app 6   # queue/JobName also works
scout traces list --job ZGVmYXVsdC9NeVdvcmtlcg== --app 6

Valid job metric types: throughput, execution_time, latency, errors, allocations

Job IDs are in the scout jobs list --json output (job_id), or pass the job's queue/JobName full name and the CLI encodes it for you. Job traces can be listed but not yet shown in detail (scout traces show supports endpoint traces only).

Traces

scout traces list --endpoint YXBpL21ldHJpY3Mvc2hvdw== --app 6
scout traces list --job ZGVmYXVsdC9NeVdvcmtlcg== --app 6
scout traces show <trace-id> --app 6

Trace ids come from scout traces list.

Errors

scout errors list --app 6
scout errors show <error-group-id> --app 6
scout errors occurrences <error-group-id> --app 6

Error group ids come from scout errors list.

Anomalies

scout anomalies --app 6                                # List anomaly events (default: all states)
scout anomalies --app 6 --state open                   # Only open anomalies
scout anomalies --app 6 --metric response_time         # Filter by metric
scout anomalies --app 6 --endpoint Controller/users/index   # Filter by endpoint (a name from 'anomalies list', or a Base64 endpoint id)
scout anomalies show 1234 --app 6                      # Detail with smart_monitor and deploy context

Usage

scout usage                                    # Web transaction usage across all apps (last 3 hours)
scout usage --from 30d                         # Last 30 days
scout usage --from 7d --all                    # Include apps with zero usage
scout usage --by-day --from 30d                # Daily totals
scout usage --by-day --by-app --from 30d       # Daily breakdown per app with top endpoints
scout usage --by-day --app 6 --from 30d        # Daily breakdown for one app with top endpoint
scout usage --from 14d --json                  # JSON output
scout usage --billing-period                   # Current billing period, with the server-side billed total
scout usage --by-day --by-app --billing-period # Daily per-app breakdown over the billing period

scout usage counts web transactions from the throughput metric; background jobs are excluded. The billed total, which includes jobs, is shown by scout billing and by scout usage --billing-period.

Billing

scout billing          # Current billing period: APM transactions, nodes, errors, logs
scout billing --json   # Raw JSON from the /usage API endpoint

Shows the exact usage Scout bills against for the current billing period, including plan limits where they apply. scout usage estimates web transactions from throughput metrics; scout billing reports the billed figures, which also include background jobs.

Insights

scout insights list --app 6
scout insights show --type slow_query --app 6

Valid insight types: n_plus_one, memory_bloat, slow_query

Setup

scout setup           # List supported frameworks
scout setup rails     # Show setup docs for a framework

Global Flags

Flag Description
--json Output raw JSON (auto-enabled when piped)
--app <id> Application ID (or set default_app_id in config)
--from <time> Start time — relative (1h, 7d, 30m, 2w) or ISO 8601
--to <time> End time (default: now)
-n, --limit <n> Max number of results to show
--no-color Disable colors (also respects NO_COLOR env)

LLM / Agent Usage

When output is piped, Scout CLI automatically switches to JSON. Tools like Claude Code, scripts, and other agents get structured, parseable output by default — no flags needed. Human-readable tables and charts are used only when writing to a terminal.

# JSON output is automatic when piped
scout apps list | llm "which app has the most endpoints?"

# Force JSON in a terminal
scout metrics get --type response_time --app 6 --json

Configuration

Config file location (see Authentication for the full table): ~/Library/Application Support/scout-apm/config.json on macOS, ~/.config/scout-apm/config.json on Linux. Run scout auth status to print the path in use.

{
  "api_key": "your-api-key",
  "api_url": "https://scoutapm.com",
  "default_app_id": 6
}

Environment variable overrides: SCOUT_API_KEY, SCOUT_API_URL.

Testing

go test ./...

Shell Completion

scout completion bash   # Bash
scout completion zsh    # Zsh
scout completion fish   # Fish

Links

About

A CLI for interacting with Scout Monitoring data

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages