Installation
Authentication
Sign in with your Data Legion account (admin or developer role). The CLI opens a sign-in link; confirm the code it shows, and it stores a key for this machine, encrypted on disk:- Each machine gets its own key, named with a random id (such as
cli-3f9a2c7e) that the CLI keeps in its config, so nothing about the machine is sent. Pass--device <name>for a readable label. - Signing in again on the same machine replaces its key. See and disconnect each one on the Connected Apps page.
--team-id <id>picks the team when your account has several;--no-browserprints the link to open on another device.
Person
Enrichment
Look up a person by email, phone, social URL, name, or other identifiers.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 thegenerated_query it ran.
Company
Enrichment
Look up a company by domain, name, ticker, social URL, or other identifiers.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, with 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
Global flags go before the subcommand (datalegion-cli --quiet person enrich ...); placed after it, they are rejected as unknown options.