A starter template for building Obsidian plugins with Svelte, bundled by esbuild and managed with Bun.
This is an extension of the official Obsidian plugin starter template.
- Write your plugin interface in Svelte
- Fast bundling with esbuild and
esbuild-svelte - Bun for dependency management, with a
bun.locklockfile - Source code in
src/, build output indist/ bun run devrebuilds automatically as you save- Reloads the plugin in Obsidian after each build, via the official Obsidian CLI
- A GitHub Actions release workflow that packages your plugin when you tag a version
- Bun — installs dependencies and runs the build scripts
- Node.js v22 — recommended
Check what you have installed:
bun --version
node --version-
Click Use this template on GitHub to create your own plugin repository
-
Install dependencies:
bun install
-
Start a watch build. It compiles into
dist/and rebuilds whenever you save:bun run dev
For a one-off production build, run
bun run build. -
Link
dist/into your vault so Obsidian can load the plugin. Name the folder to match theidin yourmanifest.json:ln -s /path/to/your/plugin/dist /path/to/your/vault/.obsidian/plugins/your-plugin-id
For example:
ln -s ~/repos/my-plugin/dist ~/Desktop/obsidian-development/.obsidian/plugins/my-plugin
-
Open Obsidian, go to Community plugins, and enable your plugin
Obsidian does not pick up new plugin files on its own. If you have the official Obsidian CLI enabled, the build reloads the plugin for you.
-
Turn the CLI on in Obsidian under Settings → General → Command line interface (needs the 1.12.7 installer or newer), then follow the prompt to add it to your PATH. Check it with:
obsidian version
-
Copy the example env file and fill in the vault you develop against:
cp .env.example .env
OBSIDIAN_VAULT=obsidian-development
Run
obsidian vaultsto list the vault names Obsidian knows about.
Every successful build now reloads the plugin in that vault, whether it came from bun run dev or bun run build. To reload without rebuilding:
bun run reloadThe plugin to reload comes from the id field in manifest.json. If the folder you linked into .obsidian/plugins is named something else, set OBSIDIAN_PLUGIN_ID in .env to match the folder.
Reloading is entirely optional. With no .env, or without the CLI installed, the build prints a short note once and carries on. Note that the CLI starts Obsidian if it is not already running.
The included workflow builds your plugin and attaches the files to a GitHub release whenever you push a tag.
First, give the workflow permission to create releases:
- Open your repository on GitHub
- Go to Settings → Actions → General
- Under Workflow permissions, select Read and write permissions
- Click Save
Then tag a version and push it:
git tag 1.1.0
git push origin 1.1.0