Kunkun
Building Extensions

Publishing

Build a self-contained extension, publish to npm or jsr, and install from the store.

Kunkun extensions are ordinary packages. Publishing is: build a self-contained artifact, npm publish (or jsr publish), and users install it from the built-in store.

1. Build a self-contained artifact

The golden rule

Kunkun installs your published tarball as-is — it never runs npm install inside it. Everything your commands and services need at runtime must be in the build output.

  • Bundle your JS dependencies into each command/service output (Bun's bundler does this by default — avoid external entries unless the host provides the dep).
  • Native .node addons can't be inlined. Copy the addon loader + platform files into dist/ and allow them via the backend permission's capabilities.addons, or lazy-load the native feature so the extension degrades gracefully.
  • Keep files in package.json limited to what ships (e.g. ["dist"]).

Verify locally by loading the built folder via Settings → Developer → Load Extension before publishing.

2. Manifest essentials for the store

The store reads these from your kunkun manifest:

{
  "kunkun": {
    "identifier": "com.you.my-extension",
    "name": "My Extension",
    "icon": { "type": "iconify", "value": "mdi:puzzle", "invert": true },
    "shortDescription": "One-line pitch shown in the store",
    "longDescription": "Longer description.",
    "demoImages": ["https://…/screenshot.png"],
    "categories": ["Developer Tools"],
    "permissions": ["clipboard-read"],
    "commands": [ /* … */ ]
  }
}

Validate the whole package.json against the schema with the interactive validator before you publish.

3. Publish

pnpm build
npm publish --access public
pnpm build
npx jsr publish

4. Install & dependencies

Users install by identifier from the store. On install, Kunkun:

  1. Downloads the tarball and extracts it,
  2. Validates the manifest,
  3. Registers the extension (and any services[] it declares).

If your extension consumes another extension's service, declare it in serviceDependencies. The store previews required services and warns before uninstalling something other extensions depend on.

Versioning tips

  • Bump version on every publish; users get updates through the store.
  • Treat your identifier as permanent — it's how installs, storage, and grants are keyed.
  • Changing a service's method signatures is a breaking change for consumers — version the contract.

On this page