@ukrobotics/create-revo-plugin
v0.5.0
Published
Scaffold a Revolution plugin: npm create @ukrobotics/revo-plugin
Readme
@ukrobotics/create-revo-plugin
Scaffolds a plugin for Revolution. The package is public on npm, so it installs without logging in.
Creating a plugin
npm create @ukrobotics/revo-plugin@latest sample-reportIt asks what kind of plugin you want (UI or Service), then the backend (Python or .NET, where
there is a choice), each from a menu. Use the arrow keys and Enter, or press the option's number.
It then checks the tools that template needs (Python 3.11+, the .NET 9 SDK, npm) and says what
is missing and what for. After that it asks for a plugin name, your organisation, the client id and the
Revo host, and offers to install the dependencies and generate your keys. Finally it writes a
configured project. That covers every placeholder substituted, both .env files created, a session secret
generated and, optionally, your signing key pair made with its kid written into .env.
Templates
| Template | Type | Backend | Frontend |
|---|---|---|---|
| python-react (default) | UserInterface | Python 3.11+ / FastAPI | React 19 + Vite |
| dotnet-react | UserInterface | .NET 9 / ASP.NET Core | React 19 + Vite |
| dotnet-service | Service | .NET 9 / ASP.NET Core | none |
UserInterface vs Service is the first decision, and it is not cosmetic. Revolution refuses
client_credentials to a plugin registered as a user interface, and the authorization-code flow
to one registered as a service.
The .NET templates carry the plugin SDK inside them as a .nupkg under backend/packages, so they
restore with no feed to configure. You need the .NET 9 SDK and access to nuget.org for their other
dependencies.
Non-interactive
npm create @ukrobotics/revo-plugin@latest sample-report -- --organisation abc-corp --yesWith npm create, options go after --. With npx @ukrobotics/create-revo-plugin they do not.
| Option | Default |
|---|---|
| [directory] | the plugin name |
| --type | ui or service; asked when there is a terminal, otherwise ui |
| --backend | python or dotnet; asked when there is a choice, otherwise python for UI |
| -t, --template | a template name, instead of --type and --backend |
| --plugin-name | the directory name |
| --organisation | required (--company also accepted) |
| --client-id | com.<organisation>.<plugin-name> |
| --revo-host | https://labrevolution.com |
| --tenant-id | dotnet-service only; optional, but the service will not start without it |
| --install / --no-install | asked; never assumed without a terminal |
| --generate-keys / --no-generate-keys | asked; never assumed without a terminal |
| -y, --yes | never prompt |
Installing puts Python packages in backend/.venv, never the system Python, which current macOS
and Linux refuse to install into anyway. For .NET it runs dotnet restore, and for a frontend
npm install. Every UI project also gets frontend/.env.development.local (git-ignored) naming
the backend port that npm run dev proxies /api to.
Key generation runs the template's own tool: backend/scripts/make_keys.py for Python, which
needs the backend's requirements (cryptography), so it uses backend/.venv once installed, and the SDK's --generate-keys for
.NET, which builds the project first. If that fails, the project is still created and the next
steps say how to generate the keys yourself.
Then
- Register the plugin under Settings → Tenant Settings → External Plugins with the client id
you chose and the contents of
backend/keys/public.jwks.jsonas its JWKS. - Run the backend and the frontend. The generated
README.mdcovers both.
Releasing this package: see RELEASING.md.
