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:

  1. Launch Petty from the terminal: ./start.sh or .build/debug/Petty.
  2. Watch the terminal for your plugin's output.
  3. Use petty.log(message) — or petty.log.info/warn/error for level-tagged structured logs — to print from JavaScript.
  4. JS runtime errors are caught and logged automatically with full stack traces.

Common issues

  • Plugin doesn't load. Check that manifest.id matches the folder name and that the script path is valid.
  • petty.xxx is 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:

  1. Zip your plugin folder: zip -r my-plugin.zip my-plugin/
  2. Users extract it into ~/Library/Application Support/Petty/Plugins/
  3. 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/Petty

Keep main.js and manifest.json small and focused — the shorter your feedback loop, the faster you'll find the right shape for the plugin.