What I’m trying to do
I’m developing an Obsidian beta community plugin locally from source. As part of development workflow, we using the obsidian CLI to automatically reload the plugin after each build, using the following script in package.jso:
bun run tsc -noEmit -skipLibCheck && bun scripts/build/esbuild.config.ts development && obsidian plugin:reload id=commentator
The goal is a one-command dev loop, type-check, build, and reload the plugin in Obsidian automatically without having to manually toggle it in the settings every time.
Things I have tried
- Confirmed the build output is correct: after setting
OUTDIRin.envto point at.obsidian/plugins/commentator/,main.jsandstyles.cssare being built into the correct vault folder as expected. - Confirmed
manifest.jsonis present in the plugin folder, Obsidian recognizes and loads the plugin correctly. - Confirmed Obsidian is open when running the command, the CLI has access to a running Obsidian instance.
- Confirmed the CLI is installed and working: running
obsidian plugin id=commentatorreturns the correct plugin details without any errors. - Tried enabling the plugin via CLI first: by adding
obsidian plugin:enable id=commentator filter=communitybefore the reload command, still exited with code 255. - Manually enabled the plugin through Obsidian’s Settings → Community Plugins interface, the plugin loads and runs correctly after that.
- Ran
obsidian plugin:reload id=commentatorstandalone with Obsidian open and the plugin already enabled, still exits with code 255.
The plugin works perfectly when enabled and reloaded manually, but the plugin:reload CLI command consistently fails with exit code 255 regardless of the plugin state. Has anyone run into this before or know what might be causing it?