Skip to content

Create a plugin

Prefer the interactive scaffolder (it fills in id / name / icon and the optional backend, settings, database and lifecycle-hook parts):

终端窗口
pnpm create-plugin

Or copy the template manually:

终端窗口
cp -r plugins/_template plugins/my-tools

Then edit plugins/my-tools/plugin.json:

{
"id": "my-tools",
"name": "My tools",
"tools": [
{
"id": "my-tools-hello",
"name": "Hello",
"description": "My first tool",
"icon": "Sparkles",
"entry": "frontend/views/Tool.vue"
}
]
}

Now edit frontend/views/Tool.vue — done. Navigation, routing, titles, enable/disable toggles, the settings panel, the error boundary and KeepAlive all work automatically, with no manual registration.

The scaffolder generates a skeleton following the plugin directory conventions (including views/, settings/, components/, composables/, lib/ and shared.ts) that runs immediately. Then:

  1. edit plugin.json (id, display name, icon, tools[].entry) — the single source of truth;
  2. implement frontend/views/*.vue (UI spec in the design docs);
  3. for backend work add a #[tauri::command] in backend/mod.rs;
  4. to persist data append a migration in backend/migrations.rs and define tables in frontend/schema.ts;
  5. add README.md (features) and AGENTS.md (dev conventions).

The following examples all live in the hello-world plugin — browse them before deleting it:

GoalFile
Call Rust commands, logging pipeline, read/write SQLitefrontend/views/Tool.vue (the Rust integration tour)
Table + paging + dialog CRUD + import/exportfrontend/views/TableTool.vue
Form controls and validationfrontend/views/FormTool.vue
HTTP requests, results display and streaming downloadfrontend/views/HttpTool.vue
Background task progress / cancel, notifications, event busfrontend/views/TaskTool.vue
Multi-window, open dispatch, shortcuts, platform detectionfrontend/views/SystemTool.vue
Generic CRUD, transaction atomicity, binary file IOfrontend/views/DataTool.vue
Module Panel + 12-grid layout and the three-state standardfrontend/views/TemplateTool.vue

Next: read the plugin.json fields, or go straight to frontend pages.