This guide walks you through adding the Purchasely AI Plugin to your OpenCode setup. Once installed, OpenCode loads the Purchasely skills (integrate, review, debug) and the sdk-expert agent automatically.
- OpenCode installed and configured (
opencode --version). - Node.js ≥ 18 (OpenCode plugin loader requirement).
- Git available on
PATH(the plugin is fetched directly from the GitHub repository). - An OpenCode project — i.e. a directory with an
opencode.json(or willingness to create one).
Add the plugin entry to your project's opencode.json:
{
"plugin": ["purchasely@git+https://github.com/Purchasely/Purchasely-AI-Plugin.git"]
}If you already have other plugins listed, append the entry to the existing "plugin" array — do not overwrite it.
The next time you launch OpenCode in this project, the plugin is fetched, cached, and loaded automatically. No manual rule-copying or symlinks.
After installation, ask OpenCode anything about the Purchasely SDK:
You: Tell me about your Purchasely skills.
OpenCode: I have three task-scoped skills (integrate, review, debug)
and a free-form Q&A command (/purchasely:question) for the
Purchasely SDK on iOS, Android, React Native, Flutter, and Cordova.
Other examples:
Integrate the Purchasely SDK into this iOS app.Review my Purchasely integration for common mistakes.Debug why my paywall shows blank.How do I display a Purchasely paywall in SwiftUI?
OpenCode honors the version pin in opencode.json. To pull the latest changes from main:
# Re-fetch the plugin (clears the cache for this entry)
opencode plugin update purchaselyIf your version of OpenCode does not expose plugin update, remove the plugin cache directory (~/.opencode/plugins/purchasely/) and relaunch.
To pin to a specific tag or commit, change the spec to:
{ "plugin": ["purchasely@git+https://github.com/Purchasely/Purchasely-AI-Plugin.git#v1.0.0"] }- Confirm
opencode.jsonis valid JSON (no trailing commas, no comments). - Run OpenCode with verbose logging:
opencode --log-level debugand look forplugin: purchaselylines. - Make sure git can reach
github.comfrom the machine running OpenCode —git ls-remote https://github.com/Purchasely/Purchasely-AI-Plugin.gitshould print refs.
The git+ spec requires git on PATH and write access to the user-level OpenCode cache. If install fails with EACCES or EPERM:
# Install the plugin into a writable location explicitly
npm install --prefix %USERPROFILE%\.opencode\plugins git+https://github.com/Purchasely/Purchasely-AI-Plugin.gitThen point opencode.json at the local copy:
{ "plugin": ["purchasely@file:%USERPROFILE%/.opencode/plugins/node_modules/purchasely"] }If /purchasely:integrate (or asking "use the integrate skill") returns "skill not found":
- Check that OpenCode loaded the plugin (see verbose logs above).
- Confirm the cached plugin contains
skills/integrate/SKILL.md,skills/review/SKILL.md,skills/debug/SKILL.md. If the cache looks empty or stale, remove it and relaunch. - Verify the plugin version in
opencode.jsonis recent enough to include the skill set (≥1.0.0).
- Purchasely AI Plugin README — overview and per-harness Quickstart.
- Purchasely SDK documentation.
- OpenCode documentation.