OpenCode is a terminal-based AI coding assistant that supports 75+ LLM providers through the AI SDK. Connect it to ClearMaas by configuring a custom provider in your JSON config file.Documentation Index
Fetch the complete documentation index at: https://docs.clearmaas.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- OpenCode installed (
npm install -g opencodeor via installer) - A ClearMaas API key starting with
sk-
Config file locations
OpenCode merges configuration from multiple sources (later overrides earlier):- Remote config (
.well-known/opencode) �?organizational defaults - Global config (
~/.config/opencode/opencode.json) �?user preferences OPENCODE_CONFIGenv var �?custom overrides- Project config (
opencode.jsonin project root) �?project-specific OPENCODE_CONFIG_CONTENTenv var �?runtime overrides
Setup via global config
Add to~/.config/opencode/opencode.json:
Setup via environment variable
For temporary or CI usage, useOPENCODE_CONFIG_CONTENT:
Using environment variables in config
Reference API keys via env vars to avoid hardcoding:Choosing models
Set the default model in config:/models command in the TUI:
Using a separate small model
OpenCode can use a cheaper model for lightweight tasks (title generation, etc.):Verifying the setup
Config example with all options
timeout�?Request timeout in milliseconds (default: 300000)setCacheKey�?Always set a cache key for designated providerbaseURL�?Override the default API endpoint