A simple starter project for Obsidian plugins that demonstrates a semi-automatic pipeline for builds using Vite.js.
This template provides a foundation for developing Obsidian plugins with modern tooling. It includes:
- TypeScript setup for type-safe development
- Vite for fast builds and development
- Automated release management with release-it
- GitHub Actions for CI/CD
- Testing framework with Vitest
Vite.js is used for its:
- Fast development server with hot module replacement
- Optimized production builds
- Modern ES module support
- Excellent TypeScript integration
- Plugin ecosystem for Obsidian-specific optimizations
- Node.js 22 (LTS)
- A package manager (pnpm, npm, or yarn)
- Clone the repository
- Install dependencies:
pnpm install
-
Start development server:
pnpm devThis launches an interactive development environment that:
- Scans for Obsidian vaults that have been opened at least once
- Presents a menu to select which vault to develop against
- Builds the plugin in watch mode with source maps
- Automatically copies updated plugin files to the selected vault on each change
For automatic plugin reloading in Obsidian without restarting the app, install the Hot Reload plugin from the Obsidian community plugins. This allows your changes to be reflected immediately in the running Obsidian instance.
- Build for production:
pnpm build - Preview the built plugin:
pnpm preview
- Run all tests:
pnpm test - Run tests in watch mode:
pnpm test:watch - Type check:
pnpm type-check
- Click "Use this template" on the GitHub repository
- Create a new repository from the template
- Clone your new repository
npx degit https://github.com/fnumatic/obsidian-plugin-starter your-plugin-name
cd your-plugin-name
git init
git add .
git commit -m "Initial commit"git clone https://github.com/fnumatic/obsidian-plugin-starter your-plugin-name
cd your-plugin-name
rm -rf .git
git init
git add .
git commit -m "Initial commit"- Update
package.json:- Change
name,description,author - Update repository URL and homepage
- Change
- Update
manifest.json:- Change
id,name,description - Update
authorandauthorUrl
- Change
- Update
main.ts:- Change the plugin class name
- Update any string literals with the old name
- Update
README.mdand other documentation files
The release process uses release-it for automated versioning and publishing.
- Built plugin files (main.js, manifest.json, styles.css)
- CHANGELOG.md with release notes
- GitHub release with attached plugin zip
- Version tags in git
release.yml: Triggers on version tags, builds and releases to GitHubbeta-release.yml: Triggers on beta branches/tags for pre-releases
Use the act tool to test workflows locally:
# Install act
curl https://raw.githubusercontent.com/nektos/act/master/install.sh | bash
# Test release workflow
act -j release
# Test beta release
act -j beta-release