This guide walks through building a hello-world plugin: install Node, scaffold a project, edit one file, build it, drop it into your local Projelli plugins folder, and see it appear in the app.
You need Node.js 20 or later. Check what you have:
node --version
If you see v20.x.x or higher, you're good. If not, download the LTS installer from nodejs.org and run it. The installer adds node and npm to your PATH.
Pick a folder where you keep code projects, then run:
npx create-projelli-plugin my-plugin
The CLI asks a couple of quick questions (display name, which permissions to declare), then creates a folder called my-plugin/ with a complete TypeScript project. It runs npm install for you.
Inside my-plugin/ you'll find:
| File | What it is |
|---|---|
manifest.json | Plugin metadata: id, name, version, permissions. |
src/index.ts | Your plugin code. Exports a default { activate } object. |
package.json | npm dependencies and scripts. Includes @projelli/plugin-api. |
vite.config.ts | Bundles src/index.ts into a single ES module file at dist/index.js. |
tsconfig.json | Strict TypeScript settings. |
README.md | Notes for whoever installs your plugin. |
LICENSE | MIT by default. Change if you want. |
Open src/index.ts in your editor. The starter looks like this:
import type { PluginAPI, PluginModule } from '@projelli/plugin-api';
const plugin: PluginModule = {
async activate(api: PluginAPI) {
api.commands.register('my-plugin.hello', () => {
api.notify.info('Hello from my-plugin!');
});
api.toolbar.addButton({
id: 'my-plugin-button',
icon: 'sparkles',
tooltip: 'Say hello',
command: 'my-plugin.hello',
});
},
};
export default plugin;
That's a complete plugin. It registers one command and adds one toolbar button. Click the button and you get a notification.
Try changing the message to whatever you want.
@projelli/plugin-api package is types-only. It gives you full autocomplete on api.editor, api.workspace, api.ai, and so on. You'll catch typos at build time instead of at runtime.
npm run build
Vite bundles your plugin into a single ES module file at dist/index.js. That's the file Projelli loads.
Copy manifest.json and the dist/ folder into Projelli's plugins directory:
| OS | Plugins folder |
|---|---|
| Windows | %APPDATA%\Projelli\plugins\my-plugin\ |
| macOS | ~/Library/Application Support/Projelli/plugins/my-plugin/ |
| Linux | ~/.local/share/Projelli/plugins/my-plugin/ |
The folder name must match the id field in your manifest. After copying, the layout should look like:
plugins/my-plugin/
manifest.json
dist/
index.js
Open Projelli, then go to Settings, then Plugins. Your plugin appears in the Installed list. Toggle it on. Projelli reads the manifest, asks you to approve any permissions, then loads the plugin.
Look at the toolbar. You should see a sparkles icon. Click it. You'll see your notification.