@sonarapp/cli
v0.2.0
Published
Sonar — App Store Optimization from the command line
Maintainers
Readme
@sonarapp/cli
sonar — App Store Optimization from the command line.
Look up apps, research keywords, track rankings, and run competitor analysis on the App Store and Google Play, all from your terminal. Powered by Sonar.
Install
npm install -g @sonarapp/cliRequires Node.js 20+.
Authenticate
Get an API key at trysonar.app/developers (requires a Sonar subscription — 7-day free trial available).
sonar auth loginThis stores your key in ~/.config/sonar/config.json (mode 0600). Or set SONAR_API_KEY in your environment.
export SONAR_API_KEY=aso_...Quick start
# Look up an app
sonar apps get <app-id> --table
# Research a keyword
sonar keywords search "meditation" --store ios --table
# Get autocomplete suggestions
sonar keywords suggestions "med" --store ios --table
# Track a keyword's ranking history
sonar rankings <app-id> --table
# Estimate monthly revenue
sonar revenue --store ios --id 1450772168 --table
# Export rankings to CSV
sonar export rankings <app-id> --format csv > rankings.csvAdd --table for human-readable tables. Default output is JSON, ready to pipe into jq, fx, or other tools.
Commands
sonar auth login Authenticate with your API key
sonar auth status Show authentication status
sonar auth logout Remove saved credentials
sonar apps list List your tracked apps
sonar apps get <id> Show app details
sonar keywords search <query> Keyword research (volume, difficulty)
sonar keywords list <app-id> Keywords your app ranks for
sonar keywords suggestions <seed> Autocomplete suggestions
sonar rankings <app-id> Rank history for an app
sonar rankings keyword <keyword-id> Apps ranking for a keyword
sonar competitors keywords <competitor-id> Competitor keyword analysis
sonar revenue --store <ios|android> --id <id> Estimate monthly revenue
sonar export rankings <app-id> Export rankings to CSV/JSONRun sonar <command> --help for full options.
Global flags
--table Output as a formatted table instead of JSON
--verbose Show request timing and rate-limit info
--base-url <url> Override the API base URL (for self-hosting / staging)Environment variables
| Variable | Description |
|-|-|
| SONAR_API_KEY | Your Sonar API key. Overrides the value in config.json. |
| SONAR_API_URL | API base URL. Default https://trysonar.app. |
| SONAR_CONFIG_PATH | Path to the config file. Default ~/.config/sonar/config.json. |
Companion: MCP server for AI agents
If you want Claude, Cursor, or Cline to drive Sonar directly, install @sonarapp/mcp.
License
MIT © Peter Sutarik
