Scaffolding
The venpm create command scaffolds plugin repos and individual plugins with the right structure for venpm publishing.
Create a Plugin Repo
venpm create ~/src/my-pluginsThis creates:
my-plugins/
plugins.json # Empty venpm plugin index
plugins/ # Directory for your plugins
README.md # Basic readme
.github/
workflows/
validate.yml # CI: validate plugins.json on pushThe plugins.json starts with the schema reference and your repo name (derived from the directory name):
{
"$schema": "https://venpm.dev/schemas/v1/plugins.json",
"name": "my-plugins",
"description": "",
"plugins": {}
}Create a Plugin
Inside an existing repo (one that has a plugins.json ancestor), create scaffolds a plugin instead:
venpm create plugins/myPlugin # plain TypeScript
venpm create plugins/myPlugin --tsx # React support (.tsx entry)
venpm create plugins/myPlugin --css # include style.css
venpm create plugins/myPlugin --native # include native.ts (Node.js)Flags can be combined:
venpm create plugins/myPlugin --tsx --css --nativeGenerated Files
Plain TypeScript (venpm create plugins/myPlugin):
plugins/myPlugin/
index.tsimport definePlugin from "@utils/types";
export default definePlugin({
name: "MyPlugin",
description: "",
authors: [{ name: "YourName", id: 0n }],
start() {},
stop() {},
});With React (--tsx): Creates index.tsx instead of index.ts.
With styles (--css): Adds style.css and an import in the entry file.
With native (--native): Adds native.ts for Node.js code (filesystem, child process, etc.) that runs in Electron's main process.
How venpm Detects Mode
venpm create <path> walks up the directory tree from <path> looking for a plugins.json with the venpm schema ($schema containing venpm). If found, it scaffolds a plugin. If not found, it scaffolds a repo.
This means you can create plugins from anywhere inside the repo:
cd ~/src/my-plugins
venpm create plugins/newPlugin # works — finds plugins.json in parentAfter Scaffolding
- Edit the generated
index.ts/index.tsxwith your plugin logic - Add an entry to
plugins.json(see Plugin Index Format) - Install locally for development:
venpm install myPlugin --local plugins/myPlugin --no-build - Build and test:
venpm rebuild - Validate:
venpm validate plugins.json