tavily-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Tavily CLI

Tavily CLI

Web search, content extraction, site crawling, URL discovery, and deep research. Returns JSON optimized for LLM consumption.
Run
tvly --help
or
tvly <command> --help
for full option details.
网页搜索、内容提取、网站爬取、URL发现以及深度调研。返回针对LLM处理优化的JSON格式结果。
运行
tvly --help
tvly <command> --help
查看完整选项详情。

Prerequisites

前提条件

Must be installed and authenticated. Check with
tvly --status
.
bash
tavily v0.1.0

> Authenticated via OAuth (tvly login)
If not ready:
bash
curl -fsSL https://cli.tavily.com/install.sh | bash
Or manually:
uv tool install tavily-cli
/
pip install tavily-cli
Then authenticate:
bash
tvly login --api-key tvly-YOUR_KEY
必须完成安装和身份验证。可通过
tvly --status
检查状态。
bash
tavily v0.1.0

> 已通过OAuth完成身份验证 (tvly login)
若未准备好:
bash
curl -fsSL https://cli.tavily.com/install.sh | bash
或手动安装:
uv tool install tavily-cli
/
pip install tavily-cli
然后进行身份验证:
bash
tvly login --api-key tvly-YOUR_KEY

or: export TAVILY_API_KEY=tvly-YOUR_KEY

或:export TAVILY_API_KEY=tvly-YOUR_KEY

or: tvly login (opens browser for OAuth)

或:tvly login (打开浏览器进行OAuth验证)

undefined
undefined

Workflow

工作流程

Follow this escalation pattern — start simple, escalate when needed:
  1. Search — No specific URL. Find pages, answer questions, discover sources.
  2. Extract — Have a URL. Pull its content directly.
  3. Map — Large site, need to find the right page. Discover URLs first.
  4. Crawl — Need bulk content from an entire site section.
  5. Research — Need comprehensive, multi-source analysis with citations.
NeedCommandWhen
Find pages on a topic
tvly search
No specific URL yet
Get a page's content
tvly extract
Have a URL
Find URLs within a site
tvly map
Need to locate a specific subpage
Bulk extract a site section
tvly crawl
Need many pages (e.g., all /docs/)
Deep research with citations
tvly research
Need multi-source synthesis
For detailed command reference, use the individual skill for each command (e.g.,
tavily-search
,
tavily-crawl
) or run
tvly <command> --help
.
遵循以下递进模式——从简单操作开始,必要时升级:
  1. 搜索 — 无特定URL。查找页面、回答问题、发现来源。
  2. 提取 — 已有URL。直接提取其内容。
  3. 映射 — 大型网站,需要找到正确页面。先发现URL。
  4. 爬取 — 需要从整个网站板块获取批量内容。
  5. 调研 — 需要带引用的多来源综合分析。
需求命令使用场景
查找某主题的页面
tvly search
尚无特定URL时
获取页面内容
tvly extract
已有URL时
查找网站内的URL
tvly map
需要定位特定子页面时
批量提取网站板块内容
tvly crawl
需要获取大量页面(如所有/docs/下的内容)时
带引用的深度调研
tvly research
需要多来源综合分析时
如需详细命令参考,请使用各命令对应的独立技能(如
tavily-search
tavily-crawl
),或运行
tvly <command> --help

Output

输出

All commands support
--json
for structured, machine-readable output and
-o
to save to a file.
bash
tvly search "react hooks" --json -o results.json
tvly extract "https://example.com/docs" -o docs.md
tvly crawl "https://docs.example.com" --output-dir ./docs/
所有命令均支持
--json
参数以生成结构化、机器可读的输出,支持
-o
参数将结果保存到文件。
bash
tvly search "react hooks" --json -o results.json
tvly extract "https://example.com/docs" -o docs.md
tvly crawl "https://docs.example.com" --output-dir ./docs/

Tips

小贴士

  • Always quote URLs — shell interprets
    ?
    and
    &
    as special characters.
  • Use
    --json
    for agentic workflows
    — every command supports it.
  • Read from stdin with
    -
    echo "query" | tvly search -
  • Exit codes: 0 = success, 2 = bad input, 3 = auth error, 4 = API error.
  • 始终给URL加引号 — Shell会将
    ?
    &
    视为特殊字符。
  • 在Agent工作流中使用
    --json
    — 所有命令均支持该参数。
  • 通过
    -
    从标准输入读取内容
    echo "query" | tvly search -
  • 退出码:0 = 成功,2 = 输入错误,3 = 身份验证错误,4 = API错误。