Quick answer

OpenCode’s terminal interface has built-in attention alerts for questions, permission requests, session errors, and completed sessions. They are off by default. Turn them on in ~/.config/opencode/tui.json:

{
  "$schema": "https://opencode.ai/tui.json",
  "attention": {
    "enabled": true,
    "notifications": true,
    "sound": true
  }
}

Desktop notifications are sent only when the terminal is not in focus. Sounds play when an event happens. The tui.json file is separate from opencode.json.

Build a small notification plugin

For your own notification text, use a plugin. OpenCode loads plugins from ~/.config/opencode/plugins/ (all projects) and .opencode/plugins/ (one project) at startup. Save this as ~/.config/opencode/plugins/notification.js, then restart OpenCode:

export const NotificationPlugin = async ({ $ }) => {
  const notify = (message) =>
    $`osascript -e ${`display notification "${message}" with title "OpenCode"`}`.nothrow().quiet()

  return {
    event: async ({ event }) => {
      if (event.type === "session.idle") await notify("Session finished")
      if (event.type === "permission.asked") await notify("OpenCode needs permission")
    },
  }
}
OpenCode 1 and 2: this plugin uses the OpenCode 1 plugin API. OpenCode’s migration guide says that version 1 plugins do not run in version 2. In version 2, plugins subscribe to events through ctx.event.subscribe(). Check opencode --version before you choose.

If the notification does not appear, give Script Editor notification permission. osascript sends notifications through Script Editor. Run osascript -e 'display notification "test"' once, then allow it in System Settings → Notifications.

The OpenCode desktop app

The OpenCode desktop app can send system notifications automatically when a response is ready or when a session errors. You do not need a plugin for that.

How MoriBlink handles OpenCode

OpenCode has MoriBlink’s most complete connection: live observation, tested with OpenCode 1.19.3. A one-time setup installs a small user-level plugin. Then MoriBlink shows each project that OpenCode reports, and you approve each one before capture starts.

See every agent in one place

MoriBlink follows your OpenCode sessions live, tells you the moment one needs you, and shows where a slow run spent its time.

Get early access

Sources

Checked against the official documentation on 26 October 2026.

Questions

Does OpenCode have built-in notifications?

Yes. Set attention.enabled to true in tui.json. The TUI then alerts you for questions, permissions, session errors, and completed sessions. Desktop notifications appear only when the terminal is not in focus.

Which OpenCode plugin event means a session is finished?

Use session.idle. For permission requests, use permission.asked. Both are listed in the OpenCode 1 plugin documentation.

Do OpenCode 1 plugins work in OpenCode 2?

No. The OpenCode migration guide says version 1 plugin implementations do not run in version 2. Version 2 plugins subscribe to events through ctx.event.subscribe().