Skip to main content

Module opencode

Module opencode 

Source
Expand description

The OpenCode V2 opencode.json shape, rendered by one builder.

Both the bridge (user or managed tier on a device) and the headless agent-runs host (an isolated run home) emit this document, so the keys cannot drift between them. Only the V2 shape (@opencode/cli >= 2.0.30) is modelled: providers.<id>{package, settings, models}, policies, mcp.servers.

policies are evaluated last-match-wins by OpenCode; a tool.use resource is <tool>:<pattern> and an integration.use resource is mcp:<name>, plugin:<id or path> or skill:<id>. lockdown_policies relies on that ordering: each allow follows the deny it carves out of. A plugin allowed by path is safe only where the user cannot write that path.

Copyright (c) systemprompt.io — Business Source License 1.1. See https://systemprompt.io for licensing details.

Modules§

agents_md
The bridge-owned block of OpenCode’s AGENTS.md.

Structs§

Lockdown
What lockdown_policies confines a client to.
McpBlock
ModelEntry
ModelLimit
OpenCodeConfig
A whole V2 opencode.json document.
Policy
One policies[] statement.
Provider
One providers.<id> entry.
ProviderSettings

Enums§

ApiKeyRef
Where OpenCode reads a secret from at load time; never the secret.
McpOAuth
A remote server’s oauth setting. OpenCode registers every remote server as an OAuth integration and answers a 401 with client registration unless oauth is false; only that opt-out is modelled.
McpServer
One mcp.servers.<name> entry.
PolicyAction
PolicyEffect

Constants§

MIN_CLIENT_VERSION
OPENAI_COMPATIBLE_PACKAGE
SCHEMA_URL

Functions§

gateway_provider
lockdown_policies