Skip to content

Gemini CLI

Target id Package Ship with
gemini-cli @oiap/exporter-gemini-cli oiap sync (git install) or install-agent-plugin
Terminal window
npx oiap build oiap.plugin.ts --target gemini-cli --out dist/gemini-cli
npx install-agent-plugin <owner>/<repo> --plugin <plugin-id> --agent gemini-cli

Gemini CLI target exporter for Open Interoperable Agent Plugins.

This package lowers OIAP plugin primitives into Gemini CLI extension files. The generated bundle uses the documented Gemini extension layout:

gemini-extension.json
GEMINI.md
commands/<command>.toml
skills/<skill>/SKILL.md
agents/<agent>.md
hooks/hooks.json
policies/oiap-policy.toml

MCP servers are embedded in gemini-extension.json, because Gemini CLI loads extension MCP configuration from the manifest. Hook configuration calls the generated .oiap/runtime/runner.mjs raw-JS hook runtime through ${extensionPath} variables.

Most authors should use the CLI:

Terminal window
bun run oiap build ./oiap.plugin.ts --target gemini-cli --out ./build/gemini-cli

The exporter records policy evidence in .oiap/policy.json and emits Gemini Policy Engine TOML rules for supported deny and ask policies. Allow policies and non-tool policy surfaces remain visible as degradations because extension policy tiers cannot silently auto-approve tool calls.

Where install-agent-plugin and installPlugin() write the bundle, from the target profile. --out <dir> overrides them.

Scope Path
Local (default) ./.gemini/extensions/<plugin-id>
Global (--global) ~/.gemini/extensions/<plugin-id>

From the platform support matrix (see its legend).

Profile Package Rules Skills Commands Hooks Agents MCP Runtime Policy
core Y Y Y Y Y P Y F Y

High-fidelity extension target. Gemini CLI extensions use root gemini-extension.json, custom command TOML files under commands/, root or manifest-listed context files such as GEMINI.md, Agent Skills under skills/, preview sub-agent markdown under agents/, hooks/hooks.json, manifest mcpServers, extension settings, and policy TOML under policies/. OIAP emits native bundle artifacts for those surfaces and records degradations for preview sub-agents, unsupported permission-request hooks, non-generated runtime modules, and extension policy allow decisions that Gemini CLI intentionally ignores.