opencodewire

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const SkillsSubdir = ".opencode/skills"

SkillsSubdir is where rendered skills live in an opencode project, relative to the project root. It is also the glob root wired into opencode.json instructions.

Variables

This section is empty.

Functions

func RetireLegacyAgents added in v0.4.0

func RetireLegacyAgents(projectDir string) (removed bool, warning string, err error)

RetireLegacyAgents removes <projectDir>/.opencode/AGENTS.md when its content carries legacyAgentsFingerprint, proof it is a pre-migration render and not user-authored, and reports whether it did. A file that fails the fingerprint check is left in place, with warning explaining why; a missing file is not an error, so an already-migrated project is untouched.

func UnwireConfig added in v0.4.0

func UnwireConfig(projectDir string) (changed bool, err error)

UnwireConfig removes the instruction globs and gopls MCP entry WireConfig merged into <projectDir>/opencode.json. It drops "$schema" only when it is the sole remaining key and exactly WireConfig's URL, so a user's own $schema survives; invalid JSON or an absent file leaves things untouched (wraps fsx.ErrUnparseableJSON). changed distinguishes a real removal from a no-op, since both return a nil error.

func WireConfig

func WireConfig(projectDir string, gopls GoplsWiring) error

WireConfig merges the standards wiring into <projectDir>/opencode.json: the $schema, the instruction globs, and (when gopls is WithGopls) the gopls MCP server. It preserves every other key, existing instructions, and other MCP servers, and is idempotent.

Types

type GoplsWiring

type GoplsWiring string

GoplsWiring selects whether WireConfig also merges the gopls MCP server entry into opencode.json, replacing a withGopls bool flag argument.

const (
	// WithGopls tells WireConfig to merge the gopls MCP server entry.
	WithGopls GoplsWiring = "with-gopls"
	// WithoutGopls tells WireConfig to leave the mcp block untouched.
	WithoutGopls GoplsWiring = "without-gopls"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL