Official SDK and CLI for building Mixlar M1X plugins and device widgets.
Project description
Mixlar SDK
The official SDK and CLI for building Mixlar Control plugins and M1X device widgets. Write a plugin once, against typed, importable classes — the same classes the desktop app itself uses — and test it end-to-end without a device plugged in: lint the manifest, run it against a headless mock device, render its widget to a PNG, sign it, and package it, all from the command line.
Off-app, from mixlar import MixlarPlugin gives you a faithful standalone
implementation with autocomplete and type checking. Inside the running Mixlar
Control app, that same import transparently becomes the app's own live class —
so a plugin authored against this SDK loads completely unmodified. See
How this maps onto the app below.
Install
pip install mixlar-sdk
Or, to hack on the SDK itself, from a checkout of this folder:
pip install -e .
Optional extras, added as needed:
| extra | adds | needed for |
|---|---|---|
[render] |
Pillow | mixlar-sdk emulate --render (widget PNG previews) |
[publish] |
requests | mixlar-sdk publish (nicer HTTP errors; stdlib fallback works without it) |
[dev] |
pytest, Pillow, requests | running this SDK's own test suite |
[all] |
everything above | "just give me all of it" |
pip install -e ".[all]"
This installs the mixlar-sdk console script. You can also run it in place with
python -m mixlar_cli (handy before pip install -e ., or in CI).
Quickstart
mixlar-sdk create "My Plugin" --template full # scaffold into ./my_plugin/
cd my_plugin
mixlar-sdk validate # lint plugin.json + widgets/
mixlar-sdk emulate --render preview.png # render the widget, no hardware
mixlar-sdk emulate --interactive # press/toggle/slide it from a REPL
mixlar-sdk keygen --key-id my-key # once, if you plan to sign
mixlar-sdk pack --sign my-key # build a signed .mixplugin
mixlar-sdk link # copy it into the app's plugins dir
create names the output folder after the plugin id (a slug derived from
the display name, or --id), not the display name itself — "My Plugin"
becomes ./my_plugin/.
Commands
| command | what it does |
|---|---|
create |
scaffold a new plugin package from a template (macro, slider, widget, full) |
validate |
lint plugin.json and every bundled widgets/<id>/widget.json |
link |
copy (or symlink) a package into the app's plugins directory |
dev |
validate + link once, then watch the folder and re-sync on save |
emulate |
run a package against a headless mock device — render a PNG or drive it interactively |
pack |
zip a validated package into a .mixplugin, optionally signing it first |
sign |
sign a package in place with a publisher key |
verify |
check a package's signature against the pinned publisher keyset |
keygen |
generate an ed25519 publisher keypair |
publish |
upload a .mixplugin to the marketplace (stub until the endpoint ships) |
Full reference with flags and example output: docs/cli.md.
The SDK in a nutshell
from mixlar import MixlarPlugin
from mixlar.macros import MacroActions, action
from mixlar.colors import ACCENT
class MyPlugin(MacroActions, MixlarPlugin):
plugin_id = "my_plugin"
plugin_name = "My Plugin"
plugin_icon_color = ACCENT
#: Pairs this plugin with widgets/my_widget/widget.json.
widget_id = "my_widget"
@action("ping", "Ping", icon="fa5s.satellite-dish")
def _ping(self, step):
self.push_widget_data("status", "pong!") # → WDATA,my_widget.status,pong!
def on_widget_shown(self, widget_id):
self.push_widget_data("status", "idle")
def on_widget_event(self, widget_id, element_id, action):
if element_id == "ping_btn" and action == "press":
self._ping({})
That's a complete plugin: a macro action, a bundled device widget pairing,
and a button handler. No boilerplate quartet of empty methods to override —
MacroActions derives get_macro_actions() / get_macro_action_groups() /
get_macro_action_icons() / execute_macro_step() from the @action
decorators for you (see docs/plugin-api.md).
How this maps onto the app
Everything in this SDK is a faithful, importable port of code that already
lives inline in PC Software/mixlar_mini.py — MixlarPlugin, PluginRegistry,
the color palette, the ed25519 package signing, the widget/manifest linters.
Off-app you get standalone reimplementations (so imports resolve in your
editor and this SDK has no dependency on the app). Inside the running app,
mixlar.plugin.MixlarPlugin, mixlar.registry.PluginRegistry, and
mixlar.colors.* detect that mixlar_mini is already imported and
transparently re-export the app's own live objects instead — same class,
same registry, same palette — so a plugin written against this SDK needs zero
changes to run for real, and push_widget_data reaches the actual serial
link. This "single source of truth" seam is documented in each module's
docstring and in docs/migration.md.
Package trust works the same way both places: mixlar.signing.package_digest
computes the exact SHA-256 the app's _plugin_package_digest computes, so a
package signed with this SDK verifies in the real app. See
docs/signing-and-packaging.md.
Documentation
Start at docs/index.md. Highlights:
docs/getting-started.md— install, scaffold, the author loopdocs/plugin-api.md— theMixlarPluginhook referencedocs/widgets.md— building device widgets withWidgetdocs/settings.md— declarativesettings.schema.jsondocs/signing-and-packaging.md— trust, keys,.mixplugindocs/emulator.md— testing without hardwaredocs/events.md— the system-events contractdocs/cli.md— every command in detaildocs/migration.md— converting a legacy plugin, and adopting the SDK app-sidedocs/roadmap.md— shipped vs. what still needs app-side wiring
A complete worked example — a Pomodoro timer plugin with macros, a settings
schema, and a bundled countdown widget — lives in
examples/pomodoro/.
For the underlying specs this SDK implements, see the repo root's
PLUGINS.md (package format, install/trust flow) and WIDGETS.md (widget
spec, serial protocol).
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 mixlar_sdk-0.1.3.tar.gz.
File metadata
- Download URL: mixlar_sdk-0.1.3.tar.gz
- Upload date:
- Size: 96.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdf75cf1a9e3df28cbcb28356762fb7feddbb3add858a92e0c15ae7391ca924d
|
|
| MD5 |
2e2d34a9e71f1bb6dac40b4eef8f0e40
|
|
| BLAKE2b-256 |
e1d97b86ee2dcf673a7f2d5a8152e5383c07c16dab5aac8cba403ed028856198
|
Provenance
The following attestation bundles were made for mixlar_sdk-0.1.3.tar.gz:
Publisher:
publish.yml on MixlarLabs/mixlar-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mixlar_sdk-0.1.3.tar.gz -
Subject digest:
cdf75cf1a9e3df28cbcb28356762fb7feddbb3add858a92e0c15ae7391ca924d - Sigstore transparency entry: 2195424174
- Sigstore integration time:
-
Permalink:
MixlarLabs/mixlar-sdk@50ffa9b2264ec09d06b03f15b127cd7d7b49da01 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/MixlarLabs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@50ffa9b2264ec09d06b03f15b127cd7d7b49da01 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mixlar_sdk-0.1.3-py3-none-any.whl.
File metadata
- Download URL: mixlar_sdk-0.1.3-py3-none-any.whl
- Upload date:
- Size: 79.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d9e3b3889d793e03e2c22ca830943382005500975c95d239a3f943132a04a20
|
|
| MD5 |
71cc61b207ae5946d0e8e9c6cf839f15
|
|
| BLAKE2b-256 |
887535ea9f61b606f77aa9ca9291d0021d96b6e0bd20d1c3109276c70afd9e6c
|
Provenance
The following attestation bundles were made for mixlar_sdk-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on MixlarLabs/mixlar-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mixlar_sdk-0.1.3-py3-none-any.whl -
Subject digest:
4d9e3b3889d793e03e2c22ca830943382005500975c95d239a3f943132a04a20 - Sigstore transparency entry: 2195424207
- Sigstore integration time:
-
Permalink:
MixlarLabs/mixlar-sdk@50ffa9b2264ec09d06b03f15b127cd7d7b49da01 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/MixlarLabs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@50ffa9b2264ec09d06b03f15b127cd7d7b49da01 -
Trigger Event:
release
-
Statement type: