Skip to main content

termix-plugin CLI

The plugin SDK ships a CLI called termix-plugin. Run it from your plugin's folder, through npx or the npm scripts.

CommandWhat it does
buildBundles src/backend/index.ts to dist/backend.js and src/frontend/index.tsx to dist/frontend.js, builds your CSS, copies locales and migrations, and writes dist/openapi.json.
validateChecks the manifest, the files it names, migrations for every database, the changelog and package.json. Warns about missing docs and unlisted env vars.
testRuns your Vitest suite.
migrationsCompares src/backend/tables.ts with migrations/snapshot.json and writes a migration per database. --check fails when a table changed without one.
openapiWrites dist/openapi.json from the @openapi comments in src/backend.
packValidates, then writes <id>-<version>.tmxplug. --out <dir> picks the folder.
sign <file>Signs a .tmxplug with the key in TERMIX_PLUGIN_SIGNING_KEY.
verify <file> --key <base64>Checks a .tmxplug against its .sig.
keygenWrites a new signing key pair. --out <dir> picks the folder.
changelogPrints one version's notes from CHANGELOG.md. --version x.y.z picks it.
patchApplies the plugin's dependency patches. build does this too.
devBuilds, packs and installs on a running server, then again on every change.

dev​

npx termix-plugin dev --server http://localhost:8080 --key tmx_your_key
OptionWhat it does
--serverYour Termix server. Or set TERMIX_SERVER_URL.
--keyAn admin API key. Or set TERMIX_API_KEY.
--onceInstall once and stop.

The server needs developer mode on. The plugin installs as unverified. You can't use the id of a plugin that ships with Termix, and you have to uninstall a registry copy of the same plugin first.