Skip to main content
The official Data Legion CLI lets you enrich, search, and discover person and company data directly from the terminal. It’s fully async, outputs JSON to stdout (logs to stderr), and works as both a human-friendly tool and an AI agent backend. AI coding agents like Claude Code, Cursor, OpenClaw, Cline, and Aider can call it directly as a shell tool.

Installation

Requires Python 3.11+.

Authentication

Set your API key using the built-in encrypted config store or an environment variable.

Person

Enrichment

Look up a person by email, phone, social URL, name, or other identifiers.
All person enrich flags:

Search (Beta)

Query people using SQL syntax. The query is a positional argument.

Discovery (Beta)

Find people using a natural language query — the CLI returns matches plus the generated_query it ran.

Company

Enrichment

Look up a company by domain, name, ticker, social URL, or other identifiers.
All company enrich flags:

Search (Beta)

Query companies using SQL syntax. The query is a positional argument.

Discovery (Beta)

Find companies using a natural language query.

Utilities

Utility commands are free and don’t consume credits.

Clean Fields

Normalize emails, phones, names, domains, and other fields. Pass a JSON payload as a positional argument or via stdin.

Hash Email

Generate privacy-preserving email hashes (SHA-256, SHA-1, MD5). The email is a positional argument.

Validate

Check data format and get cleaning suggestions before enrichment.

Report a Data Issue

Flag an inaccuracy on a person or company record so the Data Legion team can review it. No credit cost. Include at least one of --correct or --comment.

Account

Check Credit Balance

View Usage History

Agent Integration

The CLI is designed for AI agent workflows. Claude Code, Cursor, OpenClaw, Cline, Aider, and other AI coding agents can invoke it as a shell tool — no MCP configuration needed. All structured output goes to stdout as JSON, while logs and progress indicators go to stderr, so agents and scripts can parse results directly.
The CLI and MCP server are complementary. Use MCP for native tool-call integration with AI assistants. Use the CLI when you need shell access, scripting, or want a zero-config option that any agent can call via bash.

Global Flags

Auto-Update

The CLI monitors GitHub releases and can self-update.

Credits

CLI commands consume credits at the same rate as the corresponding REST API endpoints. Utility commands are free.

Rate Limits

The same rate limits apply to CLI requests as to direct API calls.

Resources