Guide · Debug & distribute
Debug & distribute
The last mile: iterate fast, ship without a marketplace, keep the trust model honest.
Debugging
Petty logs all plugin output to stderr with the prefix [Plugin <id>]. When developing:
- Launch Petty from the terminal:
./start.shor.build/debug/Petty. - Watch the terminal for your plugin's output.
- Use
petty.log(message)— orpetty.log.info/warn/errorfor level-tagged structured logs — to print from JavaScript. - JS runtime errors are caught and logged automatically with full stack traces.
Common issues
- Plugin doesn't load. Check that
manifest.idmatches the folder name and that the script path is valid. petty.xxxis undefined. You didn't declare the required permission in the manifest.- Exec returns “not in allowlist”. The command isn't in your manifest's
exec.allowlist. - Fetch returns null. URL uses a non-HTTP scheme, or the request failed.
Distribution
Plugins are just folders. To distribute one:
- Zip your plugin folder:
zip -r my-plugin.zip my-plugin/ - Users extract it into
~/Library/Application Support/Petty/Plugins/ - They restart Petty and enable the plugin in Settings → Plugins.
The marketplace
Petty's own marketplace page currently lists the bundled plugins plus a community seed pack, each with its manifest details and declared permissions. A third-party submission flow is planned but not yet live — for now, host your plugin's zip on a GitHub release or project site and link to it from your repo.
There is no in-app plugin browser and no auto-update: every install is an explicit conscious decision by the user, which is exactly the trust model the plugin runtime was built around.
Fast iteration loop
Petty reads plugins at launch. While iterating, restart the app after each change:
pkill -x Petty
./start.sh # or .build/debug/PettyKeep main.js and manifest.json small and focused — the shorter your feedback loop, the faster you'll find the right shape for the plugin.