Skip to main content

PyPI

tavily-cli

Get API Key

Sign up at tavily.com
The Tavily CLI (tvly) brings the full Tavily API to your command line. Run web searches, extract content from URLs, crawl websites, discover sitemaps, and launch deep research — all from a single tool. Every command supports --json for machine-readable output, making it easy to integrate into scripts, pipelines, and AI agent workflows.

Installation

Install with the official installer:
Or install manually:
Verify the install:

Authentication

You need a Tavily API key to use the CLI. Get one for free at tavily.com.
This opens your browser for authentication. Tokens are stored in ~/.mcp-auth/.
OAuth login requires Node.js/npx to be available on your system.

Check Your Auth Status

Log Out

This removes stored credentials from disk.

Session Tracking

The CLI automatically attaches a unique session_id to every command it runs, so requests from the same shell invocation can be grouped together. This applies to tvly search, extract, crawl, map, and research. To also associate requests with a specific end-user, set the TAVILY_HUMAN_ID environment variable:
Alternatively, add a human_id field to ~/.tavily/config.json — the environment variable takes precedence if both are set. For security, Tavily hashes human IDs before processing or storing them. See Session Tracking in the API reference for details.

Commands

Search the web using Tavily’s AI-optimized search engine.
Reading from stdin:

Options

Examples

Extract clean, readable content from one or more URLs.
You can pass up to 20 URLs at once.

Options

Examples

Crawl a website starting from a URL and extract content from every discovered page.

Options

Examples

Discover all URLs on a website without extracting content. Useful for building sitemaps or understanding site structure.

Options

Examples

Launch deep, multi-step research on any topic. Tavily’s research engine searches the web, synthesizes sources, and produces a comprehensive report with citations.
This is equivalent to tvly research run "your research topic".Reading from stdin:

Options

Subcommands

Check status of a running research task:
Poll a research task until it completes:
The poll subcommand accepts --poll-interval, --timeout, -o, and --json.

Examples

Interactive Mode

Run tvly with no arguments to enter an interactive REPL where you can run commands without the tvly prefix:

Global Options

These options work with the top-level tvly command:

JSON Mode

Add --json to any command to get machine-readable JSON output. This is useful for piping into other tools like jq, or for integration with scripts and AI agents.
All human-readable output (spinners, status messages) is written to stderr, so stdout contains only the clean JSON when --json is used.

Environment Variables

Uninstall

To also remove stored credentials: