Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

OpenCode

agentpack opencode launches OpenCode with a redirected config root. Unlike Claude’s additive plugin dir, OpenCode is configured by pointing it at a different config directory entirely.

What the launcher does

OpenCode searches its config root — opencode.json plus agents/, commands/, modes/, plugins/, skills/ — like the standard .opencode / ~/.config/opencode locations. agentpack stages a complete root and runs:

OPENCODE_CONFIG_DIR="<staging>/modes/<mode>/opencode" opencode

Extra arguments are forwarded:

agentpack opencode --model anthropic/claude-sonnet-4-6
agentpack --yolo opencode      # stages opencode.json with "permission": "allow"

What the root contains

opencode/
  opencode.json          # seeded config + merged MCP + attribution instruction
  agents/   commands/   skills/    # converted pack artifacts
  plugins/  modes/

The root is seeded from your real ~/.config/opencode/ (opencode.json, agents, commands, modes, plugins, skills) so provider and auth configuration keep working even though the config root is redirected. Converted pack content is then overlaid into OpenCode’s native markdown locations.

Artifact handling

ArtifactStaged as
CommandsOpenCode command markdown
AgentsOpenCode agent markdown
SkillsOpenCode skill
RulesBest-effort skill fallback
MCPMerged into opencode.json

Attribution

OpenCode has no first-class attribution setting. agentpack writes an agentpack-no-attribution.md system-prompt file and adds it to instructions[] in the staged opencode.json — prompt-level guidance, the best available lever. Set AGENTPACK_KEEP_ATTRIBUTION=1 to skip it.

Inspecting the staged root

agentpack sync
ls "$AGENTPACK_STAGING_ROOT/modes/default/opencode/"   # if AGENTPACK_STAGING_ROOT is set

Environment

VariableEffect
OPENCODE_PATHPath to the opencode binary
AGENTPACK_STAGING_ROOTOverride the staging root

See Environment Variables for the complete list.