@bigknoxy/exa-cli
](https://www.npmjs.com/package/@bigknoxy/exa-cli)  ](https://nodejs.org)
CLI包装器 Exa MCP服务器。从命令行使用Exa强大的搜索、抓取和研究功能,针对LLM工具的使用进行了优化。
为什么选择exa-cli?
- 免费等级支持 -使用Exa的免费MCP层(不需要API密钥)
- LLM优化 -CLI工具对LLM的效率高于MCP协议
- 所有Exa工具 -网络搜索、代码搜索、爬行、公司研究、人员搜索和深度研究
安装
快速安装(推荐)
curl -fsSL https://raw.githubusercontent.com/bigknoxy/exa-cli/main/install.sh | shnpm
npm install -g @bigknoxy/exa-cli直接使用npx运行
npx @bigknoxy/exa-cli search "your query"卸载
curl -fsSL https://raw.githubusercontent.com/bigknoxy/exa-cli/main/uninstall.sh | sh或者使用npm:
npm uninstall -g @bigknoxy/exa-cli备注:卸载脚本将保留您的配置文件(~/.exarc)到位。使用手动将其删除rm ~/.exarc如果需要的话。
命令
exa search
在网上搜索任何主题。
exa search "latest AI news 2026" --num 10
exa search "typescript best practices" --type fast --format json选项:
--num-结果数(默认值:8)--type-搜索类型:auto或fast(默认:自动)--livecrawl-实时爬网模式:fallback或preferred(默认:回退)--format-输出格式:text,json,或markdown(默认值:文本)--api-key-覆盖API键
exa code
搜索代码示例和文档。
exa code "React useState hook TypeScript" --tokens 3000
exa code "express middleware authentication" --format markdown选项:
--tokens-令牌计数1000-50000(默认值:5000)--format-输出格式(默认:文本)--api-key-覆盖API键
exa crawl
从特定URL提取内容。
exa crawl https://docs.exa.ai --max-chars 5000
exa crawl https://example.com/article --format json选项:
--max-chars-要提取的最大字符数(默认值:3000)--format-输出格式(默认:文本)--api-key-覆盖API键
exa company
研究一家公司。
exa company Anthropic --num 5
exa company "OpenAI" --format json选项:
--num-结果数(默认值:3)--format-输出格式(默认:文本)--api-key-覆盖API键
exa people
搜索人员和专业资料。
exa people "VP Engineering AI startups" --num 10
exa people "machine learning researcher" --format json选项:
--num-结果数(默认值:5)--format-输出格式(默认:文本)--api-key-覆盖API键
exa search-advanced
具有完全过滤器控制的高级搜索。
exa search-advanced "AI agents 2026" \
--category news \
--include-domains techcrunch.com,wired.com \
--start-date 2026-01-01 \
--highlights选项:
--num-结果数量,最大100(默认值:10)--type-搜索类型:auto,fast,或neural--category-类别筛选器:company,research paper,news,tweet,personal site,people,financial report--include-domains-要包含的逗号分隔域--exclude-domains-要排除的逗号分隔域--start-date-开始发布日期(YYYY-MM-DD)--end-date-结束发布日期(YYYY-MM-DD)--highlights-启用突出显示--summary-启用摘要--livecrawl-模式:never,fallback,preferred,always--format-输出格式(默认:文本)--api-key-覆盖API键
exa research start
针对复杂问题启动人工智能研究代理。
exa research start "Compare flagship GPUs from NVIDIA, AMD, and Intel in 2026"
exa research start "Analyze the electric vehicle market trends" --model exa-research-pro选项:
--model-研究模型:exa-research-fast,exa-research,exa-research-pro(默认:exa研究快速)--format-输出格式(默认:文本)--api-key-覆盖API键
exa research check
检查研究任务的状态。
exa research check abc123...exa config
管理存储在中的配置 ~/.exarc.
exa config list # Show all config
exa config set apiKey YOUR_KEY # Set API key
exa config set output json # Set default output format
exa config get apiKey # Get a config value
exa config clear # Reset to defaultsexa completion
生成shell完成脚本。
# Auto-detect and install for current shell
exa completion --install
# Explicit shell
exa completion bash --install
# Dry-run to see what would happen
exa completion --install --dry-run
# Manual installation (output script to stdout)
exa completion bash > /etc/bash_completion.d/exa
exa completion zsh > ~/.zsh/completions/_exa
exa completion fish > ~/.config/fish/completions/exa.fish配置
配置存储在 ~/.exarc:
{
"apiKey": "your-api-key",
"output": "text",
"defaultNum": 8
}API密钥
默认情况下,CLI使用免费MCP层(不需要API密钥)。要获得更高的速率限制:
- 从获取API密钥https://dashboard.exa.ai/api-keys
- 通过配置进行设置:
exa config set apiKey YOUR_KEY - 或使用
--api-key每个命令的标志 - 或设置
EXA_API_KEY环境变量
输出格式
text(默认)-人类可读的颜色json-用于脚本编写的原始JSON输出markdown-带链接的Markdown格式
发展
# Clone and install
git clone https://github.com/bigknoxy/exa-cli.git
cd exa-cli
npm install
# Build
npm run build
# Test
npm test
# Development mode
npm run dev search "test query"需求
- Node.js 18+
- npm或bun
许可证
麻省理工学院
