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:
- Open Settings → Plugins
- Under Development, click "Add Path…"
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forkbit_sdk-0.1.1.tar.gz.
File metadata
- Download URL: forkbit_sdk-0.1.1.tar.gz
- Upload date:
- Size: 25.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
509052306b978c36fc58707deaef80561de5f6c8b282ae182ab352bc64e58319
|
|
| MD5 |
45de6f011a4a426e326ca2259691d95c
|
|
| BLAKE2b-256 |
5a94ec5c423f494bdc756ad6da4a9cc37455229555a3a5950e66e86332e1ecfb
|
File details
Details for the file forkbit_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: forkbit_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 20.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e044e3802514e9ca343202d5cc839742bbfe5066c3447c114ec3065c850f7d6
|
|
| MD5 |
69a44dd754204bcfdf5bd0261f708071
|
|
| BLAKE2b-256 |
97efbc192ffa6e00accbfbcf8a2a58dd65b1738d380e7260a06f7181f8a8afc6
|