Quick start
Install
Section titled “Install”The @oiap/cli package installs the oiap binary. Install it with the
authoring SDK in your plugin project:
npm install --save-dev @oiap/cli @oiap/coreList the registered exporter targets:
npx oiap targetsWrite a plugin
Section titled “Write a plugin”Create a prompt file and an oiap.plugin.ts next to it:
my-review-plugin/ oiap.plugin.ts prompts/ review.mdReview the current change for correctness, security risks, missing tests, andmaintainability issues. Lead with concrete findings and include file referenceswhen possible.import type { PluginDefinition } from "@oiap/core";import { definePlugin, markdownFile } from "@oiap/core";
const reviewPrompt = markdownFile("prompts/review.md", { baseUrl: import.meta.url,});
export default definePlugin({ manifest: { id: "review-guard", name: "Review Guard", version: "1.0.0", description: "Adds a portable review command for agent-assisted code review.", license: "MIT", categories: ["review", "quality", "commands"], supportedTargets: ["claude-code", "codex", "vscode-copilot-chat"], }, invocations: [ { id: "review-guard-invocation", canonical: "review-guard", helpText: "Review the current change before it is merged.", examples: ["/review-guard", "/review-guard Focus on security"], }, ], instructions: [ { id: "review-guard-prompt", purpose: "command", triggers: ["review", "code review", "pre-merge review"], body: reviewPrompt, }, ], commands: [ { id: "review-guard-command", invocation: { id: "review-guard-invocation", kind: "invocation" }, prompt: { id: "review-guard-prompt", kind: "instruction" }, }, ],} satisfies PluginDefinition);Write a plugin explains each field.
Build for one target:
npx oiap build oiap.plugin.ts --target claude-code --out dist/claude-codeBuild for every registered target (one directory per target under
dist/oiap/):
npx oiap build oiap.plugin.ts --out dist/oiapEach output directory holds host-native files plus OIAP metadata in .oiap/:
the bundle manifest, source map and capability report.
The CLI prints one line per target with its status and any issues:
Built claude-code -> dist/claude-code (8 files, ok)The output directory is cleaned before each build, and must be inside the current directory.
Ship it
Section titled “Ship it”Don’t commit dist/. Pick one or both ways to get the plugin to users:
- Commit host files with
oiap syncfor hosts that install from git. - Document
install-agent-pluginfor hosts that read files from the user’s project.