# Your first plugin

> Shortcuts are written for the Mac. On Windows and Linux, use Ctrl where it says Cmd, unless the text names another key.

Open **Settings → Plugins**, choose **Create Plugin**, and open its code editor.

Configuration:

```json
{
  "ver": 1,
  "name": "Hello Thymer",
  "icon": "puzzle",
  "description": "A first command palette plugin"
}
```

Custom Code:

```js
class Plugin extends AppPlugin {
  onLoad() {
    this.ui.addCommandPaletteCommand({
      label: "Say hello",
      icon: "ti-hand-wave",
      onSelected: () => {
        this.ui.addToaster({
          title: "Hello from your plugin",
          message: "Your command is working.",
          dismissible: true,
          autoDestroyTime: 3000
        });
      }
    });
  }
}
```

Click **Preview**, press Cmd+P, and run **Say hello**. A notification appears. Save, and the command is there for everyone in the workspace.

## Make it do something

`this.data.searchByQuery("@task @overdue", 50)` returns matching records and lines; `this.ui.getActivePanel()` tells you which page the user is looking at. From here the shape of most plugins is the same: a command, a bit of data access, and a toaster or a panel to show the result. The [Plugin API reference](plugin-api-reference.md) lists what is available, and the [SDK examples](https://github.com/thymerapp/thymer-plugin-sdk/tree/main/examples) show working plugins to copy from.

Icons are Tabler icon names, `ti-` followed by the icon.
