Obsidian-cli exits with code 255 when working with beta community plugin

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

  1. Confirmed the build output is correct: after setting OUTDIR in .env to point at .obsidian/plugins/commentator/, main.js and styles.css are being built into the correct vault folder as expected.
  2. Confirmed manifest.json is present in the plugin folder, Obsidian recognizes and loads the plugin correctly.
  3. Confirmed Obsidian is open when running the command, the CLI has access to a running Obsidian instance.
  4. Confirmed the CLI is installed and working: running obsidian plugin id=commentator returns the correct plugin details without any errors.
  5. Tried enabling the plugin via CLI first: by adding obsidian plugin:enable id=commentator filter=community before the reload command, still exited with code 255.
  6. Manually enabled the plugin through Obsidian’s Settings → Community Plugins interface, the plugin loads and runs correctly after that.
  7. Ran obsidian plugin:reload id=commentator standalone 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?