OpenCode
mantis setup opencode installs the CLI’s bundled skills for OpenCode, the open-source coding agent. OpenCode loads them from disk and exposes them through its skill tool, selecting one when your request matches its description. The agent then runs mantis use in Bash.
Install skills
mantis setup opencodeOpenCode is the only provider that always gets both scopes in a single run:
| Scope | Path |
|---|---|
| Global | ~/.config/opencode/skills/<name>/SKILL.md |
| Project | ./.opencode/skills/<name>/SKILL.md, relative to your current directory |
Run the command from your project root if you want the project-scoped copy in the right place. Commit .opencode/skills/ if your team should share it.
Skills
| Skill | What it covers |
|---|---|
mantis | The hub skill: mantis:// URIs, the read-reason-mutate tool tiers, argument passing, bag building, bulk export. |
mantis-select | Switching the active space or thread by UUID, without opening the blocking interactive picker. |
mantis-extensions | Building, modifying, validating, packaging, and installing Mantis extensions and vertical panels. |
mantis-createmap | mantis create map from a local CSV, including how to type each column. |
mantis-codebase | mantis create codebase to index a repo into a searchable map. |
mantis-createmap and mantis-codebase are marked explicit-invoke only, so the agent will not select them on its own. The other three it can pick up from their descriptions.
Typical flow
- Install and configure the CLI.
npm install -g mantisai-cli, thenmantis setup. See Install. - Sync the skills from your project root.
mantis setup opencode. - Ask OpenCode about your workspace. The
skilltool loads the matching skill. - Let it orient itself. The agent runs
mantis use get_space_context, then othermantis useandmantis createcommands.
MCP versus CLI
Do not add a Mantis MCP server to opencode.json. The CLI sends the auth header and X-Space-State-ID on every mantis use call, reading them fresh from ~/.mantis/config.json, so a thread change applies to the very next command with no reconnect. A long-lived MCP connection would keep the thread it was opened with.
If you have leftover Mantis entries in opencode.json from an older setup, remove them.
Refresh after CLI updates
npm install -g mantisai-cli@latest
mantis setup opencodeSkills are copied rather than linked, so this step is required after every upgrade.
Troubleshooting
The agent does not know about Mantis. Confirm ~/.config/opencode/skills/mantis/SKILL.md exists. If it does not, re-run mantis setup opencode.
Project skills missing. The project copy goes to whichever directory you ran the command from. Re-run it from the project root.
Wrong thread. Run mantis select thread in a terminal, then have the agent call mantis use get_space_context again.