Complete reference for the exa-ai command-line interface.
- Global Options
- search
- answer
- context
- get-contents
- research-start
- research-get
- research-list
- Output Formats
All commands support these options:
--api-key KEY- Override API key from environment--output-format FORMAT- json, pretty, or text (varies by command)--help, -h- Show command helpexa-ai --version- Show versionexa-ai --help- Show available commands
Search the web using fast or deep search.
exa-ai search "ruby programming"
exa-ai search "machine learning" --num-results 10
exa-ai search "AI" --type deep# Include specific domains
exa-ai search "tutorials" --include-domains "github.com,dev.to"
# Exclude specific domains
exa-ai search "programming" --exclude-domains "outdated-site.com"
# Combine filters
exa-ai search "Python" \
--include-domains "github.com" \
--exclude-domains "reddit.com"# Filter by published date
exa-ai search "AI research" \
--start-published-date "2025-01-01T00:00:00.000Z" \
--end-published-date "2025-12-31T23:59:59.999Z"
# Filter by crawl date
exa-ai search "news" \
--start-crawl-date "2025-10-01T00:00:00.000Z" \
--end-crawl-date "2025-10-31T23:59:59.999Z"# Must include phrase
exa-ai search "machine learning" --include-text "neural networks"
# Must exclude phrase
exa-ai search "programming" --exclude-text "paid-partnership"
# Combine inclusion and exclusion
exa-ai search "Python" \
--include-text "open source" \
--exclude-text "deprecated"# Extract full webpage text
exa-ai search "Ruby" --text
# With character limit
exa-ai search "AI" --text --text-max-characters 3000
# Include HTML tags in text
exa-ai search "web" --text --include-html-tags
# Generate AI summaries
exa-ai search "climate change" \
--summary \
--summary-query "What are the main points?"
# Format as LLM context
exa-ai search "kubernetes" \
--context \
--context-max-characters 5000
# Crawl subpages
exa-ai search "documentation" \
--subpages 1 \
--subpage-target about \
--subpage-target docs
# Extract links
exa-ai search "web development" \
--links 3 \
--image-links 2# Pretty format (human-readable)
exa-ai search "ruby" --output-format pretty
# JSON format (default)
exa-ai search "ruby" --output-format jsonQUERY- Search query (required)--num-results N- Number of results (default: 10)--type TYPE- Search type: fast, deep, keyword, or auto (default: fast)--include-domains DOMAINS- Comma-separated domains--exclude-domains DOMAINS- Comma-separated domains--start-published-date DATE- ISO 8601 date string--end-published-date DATE- ISO 8601 date string--start-crawl-date DATE- ISO 8601 date string--end-crawl-date DATE- ISO 8601 date string--include-text TEXT- Phrase to include--exclude-text TEXT- Phrase to exclude--text- Include full webpage text--text-max-characters N- Limit text length--include-html-tags- Keep HTML tags in text--summary- Include AI summary--summary-query QUERY- Custom summary query--context- Include LLM-formatted context--context-max-characters N- Limit context length--subpages N- Number of subpages to crawl--subpage-target TARGET- Subpage URL pattern (repeatable)--links N- Number of links to extract--image-links N- Number of image links to extract--output-format FORMAT- json or pretty
Generate comprehensive answers to questions with source citations.
exa-ai answer "What is the capital of France?"
exa-ai answer "Latest developments in quantum computing"# Include full text from source pages
exa-ai answer "Ruby on Rails best practices" --text# Pretty format
exa-ai answer "How do I learn machine learning?" --output-format pretty
# JSON format (default)
exa-ai answer "What is AI?" --output-format jsonQUERY- Question to answer (required)--text- Include full text content from sources--output-format FORMAT- json or pretty (default: json)
answer- The generated answercitations- Array of source citations with URLscost_dollars- Cost of the request
Find relevant code snippets and documentation from repositories.
exa-ai context "authentication with JWT"
exa-ai context "React hooks"
exa-ai context "async/await patterns"# Fixed token count
exa-ai context "React hooks" --tokens-num 5000
# Dynamic allocation (default)
exa-ai context "authentication" --tokens-num dynamic# Text format
exa-ai context "async/await" --output-format text
# JSON format (default)
exa-ai context "authentication" --output-format jsonQUERY- Search query (required)--tokens-num NUM- Token allocation: integer or "dynamic" (default: dynamic)--output-format FORMAT- json or text (default: json)
Retrieve full text content from web pages.
exa-ai get-contents "https://example.com/article"# Comma-separated URLs
exa-ai get-contents "https://site1.com,https://site2.com,https://site3.com"# Include full text
exa-ai get-contents "https://example.com" --text
# Include highlighted sections
exa-ai get-contents "https://example.com" --highlights
# Include summary
exa-ai get-contents "https://example.com" --summary
# Combine options
exa-ai get-contents "url1,url2" \
--text \
--highlights \
--summary# Pretty format
exa-ai get-contents "https://example.com" --output-format pretty
# JSON format (default)
exa-ai get-contents "https://example.com" --output-format jsonIDS- Page IDs or URLs (required, comma-separated)--text- Include full text content--highlights- Include highlighted sections--summary- Include summary--output-format FORMAT- json or pretty (default: json)
Start a long-running research task.
exa-ai research-start --instructions "Find Ruby performance tips"exa-ai research-start \
--instructions "Analyze AI safety papers" \
--model gpt-4exa-ai research-start \
--instructions "Extract key metrics" \
--output-schema '{"format":"json","fields":["metric","value"]}'# Block until task completes
exa-ai research-start \
--instructions "Research AI trends" \
--wait
# Show event log while waiting
exa-ai research-start \
--instructions "Research AI trends" \
--wait \
--events# Pretty format
exa-ai research-start --instructions "..." --output-format pretty
# JSON format (default)
exa-ai research-start --instructions "..." --output-format json--instructions TEXT- Research instructions (required)--model MODEL- Model to use (e.g., gpt-4)--output-schema SCHEMA- JSON schema for structured output--wait- Block until completion--events- Show event log during polling--output-format FORMAT- json or pretty (default: json)
Check status of a research task.
exa-ai research-get abc-123exa-ai research-get abc-123 --eventsexa-ai research-get abc-123 --stream# Pretty format
exa-ai research-get abc-123 --output-format pretty
# JSON format (default)
exa-ai research-get abc-123 --output-format jsonRESEARCH_ID- Task ID (required)--events- Include event log--stream- Stream results (premium feature)--output-format FORMAT- json or pretty (default: json)
List research tasks with pagination.
exa-ai research-list# Set page size
exa-ai research-list --limit 20
# Get next page
exa-ai research-list --limit 20 --cursor "next_cursor"# Pretty table format
exa-ai research-list --output-format pretty
# JSON format (default)
exa-ai research-list --output-format json--cursor CURSOR- Pagination cursor--limit N- Results per page (default: 10)--output-format FORMAT- json or pretty (default: json)
Default output format returns structured JSON:
exa-ai search "ruby" --output-format json
# Returns: {"results": [...], "cost_dollars": ...}Human-readable format with formatted titles and URLs:
exa-ai search "ruby" --output-format pretty
# Returns nicely formatted output for terminal displayPlain text output (available for context command):
exa-ai context "React" --output-format text
# Returns plain text output