> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lonescale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

The **LoneScale CLI** (`lonescale`) is the official command-line client for the LoneScale Public API. Use it to enrich contacts, source contacts by persona, look up companies, and poll async jobs — all from your terminal or a shell script.

It's a thin wrapper around the same REST endpoints documented under [API Reference](https://docs.lonescale.com/authentication.md), with terminal-friendly output, file/stdin/inline input, and built-in polling.

## Install

```bash theme={null}
npm install -g @lonescale/cli
```

Or run without installing:

```bash theme={null}
npx @lonescale/cli --help
```

Requires Node.js ≥ 18.

## Authenticate

Get your API key from **Dashboard → Integrations → Public API** and provide it in one of three ways (checked in this order):

**1. Per-command flag (highest priority)**

```bash theme={null}
lonescale enrich --api-key ls_xxx ...
```

**2. Environment variable**

```bash theme={null}
export LONESCALE_API_KEY=ls_xxx
lonescale enrich ...
```

**3. Config file**

```bash theme={null}
mkdir -p ~/.lonescale
echo '{ "api_key": "ls_xxx" }' > ~/.lonescale/config.json
```

> [card] [Get my API key](https://app.lonescale.com/app/integrations)

## Commands

| Command | Purpose |
| - | - |
| [`lonescale enrich`](https://docs.lonescale.com/cli/enrich) | Waterfall enrichment (email / phone) for a list of contacts |
| [`lonescale source`](https://docs.lonescale.com/cli/source) | Source contacts at a company by persona, seniority, location |
| [`lonescale companies search`](https://docs.lonescale.com/cli/companies-search) | Look up a single company by name, domain, LinkedIn slug, or ID |
| [`lonescale result`](https://docs.lonescale.com/cli/result) | Poll the status / result of an async job |

## Global options

These flags work with every command:

| Option | Description |
| - | - |
| `--api-key <key>` | LoneScale API key (overrides env + config file) |
| `--output <format>` | `json` (default when piped), `table` (default in TTY), or `minimal` (just the id/status — script-friendly) |
| `--debug` | Print HTTP requests / responses to stderr. API keys are redacted automatically. |

## Output formats

Data goes to **stdout**, logs go to **stderr** — so you can pipe results cleanly into `jq`, `xargs`, `tee`, etc.

```bash theme={null}
# Count returned contacts
lonescale source --domain acme.com --personas p.json --wait --output json \
  | jq '.contacts | length'

# Capture just the job ID
JOB_ID=$(lonescale enrich --type email --contacts c.json --output minimal)
```

See [Recipes](https://docs.lonescale.com/cli/recipes.md) for more scripting patterns.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.