---
title: "Kairon CLI: LinkedIn and email outreach from your terminal"
description: "Install and use the Kairon CLI. One command per MCP tool, flags derived from each tool schema, JSON on stdout so it pipes into jq."
canonical: "https://heykairon.com/cli"
generated: "2026-10-25"
---

Documentation

# Kairon CLI

Search LinkedIn, build lists, run campaigns and answer replies from a terminal, a script or a cron job. It is an MCP client, not a second API, so a command and an assistant make the same call.

Install `npm i -g @kairon/cli`

## Getting started

1. Step 1
  ### Install it
  Needs Node 22.23.1 or newer. You can also run it once with npx and install nothing.
  ```
  npm i -g @kairon/cli
  npx @kairon/cli whoami
  ```
2. Step 2
  ### Sign in
  Opens your browser and signs you in with your Kairon account. There is no API key. Credentials are stored in ~/.kairon/config.json at mode 0600.
  ```
  kairon login
  ```
3. Step 3
  ### Check who you are
  Reports the account and the LinkedIn seat every command will run as. If this works, the rest will.
  ```
  kairon whoami
  ```
4. Step 4
  ### Run something
  Every command prints JSON, so it pipes straight into jq. Ask for help on any group or command at any time.
  ```
  kairon chat list --unread
  kairon list --help
  ```

## Commands

One command per tool: kairon --help lists the groups, and kairon <group> --help the commands in each. A tool name splits on its first underscore and the rest is kebab-cased, so the surface here is exactly the surface the server exposes.

This page is generated from the tool catalogue by the same functions that build kairon --help, on every release. The page and your terminal cannot disagree, because they are the same code.

## Flags

Flags are derived from each tool input schema, not written by hand, which is why they match the tool exactly. Three shapes get three treatments.

### Scalars are plain flags

A string, number or boolean becomes --flag and takes its value literally. An enum shows its choices in the type column.

### Nested objects are dot paths

A tool input nests freely, so a nested field becomes --config.keyword rather than a flattened name that could collide with another tool field.

### Arrays and unions take JSON

There is no honest flat spelling for "an array of either a member id or a URL", so those flags take JSON text. They are marked json in the table below.

### Typos are caught before the network

Input is checked against the cached schema before any call, so a misspelled flag costs nothing and names itself: it tells you the option is unknown and suggests the one you meant.

### Every command also accepts

`--server <url>`

Target a specific Kairon (default: KAIRON_API_URL, else production)

`--json <json>`

Pass the entire tool input as one JSON object

`--refresh`

Re-fetch the tool catalogue before running

`-h, --help`

Show help

`-v, --version`

Show the CLI version

And the escape hatch, when flags get in the way

```
kairon list create --json '{"asset":"leads","name":"Q3"}'
```

## Output and exit codes

The result is JSON on stdout. Everything a human reads goes to stderr, so a pipe stays clean with no flags. A command that succeeds exits 0. A command that fails exits non-zero, writes nothing at all to stdout, and leads with a stable error code you can branch on rather than prose you would have to pattern-match.

Piping works with no flags

```
kairon campaign stats --id camp_… | jq '.funnel'
```

A failure names its code

```
$ kairon list get --asset leads --id list_01… ; echo "exit=$?"
kairon list get failed: COMMON_NOT_FOUND
{
  "code": "COMMON_NOT_FOUND",
  "params": { "resource": "lead_list" }
}
exit=1
```

## Environment and headless use

For CI, a cron job or a container, there is no browser to open. Pass a token instead and the CLI needs no stored credentials at all.

`KAIRON_TOKEN`

Use this access token and ignore stored credentials entirely.

`KAIRON_API_URL`

Default server. The --server flag beats it, and production is the fallback.

`KAIRON_CONFIG_DIR`

Where credentials live. Defaults to ~/.kairon.

No ~/.kairon needed

```
KAIRON_TOKEN=<access token> kairon whoami
```

## Acting as someone else

Kairon staff can act as any user; an owner or admin can act as a member of their own organization who does not outrank them. One command in, one command out, nothing to type in between.

```
kairon impersonate list --search acme
kairon impersonate start --user ana@acme.com
kairon chat list
kairon impersonate stop
```

### The mode belongs to this login, not to you

Signing in registers a fresh client each time, so your terminal, your assistant and your cron each have their own. Acting as someone here does not redirect the 3am job.

### It ends 60 minutes after your last call

Not 60 minutes after it started. Working never interrupts you; leaving for lunch ends it.

### Every command under it says so on stderr

One line naming who you are acting as. stdout is untouched, so a pipe keeps working.

### Only someone with a LinkedIn seat

Acting as a seatless user would reach nothing, so impersonate list tags each candidate with whether they have one.

## Troubleshooting

### Every command says there is no seat

The account has no LinkedIn account connected, or the plan is not active. Connect one in Kairon and run kairon whoami again. Commands act as that seat, so nothing works without it.

### A command does not exist

Commands come from the server, cached per server URL under ~/.kairon/tools/, and the cache has no expiry because a tool set changes on deploy and not on a schedule. Run the command again with --refresh to re-fetch it.

### It asks you to sign in again

Access tokens last 30 days and refresh silently. When the refresh token finally expires after 90 days you get one sentence and the command to run.

### Signing out does not revoke anything

kairon logout deletes the local credentials. The server issues opaque tokens with no revocation endpoint, so the access token stays valid there until it expires. The command says so rather than implying a revocation that did not happen.

## The tools behind the commands

Every command fronts one MCP tool. The tool page carries the full description each command summarises, the JSON Schema, and how to connect an AI assistant to the same surface.

[MCP setup](https://heykairon.com/mcp)
