Lyre / documentation
Early accessGet Lyre

Build your first plugin

Scaffold a small, typed contribution and test it locally.

Developer preview · technical guide

Before you begin

You need the host CLI supplied with your Lyre build, Node.js/npm, and familiarity with TypeScript. Replace /path/to/host-cli in the examples with the actual executable path; it is a placeholder, not a separately installed command. Start with a disposable development host and a plugin that does not read files or call a paid service. The generated project matches the CLI’s SDK version.

Create and check the scaffold

/path/to/host-cli plugin init ./my-plugin
cd my-plugin
npm install
npm run typecheck

Use an empty directory. Initialization writes files but does not install dependencies. Review the generated package before running the package manager. The scaffold includes a greeting surface and a typed request between the client and host.

Keep three responsibilities separate

index.client.tsx and client/
Register and render the interface. Respect the supplied theme and compact layout.
index.server.ts and server/
Register and implement host behavior. Keep credentials and privileged operations here.
shared/
Define typed requests, validation schemas and plain data shared by both sides.

Keep the SDK imports and dependency names created by the scaffold. Its shared, client and server entry points match the CLI version used to generate your plugin; do not rename them when naming your own plugin.

Make one small change

Edit the generated greeting in server/greeting.ts, then run type checking. Keep the shared response shape compatible with the client. For a new input, update its shared validation schema and both consumers together.

npm run typecheck
/path/to/host-cli plugin install .
/path/to/host-cli plugin logs my-plugin
/path/to/host-cli plugin reload my-plugin

Enable the plugin system only on your chosen development host after reviewing its configured sources. See installation and trust.

Test the lifecycle, not just the happy path

  • Open the surface on a narrow phone and a desktop, in light and dark themes.
  • Test invalid input, a failed request and a disconnected host.
  • Disable and reload the plugin. Dispose timers, listeners and resources in contribution cleanup.
  • Verify no secrets appear in client responses or logs.

Keep a README, version requirements, license and reproducible setup with your source. Test a pinned revision before asking others to install it. Broad extension sandboxing is not supplied by the current plugin runtime.