# Command-line interface

Install the LookAlike CLI, sign in with a token, run analyses from a terminal, and bridge MCP over stdio.

The LookAlike CLI is one JavaScript file with no dependencies. It needs Node.js 20 or later.

## Install

```
curl -fsSLo lookalike.mjs https://app.lookalikeiq.com/cli/lookalike.mjschmod +x lookalike.mjs./lookalike.mjs login --token lk_your_token
```

`login` checks the token and saves it in `~/.config/lookalike/config.json` with owner-only permissions. You can also set `LOOKALIKE_API_TOKEN`. Set `LOOKALIKE_BASE_URL` to use the staging server.

## Commands

Command

Example

`whoami`

`./lookalike.mjs whoami` shows the account, release, and this hour’s usage.

`brands [query]`

`./lookalike.mjs brands grocery`

`brand <brand>`

`./lookalike.mjs brand costco`

`candidates <brand>`

`./lookalike.mjs candidates "Trader Joe's" --state CO --limit 10 --shortlist 5`. Add `--brief` for up to 100 short rows.

`markets <brand>`

`./lookalike.mjs markets sprouts --metric headroom --exclude-states TX --min-market-tracts 100`

`site <brand>`

`./lookalike.mjs site whole_foods --address "1701 Wynkoop St, Denver, CO"`

`tracts <geoid>...`

`./lookalike.mjs tracts 08031001705 08035014116 --brand whole_foods`

`compare <brand> <brand>`

`./lookalike.mjs compare trader_joes whole_foods --metro Denver`

`metros <query>`

`./lookalike.mjs metros "bay area"`

`method`

`./lookalike.mjs method`

`glossary`

`./lookalike.mjs glossary`

`link <brand>`

`./lookalike.mjs link costco --mode markets --open`

`preview <brand>`

`./lookalike.mjs preview costco --metro Boise --out boise.png`

`views [query]`

`./lookalike.mjs views --mine`

`view rename <id> <title>`

`./lookalike.mjs view rename 0123456789abcdef0123456789abcdef "Denver shortlist"`

`view delete <id>`

`./lookalike.mjs view delete 0123456789abcdef0123456789abcdef`

`mcp`

Runs a stdio MCP server. See [MCP server](https://docs.lookalikeiq.com/agents/mcp/).

## Area filters

Option

Example

`--state`

`--state CO,UT`

`--exclude-states`

`--exclude-states TX,OK`

`--counties`

`--counties "Alameda County, CA;Contra Costa, CA"` (separate counties with semicolons)

`--metro`

`--metro Denver`, `--metro 19740`, or `--metro "Bay Area"`

`--competitors`, `--competitor-categories`

`--competitors whole_foods,sprouts --competitor-categories "Warehouse club"` with `--no-competitor`

`--near` and `--radius`

`--near "Boise, ID" --radius 20`, or `--near 43.6,-116.2`

`--address` and `--near` accept a street address, a ZIP code, or a city and state. A ZIP code or a city gives an approximate point, and the output says so.

Use `--stores stores.csv` instead of a brand to score your own locations. The CSV needs latitude and longitude columns. JSON arrays of `{ "lat", "lon" }` objects also work.

Add `--json` to print the raw response. Add `--open` to open the main map link in your browser. Run `./lookalike.mjs --help` for every option. The CLI retries a failed connection twice before it reports an error.

Canonical URL: https://docs.lookalikeiq.com/agents/cli/
