JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 43
  • Score
    100M100P100Q97126F
  • License CC-BY-4.0

Developer toolkit to package and publish OpenCode extensions (agents, commands, plugins, skills, tools, themes) as one npm plugin.

Package Exports

  • @itlackey/openkit
  • @itlackey/openkit/install

Readme

OpenKit

Ship production-ready OpenCode extensions as one npm package.

OpenKit gives you a clean packaging pattern for agents, commands, plugins, skills, tools, and themes. Add files to opencode/, publish once, and your users install with a single plugin entry.

OpenKit is built for teams publishing OpenCode plugins and OpenCode extension packs to npm.

Why developers use OpenKit

  • One package, full extension surface: ship commands, agents, skills, tools, plugins, and themes together.
  • Safe installs by default: existing user files are preserved (overwrite: false).
  • Works with real plugin code: use standalone installer mode or compose it into your own plugin.
  • Low maintenance: no custom copy scripts or postinstall hacks.

Quick start

1) Create from template

Click Use this template on GitHub, then update name in package.json.

2) Add extensions

Drop files into the matching subdirectory:

opencode/
├── agents/       # .md    — agent definitions (primary or subagent)
├── commands/     # .md    — slash commands
├── plugins/      # .ts    — full Plugin API
├── skills/       # SKILL.md in named folders
├── tools/        # .ts    — custom tools
└── themes/       # .json  — color themes

3) Export the installer plugin

In src/plugin.ts:

import { createInstallerPlugin } from "../helpers/install"
export const plugin = createInstallerPlugin({
  name: "my-opencode-extension",
})

sourceUrl is optional in a template repo. Pass sourceUrl: import.meta.url when using @itlackey/openkit/install from an external dependency.

4) Install in a project

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["my-opencode-extension"]
}

When OpenCode starts, the installer copies your opencode/ files into the project's .opencode/ directory. Existing files are never overwritten by default, so user customizations stay intact.

Included examples

Extension Type Try it
/hello Command Slash command
@review Agent Read-only code review subagent
hello-skill Skill Prompt template
hello Tool File-based custom tool
greet Tool Plugin-registered tool
template-dark Theme Dark color theme

Use as a dependency

Don't want to clone the template? Install from GitHub and import the helper from @itlackey/openkit.

bun add itlackey/openkit

If you also register tools directly in your plugin, add @opencode-ai/plugin too.

Standalone installer

Use this when your package only ships file-based extensions:

import { createInstallerPlugin } from "@itlackey/openkit/install"
export const plugin = createInstallerPlugin({
  name: "my-opencode-extension",
  sourceUrl: import.meta.url, // required when used as a dependency
})

Compose with an existing plugin

Mix the installer with your own tools and hooks:

import { type Plugin, tool } from "@opencode-ai/plugin"
import { installExtensions } from "@itlackey/openkit/install"
export const plugin: Plugin = async (input) => {
  await installExtensions({
    sourceUrl: import.meta.url,
    targetDir: input.directory,
    name: "my-opencode-extension",
  })
  return {
    tool: {
      "my-tool": tool({
        description: "Example tool",
        args: {
          message: tool.schema.string().describe("Message to echo"),
        },
        async execute({ message }) {
          return `my-tool: ${message}`
        },
      }),
    },
  }
}

package.json essentials

{
  "name": "my-opencode-extension",
  "type": "module",
  "main": "./dist/index.js",
  "types": "./dist/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "default": "./dist/index.js"
    }
  },
  "files": ["dist", "opencode", "helpers"],
  "dependencies": {
    "@opencode-ai/plugin": "^1.2.10"
  }
}

When using @itlackey/openkit/install instead of local helpers:

{
  "dependencies": {
    "@itlackey/openkit": "^0.1.0"
  }
}

Installer options

Option Required Default Description
name yes Label for log messages
dirs no all 6 types Limit which subdirectories to install
overwrite no false Overwrite existing files
sourceUrl no Pass import.meta.url when used as a dependency

Publish checklist

Before running npm publish:

  • Use a clear package name (my-opencode-extension) and concise description.
  • Add searchable keywords like opencode, opencode-plugin, opencode-extension.
  • Confirm main/exports point to compiled JS in dist/ and types points to declarations.
  • Ensure files includes everything users need (dist, opencode, and any helper dir you import).
  • Test installation with a real opencode.json plugin entry in a sample project.

Docs