gravity-index CLI lets you search the Gravity Index from the command line. The CLI is in the Gravity repository and is not on a package registry. Use it only if you have repository access. For public agent integrations, use the npm MCP server.
Before you start
- Get access to the Gravity repository and clone it.
- Install Python 3.9 or later.
- Get a publisher API key. Every command needs it.
Install
-
Go to your local copy of the Gravity repository.
-
Copy the script to a folder on your
PATH. -
Make sure that
~/.local/binis on yourPATH. Addexport PATH="$HOME/.local/bin:$PATH"to your shell startup file. -
Install
httpx. -
Set your publisher API key.
-
Run a test search.
You see a recommendation, the reasons for it, and a setup link.
Environment variables
Commands
Search
grclid, and the search_id.
To send identity fields for attribution, add flags:
Follow-up
SEARCH_ID with the search_id from the earlier search.