PyPI
tavily-cliGet API Key
Sign up at tavily.com
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:Authentication
You need a Tavily API key to use the CLI. Get one for free at tavily.com.Option 1: Login with an API key (recommended)
Option 1: Login with an API key (recommended)
~/.tavily/config.json (readable only by your user).Option 2: Browser-based OAuth
Option 2: Browser-based OAuth
~/.mcp-auth/.OAuth login requires Node.js/npx to be available on your system.
Option 3: Environment variable
Option 3: Environment variable
Check Your Auth Status
Log Out
Session Tracking
The CLI automatically attaches a uniquesession_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:
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
tvly search
tvly search
tvly extract
tvly extract
tvly crawl
tvly crawl
tvly map
tvly map
tvly research
tvly research
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 Poll a research task until it completes:The
tvly research run "your research topic".Reading from stdin:Options
Subcommands
Check status of a running research task:poll subcommand accepts --poll-interval, --timeout, -o, and --json.Examples
Interactive Mode
Runtvly 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-leveltvly 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.
--json is used.
Environment Variables
Exit Codes
Exit Codes