CLI Reference
The Gurulu CLI gives you full control over your analytics from the terminal. Manage sites, events, audiences, experiments, warehouses, and more without leaving your editor.
Installation
npm install -g @gurulu/cliRequires Node.js 18 or later. You can also use npx @gurulu/cli without a global install.
Authentication
The CLI uses a device-link flow. Run the auth command and follow the browser prompt:
gurulu authThis opens a browser window where you approve the device. The CLI stores your API key locally at ~/.gurulu/credentials.
For CI environments, set the GURULU_SECRET_KEY environment variable with a secret key from Settings > Developer > API Keys.
Commands
| Command | Description |
|---|---|
| gurulu auth | Authenticate via device-link flow |
| gurulu init | Install tracker in current project |
| gurulu doctor | Validate installation and connectivity |
| gurulu sites list | List all sites in your workspace |
| gurulu sites create | Register a new site |
| gurulu sites get | Get site details |
| gurulu events list | List detected and custom events |
| gurulu events define | Define a custom event |
| gurulu events verify | Verify an event definition fires |
| gurulu audiences list | List audience segments |
| gurulu audiences create | Create an audience segment |
| gurulu insights | Get AI-generated insights |
| gurulu chat | Ask analytics questions in natural language |
| gurulu experiments list | List A/B experiments |
| gurulu experiments create | Create an experiment |
| gurulu alerts list | List configured alerts |
| gurulu alerts create | Create a metric alert |
| gurulu destinations list | List data destinations |
| gurulu destinations create | Add a data destination |
| gurulu warehouses list | List connected warehouses |
| gurulu warehouses sync | Trigger a warehouse sync |
| gurulu api-keys list | List API keys |
| gurulu api-keys create | Create a new API key |
| gurulu audit | View audit log |
| gurulu identity | Manage canonical identity resolution |
| gurulu playground | Open interactive query playground |
Examples
Install tracker in a Next.js project
gurulu init --framework nextjs-app --site-id cmo09... --no-interactiveDefine a signup event
gurulu events define \
--site-id cmo09... \
--name signup_click \
--display-name "Signup Button Click" \
--selector "button#signup" \
--intent signupAsk a question with AI chat
gurulu chat "What is my top converting traffic source this week?"Export insights as JSON
gurulu insights --site-id cmo09... --format json