CLI reference
The @oiap/cli package installs the oiap binary.
npm install --save-dev @oiap/cli @oiap/corenpx oiap --helpoiap build <plugin-file> [--target all|<target>] [--out <dir>] [--export <name>] [--json]oiap sync [plugin-file] [--check] [--layout root|plugins] [--target <targets>] [--repo <dir>] [--force] [--json]oiap targets [--json]Every command accepts -h or --help. Options take a value as the next
argument or inline (--target=codex).
oiap build
Section titled “oiap build”Builds target bundles from an OIAP plugin file.
npx oiap build oiap.plugin.ts --target claude-code --out dist/claude-codenpx oiap build oiap.plugin.ts --out dist/oiap| Option | Description |
|---|---|
-t, --target <target> |
Target to build. Defaults to all. |
-o, --out <dir> |
Output directory. Defaults to dist/oiap. |
-e, --export <name> |
Plugin export name. Defaults to default, then plugin. |
--json |
Print a machine-readable build summary. |
- With
--target all, each target goes to<out>/<target>. With one target, the bundle goes to<out>itself. - The output directory is cleaned before each build so stale files cannot remain. It must be inside the current directory and cannot be the current directory itself.
- The command writes bundle files only; it does not install them into a host.
- Exits with status 1 when any target’s report status is
unsupported.
oiap sync
Section titled “oiap sync”Writes the files that git-installed hosts read into the repository, plus their
marketplace catalogs and .oiap/sync.json. Commit the result. See
Ship with oiap sync.
npx oiap syncnpx oiap sync --checknpx oiap sync --layout pluginsnpx oiap sync --target claude-code,codex| Option | Description |
|---|---|
[plugin-file] |
Plugin file. Defaults to oiap.plugin.ts. |
--check |
Write nothing; exit 1 if the committed files are out of date. |
--layout <layout> |
root (default): hosts share the root where they can. plugins: hosts that support it go under plugins/<target>/. |
-t, --target <list> |
Comma-separated targets. Defaults to the manifest’s supportedTargets. Can be repeated. |
--repo <dir> |
Repository directory. Defaults to the current directory. |
--force |
Overwrite files that a previous sync did not write. |
-e, --export <name> |
Plugin export name. Defaults to default, then plugin. |
--json |
Print a machine-readable summary (placements, notes, errors, differences, written, removed). |
Sync writes Gemini CLI, Antigravity, OpenClaw, Claude Code, Codex, Cursor, GitHub Copilot CLI and VS Code Copilot. Other targets install into a project; use install-agent-plugin for them.
Exits with status 1 when sync reports an error, when a target is
unsupported, or, with --check, when files are out of date.
oiap targets
Section titled “oiap targets”Lists registered exporter targets and their packages.
npx oiap targetsnpx oiap targets --json| Option | Description |
|---|---|
--json |
Print { "targets": [...] }. |
See Targets for every target id.
Inside this repository
Section titled “Inside this repository”Contributors run the CLI from source:
bun run oiap targetsbun run oiap build examples/security-guidance/oiap.plugin.ts --target claude-code --out dist/dev/security-guidanceRelated
Section titled “Related”install-agent-pluginoptions.@oiap/clipackage README.