Skip to main content
The official command-line interface for the CompanyEnrich API. It covers every v2 endpoint, prints tables at a terminal and JSON when piped, and estimates credit costs before it spends them. That makes it work for people, shell scripts, and AI agents.
The README lists every search filter and more recipes. Every command also has --help with examples and its credit cost.

Install

  • The npm package needs Node.js 22 or newer. To run it once without installing, use npx @companyenrich/cli.
  • Homebrew and the install script fetch a standalone binary for macOS or Linux, so you don’t need Node.js.
  • The install script verifies the download’s SHA-256 and puts the binary in ~/.local/bin. Set COMPANYENRICH_INSTALL_DIR to change the location, or COMPANYENRICH_VERSION to pin a version.
  • On Alpine, run apk add libstdc++ libgcc first.
  • On Windows, use npm or download the zip from Releases.

Sign in

Create an API key at app.companyenrich.com/access-keys, then:
me is free, so it is the quickest way to confirm your key works. The CLI looks for a key in this order:
  1. The --api-key flag.
  2. The COMPANYENRICH_API_KEY environment variable.
  3. The key saved by auth login in ~/.companyenrich/api_key, a file only your user can read.
auth status shows which key is in use, and auth logout removes the saved one.

Commands

Run any command with --help to see its flags, examples, and price. See Credits for how credits work. Company search has three modes, and filters work with all of them:
People search filters on the person, their current and past roles, and the kind of company they work at:
A few rules apply to every filter:
  • Lists take commas or repeated flags: --country US,CA or --country US --country CA.
  • Exclusions use an exclude- prefix: --exclude-country US --exclude-keyword agency.
  • Ranges use ..: 2015..2020, 2020.. for 2020 or later, ..2010 for 2010 or earlier.
  • Amounts take suffixes: 500k, 2.5M, 1B.
  • Company filters on people use a company- prefix: --company-country US, --company-semantic "developer tools".
The CLI validates values before it sends anything, so a typo in a filter costs nothing.

Paging

Searches return 10 results unless you ask for more.
--all counts the matches first, which is free, then fetches exactly that many. If a page fails partway or you press Ctrl-C, the CLI still writes what it already fetched, along with the cursor to resume from. You paid for those pages, so none of them are thrown away.

Output

At a terminal you get tables. When output is piped or written to a file you get JSON in the same shape the API returns.
--fields takes dot paths. A name applied to a list maps over it, so experiences.company.name returns every employer. With -o, the CLI checks that it can write the file before it sends the request. A bad path fails right away, not after the credits are spent.

Control credit spend

Most calls cost credits, so the CLI gives you three ways to avoid surprises.
1

Size the search for free

company count, people count, and the preview commands cost nothing.
2

Preview the request

--dry-run prints the exact request and a credit estimate, and sends nothing. It works without an API key and never touches your -o file.
3

Confirm large spends

Before a command that could use 1,000 credits or more, the CLI asks for confirmation. In a script, where nobody can answer, it stops and tells you to pass --yes.
Change the confirmation threshold with COMPANYENRICH_CONFIRM_ABOVE. Set it to 0 to turn the check off.
The estimate for people search --expand company is a ceiling, not a forecast. That expansion is charged per unique company across everyone’s employers, which can’t be known up front, so the CLI assumes the API’s limit of 500 companies per page.

Bulk jobs

For large lists, run a background job instead of looping.
Results download as JSON, JSON Lines, or CSV and stream straight to the file. Input files hold one value per line. A CSV also works: the CLI reads the first column and skips a header row. For smaller lists, company enrich accepts several domains and sends them 50 at a time:

Call any endpoint

api sends a request to any endpoint with your key and the same retry behavior.

Use it in scripts and AI agents

The CLI behaves the same without a terminal: JSON on stdout, errors on stderr, stable exit codes, and no prompts. If you hand the CLI to an AI agent, give it two instructions:
  • Run --dry-run first to see the request and its cost.
  • Pass --yes only when a large spend is intended.
For agents that speak MCP, the MCP server is the alternative.

Configuration

Global flags: --format, --json, --fields, -o/--output, --dry-run, -y/--yes, --timeout, --retries, -v/--verbose, and --no-color.

Retries and timeouts

  • Rate limits and temporary server errors are retried 3 times by default. Change that with --retries, from 0 to 10.
  • On a 429, the CLI waits for the period the API specifies.
  • A request that timed out is not retried, because it may already have run and been charged.
  • --timeout is in seconds and defaults to 120. For downloads it covers the wait for the response to start, not the length of the download.

Shell completion

Completion covers commands, flags, and allowed values such as --seniority or --employees.

Support

  • Bugs and feature requests: GitHub issues
  • When reporting a failed request, include the Trace ID printed with the error. It lets us find the exact call in our logs. --verbose shows the full request and response.