@metaharness/opencode is a one-command scaffold that gives you a working OpenCode .opencode/ configuration tree wired into the MetaHarness CLI. MetaHarness is the underlying agent-harness generator (see https://github.com/ruvnet/agent-harness-generator); this package is a thin, pinned wrapper that hard-codes the right template and host flags so you don't have to remember them.
The goal is simple: if you want to start an OpenCode-based agent project and you are tired of copying boilerplate from another repo, run one npx command and you have a clean skeleton in seconds. It is deliberately minimal — no example agents, no preloaded MCP servers, no opinionated prompts. It gets out of your way.
Run the scaffold:
npx @metaharness/opencode@latest my-botmy-bot is whatever you want the project directory to be called. The wrapper invokes metaharness@latest under the hood with --template minimal --host opencode --force. Any extra arguments you pass after the name are forwarded to metaharness untouched, so you can layer on additional flags if you know what you are doing.
After scaffolding:
cd my-bot
npm install
harness doctorharness doctor is the smoke test. It checks that the OpenCode config file is in place, that the harness CLI is on your PATH, that you are on a recent enough Node version, and that the scaffold's structure parses cleanly. If anything is off, it tells you what to fix.
The scaffold is safe to re-run into an existing directory because the wrapper passes --force through to metaharness. That means you can use it to refresh your skeleton if upstream changes, though you will want to commit your work first.
What ships in the box:
.opencode/config.json— the OpenCode host configuration, pointing at the harness root.opencode/agents/— an empty agent directory with one stub so you can see the shape.opencode/mcp/— an empty MCP server directory ready for declarationsharness.config.mjs— the top-level manifest, marked withtemplate: 'minimal'andhost: 'opencode'- A
package.jsonwith theharnessCLI as a dev dependency and convenience scripts (npm run doctor,npm run validate) - Seeded
.gitignoreandREADME.md
What is deliberately not included:
- No prebuilt domain agents (research agents, code reviewers, etc.) — those belong in vertical templates
- No bundled MCP servers — pick your own
- No prompts or system messages beyond a single example stub
- No CI configuration — bring your own
This is the right starting point if you want full control. If you want a ready-made multi-agent workflow, pick one of the metaharness vertical templates instead.
Validate the manifest without running anything:
harness validateThis parses harness.config.mjs, walks the agent and MCP directories, and reports any structural issues. Useful in CI.
Treat the scaffold as a Claude Code plugin directory. Because OpenCode and Claude Code share enough of the host contract, the harness skeleton works in both:
claude -p --plugin-dir my-bot "summarize the README"Add an MCP server after the fact: drop a declaration file into .opencode/mcp/ and re-run harness validate. The minimal template intentionally ships zero so the surface stays clean and you do not inherit servers you did not ask for.
Re-scaffold into the same directory if upstream metaharness ships fixes you want to pull in:
npx @metaharness/opencode@latest my-botCommit first; --force is passed through.
If you want to deviate from the pinned flags — different template, different host, different combination — call npx metaharness@latest directly. This wrapper is for the OpenCode minimal path only; the underlying generator covers far more ground.
License: MIT. Built on metaharness (https://www.npmjs.com/package/metaharness).