docs/integrations/opencode.mdx
OpenCode is an open-source AI coding assistant that runs in your terminal.
Install the OpenCode CLI:
curl -fsSL https://opencode.ai/install | bash
<Note>OpenCode requires a larger context window. It is recommended to use a context window of at least 64k tokens. See Context length for more information.</Note>
ollama launch opencode
To configure without launching:
ollama launch opencode --config
<Note>ollama launch opencode passes its configuration to OpenCode inline via the OPENCODE_CONFIG_CONTENT environment variable. OpenCode deep-merges its config sources on startup, so anything you declare in ~/.config/opencode/opencode.json is still respected and available inside OpenCode. Models declared only in opencode.json won't appear in ollama launch's model-selection menu.</Note>