CLI
Install and configure the Levered command-line tool
The Levered CLI runs the setup and monitoring of optimizations from the terminal. Its commands define metrics, create and manage optimizations, serve a variant, verify the exposure logging, read results, and manage API keys. For the warehouse, the CLI selects the Managed Warehouse (levered warehouse use-managed) and reads the status, tables and columns of the connected warehouse. Connections to BigQuery, Snowflake and Postgres are created in the dashboard.
Claude Code plugin
The Levered plugin for Claude Code installs and updates the CLI. With the plugin, no manual CLI setup is needed. Install the plugin:
/plugin marketplace add levered-hq/claude-plugin
/plugin install levered@leveredTurn on auto-update so new plugin versions arrive by themselves: run /plugin, open Marketplaces, select levered, then Enable auto-update. Claude Code updates the plugin in the background, and the new version loads with the next session.
JSON output
The commands that read or create data print JSON with --json. A coding agent can use these commands to define metrics, create optimizations and read results.
# An AI agent can run through the setup programmatically
levered metrics create --name "Sign-ups" --sql "SELECT ..." --anonymous-id-col anon_id --timestamp-col ts --json
levered optimizations create --name "Hero Test" --design-factors '[...]' --reward-metric-id UUID --baseline '{...}' --json
levered optimizations results OPTIMIZATION_ID --jsonInstallation
Install the CLI:
curl -fsSL https://cli.levered.dev/install.sh | bashThe script downloads the latest binary for the platform (macOS arm64, Linux x64), verifies its SHA-256 checksum and installs it to ~/.levered/bin/. For Windows, download the binary from cli.levered.dev.
Verify the installation:
levered --versionAuthentication
Sign in with the browser-based OAuth flow:
levered loginThe command opens the default browser for the sign-in and stores the session tokens locally. The session lasts until levered logout is run or the token expires.
# Check who you are signed in as
levered whoami
# Sign out and clear stored tokens
levered logoutConfiguration
The CLI stores its configuration in ~/.levered/config.json. View and change the settings with the config commands, or edit the file.
| Key | Description |
|---|---|
environment | The Levered environment that the CLI connects to. The default is prod. |
api_url | The API URL of that environment. |
# List all config values
levered config list
# Get a specific value
levered config get environmentThe CLI takes the organization from the login. For JSON output, pass --json to the commands that support it.
Auto-update
On each run, the CLI checks for a newer version in the background. If a newer version is available, the CLI downloads it, verifies it and prints "Update available" with a note to restart. The CLI applies the update on the next run of levered.
To disable auto-update, for example in CI environments, set this environment variable:
export LEVERED_DISABLE_AUTOUPDATE=1Next step
The Commands Reference lists all commands and their options.