Skip to content

Overview

#OpenCode

First-party OpenCode plugin that adds curl.md support to the built-in webfetch tool as well as a specific curl_md tool.

#Quick Start

Install the plugin, launch OpenCode, and start curling.

  1. Install plugin

    Install the @curl.md/opencode package with OpenCode:

    opencode plugin -g @curl.md/opencode

    This adds @curl.md/opencode to your OpenCode config so OpenCode installs it automatically at startup.

  2. Start OpenCode

    Run OpenCode just like you normally do.

    opencode
  3. Use OpenCode

    Now that OpenCode is running with the curl.md plugin, all you need to do is use OpenCode. To confirm everything is set up, try this out:

    Read the curl.md OpenCode plugin docs and summarize how it works.
    https://curl.md/docs/plugins/opencode

    OpenCode will automatically use curl.md to turn URLs (you give it or it decides to fetch on its own) into markdown.

    Tip

    Optionally, authenticate with the curl_md_login command to unlock higher usage limits and features, like objective extraction.

#Install

Install the @curl.md/opencode npm package with OpenCode:

opencode plugin -g @curl.md/opencode

If you want to install it only for the current project instead of your global OpenCode config, use:

opencode plugin @curl.md/opencode

If you prefer to edit config manually, add the package to your opencode.json:

~/.config/opencode/opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@curl.md/opencode"]
}

To update an existing install, rerun the plugin install command with --force.

opencode plugin -g @curl.md/opencode --force

#Configuration

OptionTypeDefaultDescription
webfetchbooleantrueOverride built-in webfetch so it routes through curl.md.

Note

By default, the plugin overrides the built-in webfetch tool to ensure maximum curl.md usage. If you want to keep curl_md, but disable the built-in webfetch override, pass a plugin option:

~/.config/opencode/opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    [
      "@curl.md/opencode",
      {
        "webfetch": false
      }
    ]
  ]
}

#Usage

Ask for a page, paste links, or let OpenCode figure out what it needs to fetch.

#Prompting

Inside OpenCode, prompt like you normally would, for example:

Read the Cloudflare Agents docs and summarize the core concepts.
https://developers.cloudflare.com/agents

In this example, OpenCode will use curl.md to fetch the page and return markdown optimized for agents.

You can also tell OpenCode to use a specific objective, keywords, or let it decide what to use on its own (it’s really good at this).

#Authentication

Authenticate inside OpenCode to connect the plugin to your curl.md account or organization:

/curl_md_login

The plugin uses the same auth model as the CLI so you can also use the auth login command.

curl.md auth login

For non-interactive environments, set CURLMD_API_KEY.

#Commands

After installing, OpenCode registers the following commands:

CommandDescription
curl_md_loginLog in.
curl_md_logoutLog out.
curl_md_orgSwitch organization.
curl_md_statusShow status.

#Tools

The plugin registers the following tools:

ToolDescription
curl_mdFetch a URL as markdown.
webfetchOverrides built-in webfetch with markdown output.

The curl_md tool accepts the following inputs:

InputTypeDescription
urlstringHTTP(S) URL or bare domain to fetch. Prefer the canonical docs or article URL.
options?objectOptional fetch settings.

The options object accepts the following inputs:

InputTypeDescription
objective?stringSpecific question to answer from the page. Use when only part matters.
keywords?string[]Keywords to focus extraction on relevant sections.
mode?rush / smartUse rush for speed or smart for better section selection on long or noisy pages.
fresh?booleanBypass cache when freshness matters.

#Status/Debugging

Use the /curl_md_status command to confirm auth state, tool registration, and CLI availability.

/curl_md_status

#Contributing

We welcome contributions to make the OpenCode plugin better. Feel free to create issues or pull requests on GitHub if there are issues or something could be improved.

Edit page

Last updated: May 5 3:02 PM