Commit df1862e8 authored by Justin Wong's avatar Justin Wong
Browse files

opencode notify plugin install

parent 1f9e8ee7
Loading
Loading
Loading
Loading
+159 −0
Original line number Diff line number Diff line
@@ -188,3 +188,162 @@ Skills provide reusable workflows and conventions that agents can automatically
1. Complete the OpenCode setup steps above
2. Complete the MCP setup steps above (Snowflake/dbt)
3. Clone and symlink the `data-team-agentic-skills` repo by following the [setup instructions](https://gitlab.com/gitlab-data/data-team-agentic-skills#setup-opencode)

## OpenCode Plugins

### OpenCode Notify

[OpenCode Notifier](https://github.com/mohak34/opencode-notifier) is a plugin that sends native macOS system notifications when OpenCode prompts you for something.

#### Install Steps

1. Add the `opencode-notifier` plugin to your `~/.config/opencode/opencode.jsonc`. It should look something like this:

   ```jsonc
   {
     "$schema": "https://opencode.ai/config.json",
     "share": "disabled",
     "autoupdate": true,
     "plugin": ["@mohak34/opencode-notifier@latest"],
   ```

1. Optional (but recommended): by default, this plugin notifies on every event, which gets noisy fast. To customize which events trigger notifications, create a file `~/.config/opencode/opencode-notifier.json` and paste in the following config:

<details>
<summary>opencode-notifier.json config</summary>

```json
{
  "sound": true,
  "notification": true,
  "bell": false,
  "timeout": 5,
  "showProjectName": true,
  "showFullPath": false,
  "showSessionTitle": false,
  "showIcon": true,
  "customIconPath": null,
  "suppressWhenFocused": true,
  "enableOnDesktop": false,
  "notificationSystem": "osascript",
  "suppressGhosttySound": false,
  "linux": {
    "grouping": false
  },
  "minDuration": 0,
  "command": {
    "enabled": false,
    "path": "/path/to/command",
    "args": [
      "--event",
      "{event}",
      "--message",
      "{message}"
    ],
    "minDuration": 0
  },
  "events": {
    "permission": {
      "sound": true,
      "notification": true,
      "command": true,
      "bell": false
    },
    "complete": {
      "sound": false,
      "notification": false,
      "command": true,
      "bell": false
    },
    "subagent_complete": {
      "sound": false,
      "notification": false,
      "command": true,
      "bell": false
    },
    "error": {
      "sound": false,
      "notification": true,
      "command": true,
      "bell": false
    },
    "question": {
      "sound": true,
      "notification": true,
      "command": true,
      "bell": false
    },
    "user_cancelled": {
      "sound": false,
      "notification": false,
      "command": true,
      "bell": false
    },
    "plan_exit": {
      "sound": false,
      "notification": false,
      "command": true,
      "bell": false
    },
    "session_started": {
      "sound": false,
      "notification": false,
      "command": true,
      "bell": false
    },
    "user_message": {
      "sound": false,
      "notification": false,
      "command": true,
      "bell": false
    },
    "client_connected": {
      "sound": false,
      "notification": false,
      "command": true,
      "bell": false
    }
  },
  "messages": {
    "permission": "Session needs permission: {sessionTitle}",
    "complete": "Session has finished: {sessionTitle}",
    "subagent_complete": "Subagent task completed: {sessionTitle}",
    "error": "Session encountered an error: {sessionTitle}",
    "question": "Session has a question: {sessionTitle}",
    "user_cancelled": "Session was cancelled by user: {sessionTitle}",
    "plan_exit": "Plan ready for review: {sessionTitle}",
    "session_started": "Session started: {sessionTitle}",
    "user_message": "User sent a message: {sessionTitle}",
    "client_connected": "OpenCode connected"
  },
  "sounds": {
    "permission": null,
    "complete": null,
    "subagent_complete": null,
    "error": null,
    "question": null,
    "user_cancelled": null,
    "plan_exit": null,
    "session_started": null,
    "user_message": null,
    "client_connected": null
  },
  "volumes": {
    "permission": 0.5,
    "complete": 1,
    "subagent_complete": 1,
    "error": 1,
    "question": 0.5,
    "user_cancelled": 1,
    "plan_exit": 1,
    "session_started": 1,
    "user_message": 1,
    "client_connected": 1
  }
}
```

</details>

1. Restart OpenCode to load the `opencode-notifier` plugin.
1. Validate: trigger a permission prompt (e.g. ask OpenCode to run `rm ~/Downloads/some-file.csv`). You should hear a sound and see a notification banner in the top right of your screen. No notification should fire on task completion.