Sample Plugin
unlistedby Obsidian
Demonstrates some of the capabilities of the Obsidian API.
obsidian-svelte-plugin-starter
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.
✨ Features
- 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
✅ Requirements
- Bun — installs dependencies and runs the build scripts
- Node.js v22 — recommended
Check what you have installed:
bun --version
node --version
📦 Getting started
-
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 devFor 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-idFor example:
ln -s ~/repos/my-plugin/dist ~/Desktop/obsidian-development/.obsidian/plugins/my-plugin -
Open Obsidian, go to Community plugins, and enable your plugin
♻️ Reloading after each build
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 .envOBSIDIAN_VAULT=obsidian-developmentRun
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 reload
The 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.
🔁 Releases
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
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.