The official starter template for developing MotusAI Seed plugins with the public SDK. It demonstrates SDK settings controls, calls to a separate backend service, saved preferences with conflict detection, and English/Chinese translations.
The project installs @motus-ai/seed-sdk from npm. It does not need a Seed source checkout, a local SDK build, or a globally installed CLI.
- Node.js 24 or newer and npm. Node.js 24 LTS is recommended;
.nvmrcrecords this major version. - MotusAI Seed 0.3.11 or newer for running the plugin. This sample pins SDK 0.3.11.
Live preview requires a Seed client with Plugin development mode enabled in Plugin settings. This needs a client release that includes the switch; SDK installation alone cannot enable it in an older installed client. Building and testing this project require no client source or running client. The switch is off by default; turning it off restores authorized installed plugins and keeps their data.
Clients started from source and installed releases use the same switch and plugin loading logic. Starting from source does not enable plugin development automatically.
Choose Use this template on agimx-ai/seed-sample-plugin to create your own repository, or copy its files into a new project. Run from that project's root:
npm install
npm run checkcheck runs formatting checks, TypeScript checks, service tests, and the plugin build. Subsequent clean installs and CI can use npm ci with the committed lockfile. These steps require no client source or running client.
For live preview, open a compatible Seed client, enable Plugin development mode in Plugin settings, then run:
npm run devOpen Sample Plugin in Seed, enter a display name, choose Save, and choose Show greeting. Change src/main.ts or a translation file to try rebuilding. A successful sync is not proof of loading: also check the plugin page and Seed's activity/error records.
The CLI writes to the current user's development plugin directory:
| Platform | Directory |
|---|---|
| Windows | %APPDATA%/MotusAI Seed/plugins/development/com.example.seed.sample |
| macOS | ~/Library/Application Support/MotusAI Seed/plugins/development/com.example.seed.sample |
| Linux | $XDG_CONFIG_HOME/MotusAI Seed/plugins/development/com.example.seed.sample, defaulting to ~/.config |
To test synchronization without touching a real Seed profile:
npm run dev -- --directory "path/to/an/isolated/development-directory"This changes only the CLI's output directory; it does not make a client watch that directory. Stop with Ctrl+C; the CLI removes the development output it owns. A failed rebuild preserves the last valid output.
- Replace
com.example.seed.samplein bothpackage.jsonandmanifest.jsonwith your plugin ID. Keep the two IDs and versions consistent. - Set the author in
manifest.json; update the name and description in bothlocales/files. - Replace the example behavior in
src/main.tsandsrc/service.ts. - Update both user introductions under
docs/plugin/. They are copied into the build asREADME.mdandREADME.zh-CN.md; this developer README is not distributed with the plugin. - Keep
minAppVersionconsistent with the actual SDK APIs you use. Declare any extra dependencies in this project's ownpackage.json.
Changing the plugin ID creates a different plugin and a different data namespace. Development builds with the same ID use that plugin's existing preferences; use an isolated test profile when necessary.
src/main.ts Settings page and frontend lifecycle
src/service.ts Private backend methods and preference storage
src/preferences.ts Shared data types and validation
locales/ English and Chinese text
docs/plugin/ User introductions included in the plugin
tests/service.test.ts Tests using the SDK's service fixture
manifest.json Plugin identity and minimum client version
build.mjs Build using the public SDK
.github/workflows/check.yml
The default service runtime is sandboxed-web. The example requests no additional OS permissions and uses no external service. Frontend code must not import the backend implementation or Node.js modules.
| Command | Purpose |
|---|---|
npm run dev |
Build, sync and watch source changes |
npm run typecheck |
Check TypeScript without emitting files |
npm run format |
Format source, JSON, Markdown and workflows |
npm run format:check |
Check formatting without changing files |
npm test |
Exercise preference persistence, conflicts, input validation and lifecycle |
npm run build |
Generate dist/ with main.js, manifest, styles and declared resources |
npm run check |
Run formatting checks, type checking, tests and build |
npm run pack |
Build and create a .seedpkg ZIP under artifacts/; does not install or publish |
CI runs installation and check on Windows, macOS and Linux. It does not install plugins, create packages or publish releases.
If Windows reports that seed-plugin or tsc cannot be found, verify that Node.js meets the requirement and run npm ci --include=dev --include=optional --bin-links=true. Do not copy node_modules between operating systems.
This project is licensed under MIT.