This guide explains how to use this template to create your own Obsidian plugin.
- Click the "Use this template" button on the GitHub repository page
- Choose a name for your repository (e.g.,
obsidian-my-awesome-plugin) - Clone your new repository:
git clone https://github.com/YOUR_USERNAME/obsidian-my-awesome-plugin.git
cd obsidian-my-awesome-plugin- Clone this repository:
git clone https://github.com/dsebastien/obsidian-plugin-template-bun.git obsidian-my-awesome-plugin
cd obsidian-my-awesome-plugin- Remove the existing git history and initialize a new repository:
rm -rf .git
git init
git add .
git commit -m "Initial commit from template"- Create a new repository on GitHub and push:
git remote add origin https://github.com/YOUR_USERNAME/obsidian-my-awesome-plugin.git
git branch -M main
git push -u origin mainUpdate the following fields with your project information:
{
"name": "obsidian-my-awesome-plugin",
"description": "Your plugin description here",
"author": {
"name": "Your Name",
"email": "your-email@example.com",
"url": "https://your-website.com"
},
"keywords": ["obsidian", "obsidian-plugin", "your-keywords"],
"repository": {
"type": "git",
"url": "git+https://github.com/YOUR_USERNAME/obsidian-my-awesome-plugin.git"
},
"bugs": {
"url": "https://github.com/YOUR_USERNAME/obsidian-my-awesome-plugin/issues"
},
"homepage": "https://github.com/YOUR_USERNAME/obsidian-my-awesome-plugin"
}Update the plugin manifest with your plugin details:
{
"id": "my-awesome-plugin",
"name": "My Awesome Plugin",
"description": "Your plugin description here",
"version": "1.0.0",
"minAppVersion": "1.4.0",
"isDesktopOnly": false,
"author": "Your Name",
"authorUrl": "https://your-website.com",
"fundingUrl": "https://www.buymeacoffee.com/your-username"
}Important notes about manifest.json:
- The
idfield must be unique and should match your plugin folder name - Never change
idafter releasing your plugin - Use semantic versioning (e.g.,
1.0.0,1.1.0,2.0.0) - Update
minAppVersionif you use newer Obsidian APIs
Search for TODO comments in the source code and update the following:
Rename MyPlugin to your plugin class name:
// Before
export class MyPlugin extends Plugin {
// After
export class MyAwesomePlugin extends Plugin {Rename MyPluginSettingTab to match your plugin name:
// Before
export class MyPluginSettingTab extends PluginSettingTab {
// After
export class MyAwesomePluginSettingTab extends PluginSettingTab {Also update the type imports:
// Before
import type MyPlugin from '../../main'
// After
import type MyAwesomePlugin from '../../main'Update the import and export:
// Before
import { MyPlugin } from './app/plugin'
export default MyPlugin
// After
import { MyAwesomePlugin } from './app/plugin'
export default MyAwesomePluginThe settings tab in src/app/settings/settings-tab.ts includes social media and support links for the template author. You can:
- Keep them: If you want to support the template author
- Update them: Replace with your own Twitter/X handle, Buy Me a Coffee URL, etc.
- Remove them: Delete the
renderFollowButton,renderSupportHeader, andrenderBuyMeACoffeeBadgemethods and their calls indisplay()
The .github/FUNDING.yml file contains funding links for the template author. You can:
- Keep it: If you want to support the template author
- Update it: Replace with your own funding information
- Remove it: Delete the file entirely if you don't want funding links
Replace the template README with your plugin's documentation:
- Plugin name and description
- Features list
- Installation instructions
- Usage guide
- Configuration options
- Screenshots (if applicable)
Update repository URLs and any project-specific contribution guidelines.
Update repository URLs and the plugin folder name in the manual installation section.
See Step 3.5 above for guidance on the funding file.
- Go to your repository Settings → Actions → General
- Under "Workflow permissions", enable Read and write permissions
- Check "Allow GitHub Actions to create and approve pull requests"
If you want to host documentation:
- Go to Settings → Pages
- Set source to "GitHub Actions" or your preferred branch
bun installSet the OBSIDIAN_VAULT_LOCATION environment variable to your test vault path:
export OBSIDIAN_VAULT_LOCATION="/path/to/your/vault"Add to ~/.bashrc or ~/.zshrc to make it permanent.
$env:OBSIDIAN_VAULT_LOCATION="C:\Users\YourName\Documents\ObsidianVault"- Start TypeScript watch mode (recommended to run in a separate terminal):
bun run tsc:watch- Start the development build:
bun run dev- In Obsidian:
- Go to Settings → Community plugins
- Enable the plugin
- Use Ctrl/Cmd + R to reload after changes
After completing the setup, remove this file:
rm TEMPLATE_USAGE.mdAlso review and clean up:
documentation/folder - update or remove template documentationTODO.md- if present, review and update for your project
For the first release, do not use automated version bumping. Instead:
- Ensure your code is ready and all tests pass:
bun run tsc
bun run lint
bun test
bun run build- Create and push a tag:
git tag 1.0.0
git push origin 1.0.0- The GitHub Actions release workflow will automatically:
- Build the plugin
- Generate a changelog
- Create a GitHub release with the necessary files
For subsequent releases, you can either:
git tag 1.1.0
git push origin 1.1.0- Go to Actions → Release in your repository
- Click "Run workflow"
- Enter the version number (e.g.,
1.1.0) - Click "Run workflow"
When you're ready to publish:
- Ensure your plugin follows Obsidian's plugin guidelines
- Review the submission requirements
- Submit a PR to obsidian-releases
This template includes:
| Feature | Description |
|---|---|
| Bun | Fast package manager and bundler |
| TypeScript | Strict type checking enabled |
| Tailwind CSS v4 | Utility-first CSS framework |
| ESLint | Code linting with modern config |
| Prettier | Code formatting |
| Husky | Git hooks for pre-commit checks |
| lint-staged | Run linters on staged files |
| Commitizen | Interactive commit message helper |
| Conventional Commits | Standardized commit message format |
| GitHub Actions CI | Automated testing on push/PR |
| GitHub Actions Release | Automated release workflow |
| Immer | Immutable state management |
| Zod | Runtime type validation |
Install Bun from bun.sh:
curl -fsSL https://bun.sh/install | bash- Verify
OBSIDIAN_VAULT_LOCATIONis correct - Check files exist in
<vault>/.obsidian/plugins/<plugin-id>/ - Restart Obsidian
- Ensure Community plugins are enabled
Run bun run tsc:watch to see detailed type errors and fix them before building.
- Ensure all dependencies are installed:
bun install - Check for TypeScript errors:
bun run tsc - Check for lint errors:
bun run lint
If you encounter issues with this template, please open an issue on the template repository.