Skip to content

OpenCode OpenCode

Setup OpenCode to correctly generate Avo code based on your prompt.

Quick use

Paste the docs link in your prompt and ask OpenCode to read it before generating code.

bash
Read https://docs.avohq.io/4.0/docs-map.md and use it as a reference for Avo code.

Permanent setup

OpenCode reads the AGENTS.md file from your repository. Add a line pointing to Avo's docs:

bash
When working with Avo, use the docs at https://docs.avohq.io/4.0/docs-map.md as a reference.

Or save the docs in your repo and reference the file from AGENTS.md:

bash
curl -L https://docs.avohq.io/4.0/docs-map.md --create-dirs -o docs/avo-docs-map.md

MCP server

MCP is an API to communicate with AI models. You can add MCP servers and OpenCode will communicate with them to get more accurate results.

I suggest using Context7 MCP server which provides many libraries including Avo's docs.

Add this to your opencode.json config file:

json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "context7": {
      "type": "local",
      "command": ["npx", "-y", "@upstash/context7-mcp"]
    }
  }
}

Now you can ask OpenCode anything about Avo, and write use context7 at the end of your prompt.

For example:

bash
create a new Avo resource for a product model. use context7