Skip to content

Coding agents

The @telemai/opencode-plugin package adds web search and page reading to OpenCode. It also turns off OpenCode’s built-in webfetch, so page reads go through Telem.

OpenCode 1.17.0 or newer. For the installer, Node.js 20 or later; it checks for it and offers to install it.

Create a Telem API key

  1. Open your project
  2. API keys
  3. Issue API key

tlm_••••••••••••••••Keys start with tlm_.

Open the console

Never paste a key into a chat with OpenCode. Every path below sets it for you.

Connect OpenCode to Telem

  1. Run the installer in your terminal. If it shows a menu, pick opencode. Paste your key when the installer asks. The field is masked, and the key never appears on screen. The installer adds the plugin to your OpenCode config.

    Terminal window
    curl -fsSL https://docs.telem.ai/install.sh | sh
  2. Restart OpenCode. OpenCode loads plugins when it starts.

  3. Check the install. @telemai/opencode-plugin is in the plugin list.

    Terminal window
    opencode debug config
Install with no prompts, for example in CI
Terminal window
curl -fsSL https://docs.telem.ai/install.sh | sh -s -- --yes --client opencode --key-env TELEM_API_KEY

Search and read

2 tools
  • telem_search Searches the web on several providers in one call.
  • telem_fetch Reads the full text of up to 5 pages.
  • Options in opencode.json. You can give the plugin its own options:

    { "plugin": [["@telemai/opencode-plugin", { "tier": "max" }]] }

    They win over every Telem file, except that TELEM_AUTO_ROUTING still wins for auto-routing. OpenCode reads them when it loads the plugin, so restart after you edit them.

  • Keep OpenCode’s own webfetch. The plugin turns it off. To keep it, set TELEM_ALLOW_BUILTIN_WEBFETCH=1 before you start OpenCode.

  • Subagents get the tools too. The plugin allows telem_search and telem_fetch, and denies webfetch, for every agent: on OpenCode 1.x the main agent and the explore and general subagents, on 2.x every agent that is not hidden. A permission that you set yourself still wins.

OpenCode does not update plugins on its own. To get a newer version, remove the cached copy:

Terminal window
rm -rf ~/.cache/opencode/packages/@telemai

To remove the plugin, delete "@telemai/opencode-plugin" from the plugin array in your OpenCode config, ~/.config/opencode/opencode.json or opencode.jsonc.

Restart OpenCode after you update or remove.

What the installer changed outside the plugin
File What it holds To undo
~/.telem/credentials.json Your key Delete it if no other Telem integration uses it.
~/.telem/telem.json Your Telem options Delete it if no other Telem integration uses it.
Configuration

Set the tier, the providers and auto-routing in one file, for OpenCode and your other agents.

Parameters

Every option, the values it takes, and which setting wins.

Search parameters

What each search option does, from tiers to date windows.

Fetch parameters

Choose the fetch provider and tier, or read pages live.

Was this page helpful?