SuperAPI AI 工具集

exa

通用与其它

查看项目

更新于 10-16 07:08

技能介绍

用途

exa-cli 用于在命令行中管理 Exa AI,提供搜索、内容获取、AI 回答和上下文获取等能力。当用户提到“exa”“web search”“find similar pages”“ai answer”或希望与 Exa 交互时,可使用该工具。

主要能力

工具按资源划分为四组命令:

search(搜索)

  • search query:用自然语言查询进行网络搜索,例如 exa-cli search query --query "latest AI research" --json。
  • 支持指定搜索类型:--type neural(神经搜索,如 --num-results 自定义结果数量)或 --type keyword(关键词搜索)。
  • 支持日期过滤:--start-date 2024-01-01。
  • 支持按分类过滤:--category news。
  • 支持域名过滤:--include-domains github.com,stackoverflow.com 或 --exclude-domains twitter.com。
  • 结果内容增强:--text 包含页面文本,--summary 包含每条结果的 AI 摘要,--highlights 包含文本高亮。
  • search find-similar:查找与给定 URL 相似的页面,例如 exa-cli search find-similar --url "https://example.com" --json,可配合 --num-results 与 --text 使用。

contents(内容)

  • contents get:获取一个或多个 URL 的页面内容,例如 exa-cli contents get --urls "https://example.com" --json,多个 URL 用逗号分隔。
  • 可附加 --text(完整页面文本)、--summary(AI 摘要)、--highlights(文本高亮)。

answer(回答)

  • answer query:获取带网络引用的 AI 回答,例如 exa-cli answer query --query "What is the latest valuation of SpaceX?" --json。
  • 可附加 --text 包含来源文本,--stream 以流式方式返回回答。

context(上下文)

  • context get:获取查询的网络上下文,例如 exa-cli context get --query "how to use React hooks" --json。
  • 可用 --tokens-num 8000 限制 token 数量。

使用方式

安装与构建

若未找到 exa-cli,则安装并构建:

bun --version || curl -fsSL https://bun.sh/install | bash
npx api2cli bundle exa
npx api2cli link exa

api2cli link 会自动把 ~/.local/bin 加入 PATH,CLI 在下一个命令中即可使用。

认证

exa-cli auth set "your-token"
exa-cli auth test

全局参数

所有命令支持:--json、--format <text|json|csv|yaml>、--verbose、--no-color、--no-header。以程序化方式调用命令时,应始终使用 --json 参数。

适用场景

  • 在命令行中以自然语言进行网络搜索,并按日期、分类、域名进行过滤。
  • 查找与某个 URL 相似的页面。
  • 获取一个或多个页面的内容、摘要或高亮。
  • 获取带网络引用的 AI 问答结果,或以流式方式接收回答。
  • 为某个查询获取指定 token 数量的网络上下文。
  • 通过 --json 等参数把结果接入脚本或程序。

限制与暂未提供的信息

  • 使用前需要配置认证令牌,并可通过 auth test 验证。
  • 需具备 Bun 与 api2cli 环境才能完成安装构建。
  • 关于计费、价格、可用的具体数据源范围、速率限制、各参数默认值等,资料中暂未提供。