Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions .opencode/INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Installing Purchasely AI Plugin in OpenCode

This guide walks you through adding the Purchasely AI Plugin to your [OpenCode](https://opencode.ai) setup. Once installed, OpenCode loads the Purchasely skills (`integrate`, `review`, `debug`) and the `sdk-expert` agent automatically.

## Prerequisites

- 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).

## Installation

Add the plugin entry to your project's `opencode.json`:

```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 `cp` of configs, no symlinks.

## Usage

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?`

## Updating

OpenCode honors the version pin in `opencode.json`. To pull the latest changes from `main`:

```bash
# Re-fetch the plugin (clears the cache for this entry)
opencode plugin update purchasely
```

If 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:

```json
{ "plugin": ["purchasely@git+https://github.com/Purchasely/Purchasely-AI-Plugin.git#v1.0.0"] }
```

## Troubleshooting

### Plugin not loading

1. Confirm `opencode.json` is valid JSON (no trailing commas, no comments).
2. Run OpenCode with verbose logging: `opencode --log-level debug` and look for `plugin: purchasely` lines.
3. Make sure git can reach `github.com` from the machine running OpenCode — `git ls-remote https://github.com/Purchasely/Purchasely-AI-Plugin.git` should print refs.

### Windows install issues

The `git+` spec requires git on `PATH` and write access to the user-level OpenCode cache. If install fails with `EACCES` or `EPERM`:

```powershell
# Install the plugin into a writable location explicitly
npm install --prefix %USERPROFILE%\.opencode\plugins git+https://github.com/Purchasely/Purchasely-AI-Plugin.git
```

Then point `opencode.json` at the local copy:

```json
{ "plugin": ["purchasely@file:%USERPROFILE%/.opencode/plugins/node_modules/purchasely"] }
```

### Skills not found

If `/purchasely:integrate` (or asking "use the integrate skill") returns "skill not found":

1. Check that OpenCode loaded the plugin (see verbose logs above).
2. 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.
3. Verify the plugin version in `opencode.json` is recent enough to include the skill set (≥ `1.0.0`).

## See also

- [Purchasely AI Plugin README](../README.md) — overview and per-harness Quickstart.
- [Purchasely SDK documentation](https://docs.purchasely.com).
- [OpenCode documentation](https://opencode.ai/docs).
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ All notable changes to this project are documented here. The format is based on
- `AGENTS.md` at the repository root — cross-vendor [agents.md](https://agents.md) standard, auto-detected by Codex, Cursor, Zed, Mistral `vibe`, and other harnesses without running `install.sh`.
- `GEMINI.md` at the repository root — imports the `integrate`, `review`, and `debug` skills via `@./skills/...` so Gemini CLI picks up the full playbook automatically.
- `gemini-extension.json` at the repository root — unlocks one-shot install via `gemini extensions install https://github.com/Purchasely/Purchasely-AI-Plugin`.
- OpenCode plugin support via `.opencode/INSTALL.md` — covers prerequisites, the one-line `opencode.json` install, usage examples, updating, and Windows troubleshooting (`npm install --prefix` workaround).
- README *OpenCode* block in the per-harness Quickstart section pointing at `.opencode/INSTALL.md`.

### Changed

Expand Down
Loading