# Command-Line Tool (CLI)

URL: https://email-validation.org/docs/guides/cli/
Updated: 2026-11-29

> Documentation index: https://email-validation.org/llms.txt

`email-validation` checks one address, checks a whole file as one bulk list, and shows your balance, from a terminal
or a script. The tool is free and MIT-licensed, is built on our [JavaScript client library](https://email-validation.org/docs/sdks/javascript/) and needs
Node.js 24 or later.

**Status: setup guide.** The tool is on npm as `@email-validation/cli`.

## Install and check a first address

1. Install it:

   ```bash
   npm install -g @email-validation/cli
   ```

2. Create a key on the [API keys page](https://email-validation.org/app/api-keys/) and give it to the tool without leaving it in your shell
   history (paste the key, then press Enter):

   ```bash
   read -rs EV_API_KEY && export EV_API_KEY
   ```

   In PowerShell, see [Windows](#windows).

3. Check a free test address:

   ```bash
   email-validation validate accepted@sandbox.email-validation.org
   ```

   It prints the address's status (`valid`), the reason (`accepted`), the action and the credits used.
   [Test addresses](https://email-validation.org/docs/test-addresses/) are answered without a check and cost nothing.

## Commands

```text
email-validation validate <email> [--json]
email-validation bulk <file.csv|file.txt> [--out <results.csv>] [--column <n|name>] [--[no-]header] [--force] [--json]
email-validation bulk --resume <job_id> [--out <results.csv>] [--force] [--json]
email-validation credits [--json]
```

- **validate** prints the address's status, reason and action and, for a likely typo, the address it may have meant.
  One credit, except `unknown` results, malformed addresses and test addresses, which are free.
- **bulk** sends a CSV file (the API finds the email column and a header row) or a file with one address per line as
  one [bulk list](https://email-validation.org/docs/bulk/), shows its progress and saves the results beside it (`list.csv` gives
  `list.results.csv`; `--out` picks another path; an existing file is replaced only with `--force`). The key needs the **Bulk lists** permission.
  Credits are held when the job starts. Files up to 100 MB.
- **credits** shows your balance, pending credits and when credits expire. Free.
- `--json` prints the API's JSON instead of text (for bulk: the finished job).
- `--region eu`, or `EV_REGION=eu`, sends the requests to `https://api-eu.email-validation.org`, where addresses are validated in the EU and
  their results stored there ([EU data residency](https://email-validation.org/docs/eu-data-residency/)). The same key and credits work on both.
- `email-validation --help` lists every option.

## Bulk lists and Ctrl-C

The tool creates the job, saves its id in a job note on your computer (ids only, never addresses), and only then
starts it. Until its results are saved, running the same command again on the same file follows that job instead of
creating a second one, so an interrupted list is never paid for twice (within the 30 days a list
is kept). Once the results are saved, the note is gone: a later run of the same file, with `--force` to replace the
results file, is a new list and is charged again. A changed file is a new list too.

**Ctrl-C** stops the waiting, not the job: the tool prints the job id and the command that picks it up again, for
example `email-validation bulk --resume <job_id> --out list.results.csv`. `--resume` never creates a job.

While it waits, lost connections and busy answers are retried with a growing pause, for as long as the job runs.
An upload whose answer is lost is never sent again: find the job under your bulk jobs in the dashboard, then start it
there or with `--resume`.

## The key

The key comes from `EV_API_KEY` or from `--api-key-file <path>`, a file holding only the key. There is no
`--api-key` flag: a key typed in a command is saved in your shell history, and so is `export EV_API_KEY=…` typed at the
prompt. The tool never prints the key, and its progress lines show job ids and counts, never addresses. Read more on
[authentication and API keys](https://email-validation.org/docs/authentication/).

## Windows

The tool runs in PowerShell and cmd.exe as well. To set the key in PowerShell without echoing or saving it, run this
and paste the key:

```text
$env:EV_API_KEY = [Net.NetworkCredential]::new('', (Read-Host -AsSecureString)).Password
```

- A key file must be saved as UTF-8 or ASCII text. Windows PowerShell 5.1's `Out-File` and `>` write UTF-16, which
  the tool cannot read.
- Job notes are kept in `%LOCALAPPDATA%\email-validation\jobs` (on macOS and Linux in
  `~/.local/state/email-validation/jobs`, or under `$XDG_STATE_HOME` when it is set).
- The resume command the tool prints puts paths in single quotes, as macOS and Linux shells read them. PowerShell
  reads them too, unless the path holds a `'`; in cmd.exe, change them to double quotes. The next release quotes paths
  for Windows by itself.

## Exit codes

| Code | Meaning |
|---|---|
| 0 | Done (for validate: whatever the address's status) |
| 1 | API error, network failure, or a bulk job that failed, was cancelled or expired |
| 2 | Usage error: bad arguments, no key, a missing or empty file (nothing was sent) |
| 3 | The key was refused (401) or may not do this (403) |
| 4 | Not enough credits (402, or a bulk job waiting for credits) |
| 5 | Still rate limited (429) after the automatic retries |
| 130 | Interrupted (Ctrl-C) |

## More on Command-line tool

- [Command-line tool integration](https://email-validation.org/integrations/cli/)
