Skip to main content
The Formo CLI (@formo/cli) provides access to Formo analytics and API resources from the command line. Use it interactively in your terminal, in shell scripts, or as a tool for AI agents.

Profiles

Fetch, search, and update wallet profiles and labels

Query

Run SQL queries on your data

Analytics

Run pre-built analytics pipes (KPIs, funnels, retention, revenue)

Events

Send raw analytics events with a project SDK write key

Boards

Create and manage dashboard boards

Charts

Create and manage charts within custom dashboards

Alerts

Configure project alerts

Contracts

Register and manage tracked smart contracts

Segments

Create and manage user segments

Import

Import wallet addresses

Command Coverage

The CLI covers the main Formo API resources:

Installation

Install the CLI globally via npm:
Or run without installing using npx:

Quick start

Authentication

The CLI supports two authentication methods. The environment variable takes precedence over the saved config file.
Save your API key to the local config file (~/.config/formo/config.json):
The CLI validates your key against the API, saves the key along with your workspace and project info, and confirms that you’re authenticated.
Get your API key from Settings → API in the Formo dashboard.

Global commands

formo login

Authenticate with your Formo API key. Validates the key against the API and saves it locally.

formo logout

Remove saved API key and clear authentication from ~/.config/formo/config.json.
If the FORMO_API_KEY environment variable is set, logout will warn you to also run unset FORMO_API_KEY.

formo status

Show the current authentication and CLI status, including the active API key source, workspace, and project ID.
Output includes:
  • Whether you are authenticated
  • API key source (config file or FORMO_API_KEY env var)
  • Workspace name
  • Project ID

Configuration

The CLI stores configuration at ~/.config/formo/config.json with restricted permissions (600). The config file contains:

Environment Overrides

Output format

By default, commands print compact, human-readable TOON output. Pass one of the standard output flags to change the format: Status messages (login confirmation, errors, and similar) are written to stderr in interactive terminals, so they never pollute piped output.

AI agent usage

The CLI is designed to work as a tool for AI agents. It includes built-in suggestions for natural language queries:
  • “get the profile for wallet 0xabc”
  • “search profiles with net worth > 10000”
  • “run a SQL query on my analytics data”
  • “show traffic KPIs for the last 7 days”
  • “get the conversion funnel for the last month”
  • “list the top wallets by activity”
  • “search profiles ordered by last_onchain desc”
  • “list all project alerts”
  • “create an alert for high-value transactions”
  • “list charts in a board”
  • “create a line chart in a board”
  • “move or duplicate a dashboard chart”
  • “list all tracked contracts”
  • “register a new smart contract”
  • “list user segments”
  • “import wallet addresses”
  • “batch update profile properties with profiles properties batch”
  • “batch upsert labels for wallets”
  • “send raw analytics events”

Agent Integrations

The CLI is built with incur, so agents can discover and call commands through structured metadata:
--llms and --llms-full print documentation without executing API operations. Use --llms to find a command, then its --help or --schema output to construct a request. For scripts and agents, use --format json and supply FORMO_API_KEY through the environment. The key determines the active project and permitted scopes.

Formo Analytics skill

Install the repository’s analytics skill for Claude Code and Codex:
The skill explains when to use the CLI, REST API, or hosted Formo MCP. The hosted MCP additionally provides live schema and endpoint discovery, documentation search, natural-language SQL, and tools such as project_users, distinct_values, cohort_analysis, and web_vitals. These MCP-only endpoints are not CLI analytics subcommands or public REST pipe routes.