Skip to main content
Give OpenCode, the open-source terminal coding agent, live web search, extraction, crawling, and research through the official Tavily plugin, @tavily/opencode-plugin. The plugin drives the Tavily CLI.
1

Install the Tavily CLI

Requires Node.js 20.1 or later. pnpm add -g, yarn global add, and bun add -g work the same way.
2

Sign in to Tavily

This opens Tavily’s sign-in in your browser. Alternatively, set an API key from the Tavily dashboard:
If TAVILY_API_KEY is set in your environment, the plugin passes it through to shell commands.
3

Add the plugin

Add @tavily/opencode-plugin to the plugin array in your opencode.json:
On OpenCode 2, the key is plugins instead of plugin. OpenCode installs npm plugins automatically on next launch.
Or via npm:
4

Try it

Start OpenCode and ask a current-events question:
The agent should load the tavily-search skill, run tvly search, and return results with sources.

What the plugin adds

The plugin registers the Tavily Agent Skills from tavily-ai/skills:
  • tavily-search runs web search, reads URLs, and maps or crawls sites with the Tavily CLI.
  • tavily-research writes multi-source research reports with citations.
  • tavily-entity fills in a company or person record from the web.
  • tavily-list builds a deduplicated table of matches.
  • tavily-monitor sets up recurring checks for new information on a topic.
  • tavily-sdk helps the agent add Tavily to your application code.
OpenCode also loads Agent Skills directly. After installing the CLI and signing in, add the skills to your project:
Add --global to install them for all projects. Start a new OpenCode session to load them.

Example prompts

Troubleshooting

If the agent cannot access the web or Tavily commands fail, check these in order:
  1. Is the plugin listed in opencode.json?
  2. Is the Tavily CLI installed and authenticated?

Learn more