release-it is a generic CLI tool to automate versioning and package publishing-related tasks. This short guide explains how to use it to release Obsidian plugin (pre)releases locally.
To create a standard release (major, minor, or patch):
npx release-itThis will:
- Build your plugin assets locally
- Update versions in
manifest.json(regular releases only) - Create a Git tag
- Generate a changelog
- Create a GitHub release draft
For beta versions or other pre-releases:
npx release-it --preRelease=betaThis adds the specified suffix (e.g. -beta.0) to your version number.
By adding --dry-run, you can run test the setup:
npx release-it --dry-run
npx release-it --preRelease=beta --dry-run
After running release-it, you must manually upload the following files to your GitHub release:
main.js- Your compiled plugin codemanifest.json- Plugin metadata and version informationstyles.css- Optional CSS styles for your plugin
Release types affect version handling differently:
For standard releases, the manifest.json file is automatically updated with the new version. Proper Git tags and GitHub releases are created, ensuring compatibility with Obsidian's community plugin system.
For pre-releases (Beta), version numbers are appended with a -beta.X suffix. The manifest.json file remains unchanged in the main branch, allowing for testing without impacting the production version.
Simply add the .release-it.yaml to your plugin root and add the semver package as a developer dependency:
npm i -D semver