| name | exacli |
| description | Exa AI search API via CLI. Use when the user wants to search the web, find code examples, extract page content, or get AI answers with sources. |
Exacli
Rules
- Match output format to context: use default for metadata-only results,
--toon when fetching content, --json only when piping to jq
- User must have setup
exacli login to store in OS keychain
- Use
--text to include full content, --highlights for snippets
- Use
--poll with research tasks to wait for results
Command Selection
Pick the right command first — wrong command = wrong output:
| Goal | Command |
|---|
| Find code examples / implementations | exacli code |
| Web search with content | exacli search --text or --highlights |
| Get a synthesized answer with citations | exacli answer |
| Deep multi-step research report | exacli research --poll (fall back to exacli answer on 404) |
| Fetch specific URL content | exacli contents <url> |
| Find pages similar to a URL | exacli similar <url> |
Output Modes
Measured on 10 results with no content flags (--text/--highlights/--summary off):
| Flag | Chars | Est. tokens | Best for |
|---|
| (none) | ~3,300 | ~830 | Agent contexts with metadata only — omits null/empty fields |
--toon | ~4,200 | ~1,050 | Agent contexts with content — flat key: value, no formatting overhead |
--json | ~5,000 | ~1,250 | Scripting only — most verbose due to null fields + structural chars |
Key insight: --json is ~50% larger than the default for the same data because it includes "highlights": null, "highlightScores": null, "text": "", "summary": "" on every result. Prefer default or --toon to keep context small; reach for --json only when piping to jq.
exacli search "query"
exacli search "query" --text --toon
exacli search "query" --json | jq '.results[] | {title, url}'
exacli research-status "task-id" --json | jq '{status, output}'
Commands
code
Search for code examples using the Exa Code API. Use this when the user needs actual code, implementations, or code-focused results — not search.
exacli code <query> [options]
| Option | Description |
|---|
--tokens-num <n> | Token budget: dynamic, 1000, 5000, 50000 (default: dynamic) |
search
exacli search "query" [options]
| Option | Description |
|---|
--num-results <n> | Number of results (default: 10) |
--type <auto|fast|deep|instant> | Search type |
--text | Include full text content |
--highlights | Include relevant highlights |
--summary | Include AI-generated summary |
--category <category> | Filter by category |
--include-domains <list> | Comma-separated domains to include |
--exclude-domains <list> | Comma-separated domains to exclude |
--start-date <date> | Start date (ISO format) |
--end-date <date> | End date (ISO format) |
--autoprompt | Use autoprompt to enhance query |
contents
Retrieve content from specific URLs.
exacli contents <url...> [options]
Options: --text, --highlights, --summary, --max-age-hours <n>
similar
Find pages similar to a given URL.
exacli similar <url> [options]
Options: --num-results <n>, --exclude-source-domain, --text, --highlights, --summary, --category <category>
answer
Get AI-powered answers with source citations.
exacli answer "query" [options]
Options: --text, --model <exa|exa-pro>, --stream, --system-prompt <text>
research
Create automated research tasks. If this returns a 404, fall back to exacli answer.
exacli research "instructions" [options]
Options: --model <fast|regular|pro>, --poll, --poll-interval <ms>, --timeout <ms>
research-status / research-list
exacli research-status <task-id>
exacli research-list [--limit <n>] [--cursor <token>]
login / logout
exacli login
exacli logout
Global Flags
| Flag | Description |
|---|
--api-key <key> | Exa API key |
--json | Output raw JSON |
--toon | Output compact TOON format |
-h, --help | Show help |
Search Categories
company, research paper, news, pdf, tweet, personal site, financial report, people
Search Types
| Type | Description |
|---|
auto | Automatically chosen (default) |
fast | Quick results |
deep | Thorough, best for research |
instant | Lowest latency |
Research Models
| Model | Description |
|---|
fast | Quick facts |
regular | Balanced (default) |
pro | Highest quality |
Common Patterns
exacli code "rate limiter implementation Go" --tokens-num 5000
exacli search "AI startups" --num-results 5 --text --toon
exacli search "transformer architecture" --type deep --highlights --toon
exacli search "startup funding" --category news --start-date 2024-01-01
exacli search "research" --include-domains "arxiv.org,openai.com"
exacli contents "https://example.com/article" --text --toon
exacli similar "https://openai.com/research" --exclude-source-domain
exacli answer "What is quantum computing?" --stream
exacli research "Latest AI developments" --poll
exacli answer "Latest AI developments" --text
exacli research-status "task-id" --json | jq '{status, output}'
exacli research-list --limit 10 --json | jq '.data[] | {id, status}'
| Deep multi-step research report | exacli research --poll (fall back to exacli answer on 404) |
| Fetch specific URL content | exacli contents <url> |
| Find pages similar to a URL | exacli similar <url> |
Output Modes
Measured on 10 results with no content flags (--text/--highlights/--summary off):
| Flag | Chars | Est. tokens | Best for |
|---|
| (none) | ~3,300 | ~830 | Agent contexts with metadata only — omits null/empty fields |
--toon | ~4,200 | ~1,050 | Agent contexts with content — flat key: value, no formatting overhead |
--json | ~5,000 | ~1,250 | Scripting only — most verbose due to null fields + structural chars |
Key insight: --json is ~50% larger than the default for the same data because it includes "highlights": null, "highlightScores": null, "text": "", "summary": "" on every result. Prefer default or --toon to keep context small; reach for --json only when piping to jq.
exacli search "query"
exacli search "query" --text --toon
exacli search "query" --json | jq '.results[] | {title, url}'
exacli research-status "task-id" --json | jq '{status, output}'
Commands
code
Search for code examples using the Exa Code API. Use this when the user needs actual code, implementations, or code-focused results — not search.
exacli code <query> [options]
| Option | Description |
|---|
--tokens-num <n> | Token budget: dynamic, 1000, 5000, 50000 (default: dynamic) |
search
exacli search "query" [options]
| Option | Description |
|---|
--num-results <n> | Number of results (default: 10) |
--type <auto|fast|deep|instant> | Search type |
--text | Include full text content |
--highlights | Include relevant highlights |
--summary | Include AI-generated summary |
--category <category> | Filter by category |
--include-domains <list> | Comma-separated domains to include |
--exclude-domains <list> | Comma-separated domains to exclude |
--start-date <date> | Start date (ISO format) |
--end-date <date> | End date (ISO format) |
--autoprompt | Use autoprompt to enhance query |
contents
Retrieve content from specific URLs.
exacli contents <url...> [options]
Options: --text, --highlights, --summary, --max-age-hours <n>
similar
Find pages similar to a given URL.
exacli similar <url> [options]
Options: --num-results <n>, --exclude-source-domain, --text, --highlights, --summary, --category <category>
answer
Get AI-powered answers with source citations.
exacli answer "query" [options]
Options: --text, --model <exa|exa-pro>, --stream, --system-prompt <text>
research
Create automated research tasks. If this returns a 404, fall back to exacli answer.
exacli research "instructions" [options]
Options: --model <fast|regular|pro>, --poll, --poll-interval <ms>, --timeout <ms>
research-status / research-list
exacli research-status <task-id>
exacli research-list [--limit <n>] [--cursor <token>]
login / logout
exacli login
exacli logout
Global Flags
| Flag | Description |
|---|
--api-key <key> | Exa API key |
--json | Output raw JSON |
--toon | Output compact TOON format |
-h, --help | Show help |
Search Categories
company, research paper, news, pdf, tweet, personal site, financial report, people
Search Types
| Type | Description |
|---|
auto | Automatically chosen (default) |
fast | Quick results |
deep | Thorough, best for research |
instant | Lowest latency |
Research Models
| Model | Description |
|---|
fast | Quick facts |
regular | Balanced (default) |
pro | Highest quality |
Common Patterns
exacli code "rate limiter implementation Go" --tokens-num 5000
exacli search "AI startups" --num-results 5 --text --toon
exacli search "transformer architecture" --type deep --highlights --toon
exacli search "startup funding" --category news --start-date 2024-01-01
exacli search "research" --include-domains "arxiv.org,openai.com"
exacli contents "https://example.com/article" --text --toon
exacli similar "https://openai.com/research" --exclude-source-domain
exacli answer "What is quantum computing?" --stream
exacli research "Latest AI developments" --poll
exacli answer "Latest AI developments" --text
exacli research-status "task-id" --json | jq '{status, output}'
exacli research-list --limit 10 --json | jq '.data[] | {id, status}'