Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 1.3 KB

File metadata and controls

41 lines (28 loc) · 1.3 KB

OpenCode Notifier Plugin

A cross-platform notification plugin for OpenCode that alerts you when an agent finishes a task.

Features

  • Cross-Platform: Works on macOS, Linux (including WSL), and Windows.
  • Smart Summaries: Extracts the first 5 words of the agent's completion message so you know what finished.
  • Zero Config: Just install and it works.

Installation

  1. Create the plugin directory if it doesn't exist:

    mkdir -p ~/.config/opencode/plugin
  2. Copy the index.ts file to your plugin folder:

    cp index.ts ~/.config/opencode/plugin/notify.ts
  3. Restart OpenCode.

How it Works

The plugin listens for the session.idle event, which triggers whenever the AI agent finishes generating a response and is waiting for user input. It then:

  1. Fetches the last message from the session history.
  2. Cleans up the text (removes code blocks, markdown).
  3. Truncates it to a short summary.
  4. Sends a native system notification.

Requirements

  • Linux: notify-send (usually installed by default on Ubuntu/Debian via libnotify-bin).
  • Windows: PowerShell (optional: BurntToast module for better notifications).
  • macOS: No extra requirements.

License

MIT License. Feel free to modify and distribute as you see fit.