Coding agents
OpenCode
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.
Before you begin
Section titled “Before you begin”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
- Open your project
- API keys
- Issue API key
tlm_••••••••••••••••Keys start with tlm_.
Never paste a key into a chat with OpenCode. Every path below sets it for you.
Install
Section titled “Install”Connect OpenCode to Telem
-
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 | shTerminal window npx @telemai/create@latestIn PowerShell, with Node.js 20 or later. Or run the macOS and Linux command in WSL or Git Bash.
-
Restart OpenCode. OpenCode loads plugins when it starts.
-
Check the install.
@telemai/opencode-pluginis in thepluginlist.Terminal window opencode debug config
Install with no prompts, for example in CI
curl -fsSL https://docs.telem.ai/install.sh | sh -s -- --yes --client opencode --key-env TELEM_API_KEYnpx @telemai/create@latest --yes --client opencode --key-env TELEM_API_KEYIn PowerShell, with Node.js 20 or later. Or run the macOS and Linux command in WSL or Git Bash.
-
Add the plugin and set your key. The plugin reads the key from
TELEM_API_KEY, so set it in the shell you start OpenCode from.Terminal window opencode plugin @telemai/opencode-plugin --globalexport TELEM_API_KEY=... # your key -
Restart OpenCode. OpenCode loads plugins when it starts.
-
Check the install.
@telemai/opencode-pluginis in thepluginlist.Terminal window opencode debug config
On OpenCode 2.x, add the plugin with opencode plugin add @telemai/opencode-plugin.
-
Start OpenCode with your key set, and paste this prompt. OpenCode runs the installer, which reads the key from
TELEM_API_KEY, so the key never goes into the chat.Terminal window export TELEM_API_KEY=tlm_your_keyopencodeTerminal window $env:TELEM_API_KEY = "tlm_your_key"opencodeSet up Telem web search for this coding agent.1. Read https://docs.telem.ai/llms.txt to learn what Telem is.2. Check that the TELEM_API_KEY environment variable is set. Do not print itsvalue. If it is not set, stop and ask me to set it and restart you.3. Run the Telem installer for this agent, with no prompts:curl -fsSL https://docs.telem.ai/install.sh | sh -s -- --yes --client opencode --key-env TELEM_API_KEYOn Windows, in PowerShell, run this instead:npx @telemai/create@latest --yes --client opencode --key-env TELEM_API_KEY4. Show me the installer's summary. Then tell me to restart OpenCode,so that the Telem tools load. -
Restart OpenCode. OpenCode loads plugins when it starts.
-
Check the install.
@telemai/opencode-pluginis in thepluginlist.Terminal window opencode debug config
If it does not work, see If something goes wrong.
Search and read
2 toolstelem_searchSearches the web on several providers in one call.telem_fetchReads the full text of up to 5 pages.
Specific to OpenCode
Section titled “Specific to OpenCode”-
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_ROUTINGstill 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, setTELEM_ALLOW_BUILTIN_WEBFETCH=1before you start OpenCode. -
Subagents get the tools too. The plugin allows
telem_searchandtelem_fetch, and denieswebfetch, for every agent: on OpenCode 1.x the main agent and theexploreandgeneralsubagents, on 2.x every agent that is not hidden. A permission that you set yourself still wins.
Update and remove
Section titled “Update and remove”OpenCode does not update plugins on its own. To get a newer version, remove the cached copy:
rm -rf ~/.cache/opencode/packages/@telemaiTo 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. |
Learn more
Section titled “Learn more”Set the tier, the providers and auto-routing in one file, for OpenCode and your other agents.
Every option, the values it takes, and which setting wins.
What each search option does, from tiers to date windows.
Choose the fetch provider and tier, or read pages live.