Skip to main content

CLI

Search the Gravity Index from the command line. The standalone CLI currently ships from the Gravity repo, so use this path if you have repo access; public agent integrations should use the npm MCP server.

Install

From a local Gravity checkout:
cd gravity
mkdir -p ~/.local/bin
cp index/cli/gravity-index ~/.local/bin/gravity-index
chmod +x ~/.local/bin/gravity-index
pip install --user httpx
Make sure ~/.local/bin is on your PATH (add export PATH="$HOME/.local/bin:$PATH" to your shell rc). Requires Python 3.9+. Full install options (MCP, npm wrapper, API) are on the Install page.

Optional configuration

# Override the API URL (defaults to https://index.trygravity.ai)
export GRAVITY_INDEX_URL=https://index.trygravity.ai

Commands

gravity-index search "I need a serverless database"

# With publisher identity metadata for attribution/matching
gravity-index search "I need a serverless database" \
  --external-session-id session_123 \
  --external-user-id-hash sha256_user_id \
  --email-hash sha256_email \
  --metadata-json '{"surface":"chat"}'
Returns the recommendation with reasoning, install steps, env vars, and click link — all color-formatted for the terminal.

Follow-up

gravity-index search "does it support branching?" --follow-up <search_id>

Browse

# All services
gravity-index browse

# Filter by category
gravity-index browse --category Database

# Search
gravity-index browse "vector"

Service details

gravity-index info supabase

Publisher attribution

Set GRAVITY_PUBLISHER_KEY so requests and integrations attribute to your platform:
export GRAVITY_PUBLISHER_KEY=your-publisher-api-key
gravity-index search "auth for Next.js"
Optional private ranking modes for publisher-owned integrations:
export GRAVITY_INDEX_MONETIZATION_MODE=boost_cpa  # or cpa_only, cpa_desc
The CLI does not print economics.