@tavilyai: Agents already live in the terminal. When they need web data, they should be able to run a command, so that's exactly w…
Summary
Tavily CLI is a command-line tool that gives AI agents access to web search, extraction, crawling, and research, returning structured JSON output for direct parsing.
View Cached Full Text
Cached at: 06/10/26, 09:55 PM
Agents already live in the terminal. When they need web data, they should be able to run a command, so that’s exactly what the Tavily CLI lets them do.
Search, extract, crawl, and research all return structured output that agents can parse directly, with no HTML to clean up or additional scraping in between.
One line to install, and your agent has real-time web access built into whatever loop you’re running.
https://docs.tavily.com/documentation/tavily-cli…
Tavily CLI - Tavily Docs
Source: https://docs.tavily.com/documentation/tavily-cli
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\-\-jsonfor machine-readable output, making it easy to integrate into scripts, pipelines, and AI agent workflows.
Installation
Install with the official installer:
curl -fsSL https://cli.tavily.com/install.sh | bash
Or install manually:
uv tool install tavily-cli # or: pip install tavily-cli
Verify the install:
Authentication
You need a Tavily API key to use the CLI. Get one for free attavily.com.
Check Your Auth Status
Log Out
This removes stored credentials from disk.
Session Tracking
The CLI automatically attaches a uniquesession\_idto every command it runs, so requests from the same shell invocation can be grouped together. This applies totvly search,extract,crawl,map, andresearch.To also associate requests with a specific end-user, set theTAVILY\_HUMAN\_IDenvironment variable:
export TAVILY_HUMAN_ID=h_4f9ac
Alternatively, add ahuman\_idfield to~/\.tavily/config\.json— the environment variable takes precedence if both are set.For security, Tavily hashes human IDs before processing or storing them. SeeSession Trackingin the API reference for details.
Commands
Interactive Mode
Runtvlywith no arguments to enter an interactive REPL where you can run commands without thetvlyprefix:
❯ search "latest AI news"
❯ extract https://example.com
❯ exit
Global Options
These options work with the top-leveltvlycommand:
OptionDescription\-\-versionPrint the CLI version and exit.\-\-statusPrint the version and authentication status.\-\-jsonOutput as JSON (applies to\-\-versionand\-\-status).\-\-helpShow help for any command.
tvly --version
tvly --status
tvly search --help
JSON Mode
Add\-\-jsonto any command to get machine-readable JSON output. This is useful for piping into other tools likejq, or for integration with scripts and AI agents.
# Pipe search results through jq
tvly search "AI news" --json | jq '.results[].title'
# Use in a shell script
RESULTS=$(tvly search "latest papers on RAG" --json)
All human-readable output (spinners, status messages) is written to stderr, so stdout contains only the clean JSON when\-\-jsonis used.
Environment Variables
VariableDescriptionTAVILY\_API\_KEYYour Tavily API key. Takes precedence over stored credentials.
Exit Codes
CodeMeaning0Success.2Invalid input or usage error (e.g., missing required argument).3Authentication error (no API key found, or login failed).4API error (rate limit, invalid request, server error).
Uninstall
To also remove stored credentials:
rm -rf ~/.tavily ~/.mcp-auth
Similar Articles
@tavilyai: Curious about how you could use Tavily to take your agents to the next level? We put together a full page of examples f…
Tavily showcases use cases for its real-time web data API to enhance AI agents across sales, recruiting, product, finance, legal, risk, security, travel, and open-source research.
@tavilyai: What happens when you power investment research with Tavily? Five workstreams kick off in parallel, pulling info and so…
Tavily powers financial research by enabling AI agents to retrieve real-time web data, automating tasks like investment analysis and compliance checks.
@tavilyai: Helping to put your pipeline on autopilot is what @Rox_ai agents do. But that requires them to know what's happening ri…
Rox uses Tavily's search and extraction services to power its AI agents for sales automation, significantly cutting down account research time from weeks to seconds. The case study highlights Tavily's reliability, cost-effectiveness, and accuracy in providing real-time data.
@tavilyai: Tavily + @typesafeai's Jev is where real-time web intelligence meets low-latency decision-making. A research agent cons…
Tavily integrates with Jev to provide real-time web intelligence for research agents, enabling efficient decision-making and reducing LLM inference overhead.
@tavilyai: Your @NanoClaw_AI agent just got a new, live view of the web. Tavily Search and Extract are now available in NanoClaw, …
Tavily Search and Extract have been integrated into NanoClaw, enabling personal AI agents to perform real-time web searches and content extraction with keyless access.