Manifest
Every plugin has a manifest.json at its root.
{
"id": "yourname.rename-layers",
"name": "Rename Layers",
"version": "1.2.0",
"description": "Batch-rename the selected layers with a pattern.",
"author": "Your Name",
"main": "main.js",
"ui": "ui.html",
"permissions": ["read", "write"],
"commands": [
{ "id": "rename", "label": "Rename selection" },
{ "id": "number", "label": "Number selection" }
]
}Fields
| Field | Required | Description |
|---|---|---|
id | ✓ | Unique, permanent identifier. 2–64 characters: letters, digits, ., _, -, starting with a letter or digit. Use a prefix you own, e.g. acme.color-tools. On the marketplace the id belongs to whoever publishes it first; popcraft. and popcraft-examples. are reserved for PopCraft (plugin ids). |
name | ✓ | Display name shown in menus, the plugin manager and the marketplace. |
version | ✓ | Version string. Use dotted numbers (1.4.2); see versioning. |
main | ✓* | Path to the main script inside the package. *Optional when the plugin only contributes data such as themes. |
ui | Path to the panel HTML. Required if you call popcraft.showUI(). | |
description | One or two sentences, shown in the plugin manager and marketplace. | |
author | Shown in the marketplace. Defaults to your account name when publishing. | |
permissions | What the plugin may do (see below). Defaults to none. | |
commands | Menu entries. Each has an id (passed to your script as popcraft.command) and a label. Defaults to a single command, run (none for plugins without main). | |
contributes | Static contributions that need no code. contributes.themes lists UI themes: see Publishing themes. contributes.importers lists File → Import / Home drop formats (id, label, accept, optional command). contributes.panels lists sidebar panels. contributes.agentTools lists tools the AI agent can call: see Agent tools. |
Unknown fields are ignored.
Reserved commands: don't declare a command with the id
widgetoragent. PopCraft uses them when it starts your plugin to handle a widget click or an agent tool call.
Sidebar panels
contributes.panels adds tabs to the editor's side rails. Opening a tab runs the plugin and shows its ui docked in
the panel instead of a floating window; the plugin keeps running while you switch tabs.
"ui": "ui.html",
"contributes": {
"panels": [
{ "id": "status", "title": "Status", "icon": "icon.svg", "side": "right", "command": "open", "autostart": true }
]
}| Field | Required | Description |
|---|---|---|
id | ✓ | Unique within the plugin: letters, digits, ., _ and -. |
title | ✓ | The tab's tooltip and the panel's header. |
icon | A small square image: a data:image/… URL, or the path of an .svg, .png or .webp file in a zip package. Drawn in the rail's colour. Defaults to the plugin's icon. | |
side | right (default) or left. People can drag the tab to the other side. | |
command | The command the plugin starts with when the panel opens. Defaults to the panel's id. | |
autostart | true starts the plugin, docked in this panel, as soon as a file opens, instead of when the tab is first opened. For plugins that keep a connection or watch the file; pair it with setPanelIcon so the tab shows their state. Only once its permissions are granted: an autostart never asks. At most one panel per plugin. |
A plugin with panels needs a ui file.
Permissions
Description
A brainstorm board, with the Contrast Checker plugin installed. Its Check the whole page command is run from the plugin manager. The first run lists what its manifest asks for — reading and changing the file — and Allow and run lets it run; the result shows in its notice.
| Permission | Grants |
|---|---|
read | Read the current file: layers, selection, pages, styles, variables. Also required to receive selectionchange, pagechange and documentchange events. |
write | Edit the current file: create, update and delete layers, set the selection, set text, create paint styles, set variable values. |
export | Render layers to PNG, JPG, WEBP, SVG or PDF. |
network | Make network requests (fetch, XMLHttpRequest, WebSockets) and load remote images and fonts, from both the main script and the UI. |
Always available without permissions: notifications, showing a panel, per-plugin storage, closing the plugin, and the widget API for the plugin's own widgets.
Ask for the least you need:
- Users see the list of permissions before first run and can decline.
- On the marketplace, a version that adds a permission goes back through review.