Skip to main content

Plugin SDK for building ForkBit plugins

Project description

ForkBit SDK

Build plugins for ForkBit — the desktop app for managing app store workflows.

Installation

pip install forkbit-sdk

Quick Start

Create a new plugin:

forkbit plugin init my_plugin

This generates a ready-to-run plugin scaffold:

my_plugin/
  plugin.json    — manifest (id, name, version, dependencies)
  main.py        — your plugin code (BasePlugin subclass)
  settings.json  — settings schema

Writing a Plugin

Every plugin is a BasePlugin subclass that builds its UI in on_ready():

from PySide6.QtCore import Qt
from PySide6.QtWidgets import QLabel, QVBoxLayout

from forkbit_sdk import BasePlugin


class MyPlugin(BasePlugin):

    def on_ready(self) -> None:
        layout = QVBoxLayout(self.container)
        layout.setAlignment(Qt.AlignmentFlag.AlignTop)

        label = QLabel("Hello from my plugin!")
        layout.addWidget(label)

Your plugin inherits the app's theme automatically — standard PySide6 widgets just work.

Plugin API

Property / Method Description
self.container QWidget — build your UI inside this
self.settings dict — current plugin settings values
self.project_id str — current project ID
self.project_path str — path to the project directory
self.data_dir Path — per-instance storage directory
self.git GitClient — git operations (status, tags, push, pull, commit)
self.read_json(filename) Read JSON from data_dir
self.write_json(filename, data) Atomic-write JSON to data_dir
self.notify(message, level) Show a toast notification
self.translate(text, src, tgt, on_done, on_error) Async translation
self.set_subtitle(text) Update the plugin header subtitle
self.secret_file(field_id) Get raw bytes of a secret file setting
self.set_busy(busy) Mark plugin as busy (shown in sidebar)
on_ready() Override to build UI and initialize state
on_settings_changed(settings) Override to react to settings changes

Background Workers

Use PluginWorker for long-running tasks. It handles busy state, error handling, and logging automatically:

from forkbit_sdk import BasePlugin, PluginWorker


class BuildWorker(PluginWorker):
    def execute(self) -> str:
        self.log_message.emit("Building...")
        self.step_changed.emit(0)
        # do work
        self.step_changed.emit(1)
        return "Build complete"


class MyPlugin(BasePlugin):
    def _on_build(self):
        worker = BuildWorker(self)
        worker.log_message.connect(self._append_log)
        worker.done.connect(self._on_done)
        worker.start()  # automatically sets busy=True

    def _on_done(self, success, message):
        # busy=False is set automatically
        self.notify(message, "success" if success else "error")

Settings Schema

Define user-configurable settings in settings.json:

{
  "fields": [
    { "id": "api_key", "label": "API Key", "type": "password" },
    { "id": "auto_sync", "label": "Auto-sync on save", "type": "bool", "default": true }
  ]
}

Supported types: text, password, textarea, bool, secret_file.

Plugin Manifest

plugin.json defines your plugin's metadata:

{
  "id": "com.mycompany.myplugin",
  "name": "My Plugin",
  "version": "1.0.0",
  "description": "What it does",
  "entry": "main.py",
  "min_app_version": "0.2.0",
  "requirements": []
}

Development Mode

During development you don't need to build a .forkbit file. Register your plugin directory in ForkBit:

  1. Open Settings → Plugins
  2. Under Development, click "Add Path…"
  3. Select the directory containing your plugin.json

Your plugin appears in the Add Plugin dialog with a (dev) label and loads directly from source.

CLI Commands

forkbit plugin init [dir]        # scaffold a new plugin
forkbit plugin validate [dir]    # check manifest and imports
forkbit plugin build [dir]       # build for current platform
forkbit plugin release [dir]     # build for all platforms

Documentation

Build the docs locally:

pip install forkbit-sdk[docs]
cd docs
sphinx-build -b html . _build/html
open _build/html/index.html

For live-reload during editing:

sphinx-autobuild docs docs/_build/html

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

forkbit_sdk-0.1.2.tar.gz (26.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

forkbit_sdk-0.1.2-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file forkbit_sdk-0.1.2.tar.gz.

File metadata

  • Download URL: forkbit_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for forkbit_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a45fcfc43da53432a29ed5f9cd1985b880c8dce036c50e17117c10eb12537d97
MD5 40924c504dcdd7dd65e11d37559ff31a
BLAKE2b-256 911cd030abcca0ed2ea8533d30b8c99ae7727b18ff9fdd50936567c0b3bd0438

See more details on using hashes here.

File details

Details for the file forkbit_sdk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: forkbit_sdk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for forkbit_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1155b6e1b57c8e995884006282c5326582ac89eedffe7499f058c27de1a84828
MD5 3e2a907de2c40cd3bbb96b484cfe8fea
BLAKE2b-256 1229785a8cfd319258b4f81c589477bcfcf6097b9c84c255cd87b4a7ceace636

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page