A starter for building a Glyph plugin. Click Use this template to make your own repo.
A plugin is a single ES module (main.js) that default-exports { activate(ctx) }, plus a manifest.json. Write your source across as many files as you like under src/; the build bundles them into one main.js.
npm install
npm run build # bundles src/ into main.js
npm run typecheck # optional: tsc against the bundled glyph typesTry it in Glyph: command palette → Manage Plugins… → Install from folder… → pick this folder (after npm run build).
src/main.ts shows the v1 surface (typed via types/glyph.d.ts):
ctx.commands.register({ id, title, run })— add a command to the palette.ctx.ui.addStatusBarItem({ id, mount })— add a status bar item;mount(el, registerCleanup)is framework-agnostic.ctx.notify(message)— show a toast.ctx.registerTranslations(locale, namespace, resources)— ship and read your own i18n strings.ctx.apiVersion— the host's plugin API version.
Don't bundle React or Glyph internals; the host provides what you need through ctx.
Need network access or no UI mounts? Set "sandbox": true in manifest.json to run in an isolated worker: fetch is limited to your declared network:<host> permissions, and the ctx subset is commands, ui.addStyles, exporters, workspace, assets, settings, notify, and translations. See the API reference.
- Set your
id,name,version, anddescriptioninmanifest.json, and list every shipped file (entry + assets) infiles. - Push a tag matching the manifest version (
git tag v1.0.0 && git push origin v1.0.0). The bundled Release workflow builds, zipsmanifest.json+ the declared files, creates the GitHub release, and prints the zip'ssha256plus a ready-to-paste registration snippet in the release notes. - Open a PR to the marketplace adding
plugins/<your-id>/plugin.json(copy the snippet from the release notes, pick the rightcategory) and aREADME.md. See its CONTRIBUTING guide.
Per release: bump version in manifest.json, push the matching tag, then PR the updated version + packageUrl + sha256 to the marketplace; Glyph then offers users an in-app update.