Skip to content

PromptScript API


Function: generateOpenCodePlugin()

generateOpenCodePlugin(hooks): string | null

Defined in: formatters/src/hook-adapters.ts:1292

Generate the project-local OpenCode plugin for portable hook definitions.

Returns the plugin source, or null when no enabled hook maps to an OpenCode tool execution event. Output is deterministic for equal hook input.

Parameters

hooks

HookDefinition[]

Returns

string | null