Skip to content

Repository files navigation

opencode-ntfy

OpenCode plugin that sends push notifications via ntfy.sh when the agent needs input, requests permission, or encounters errors.

Installation

Add the plugin to your opencode.json or opencode.jsonc:

{
"plugin": ["opencode-ntfy"]
}

Configuration

Create a configuration file at ~/.config/opencode/opencode-ntfy.json:

{
"topic": "my-opencode-alerts"
}

Configuration Options

OptionTypeDefaultDescription
topicstringrequiredThe ntfy topic to publish to
serverstringhttps://ntfy.shThe ntfy server URL (for self-hosted instances)
tokenstringnullAccess token for authentication
prioritynumber (1-5)3Default notification priority
events.idlebooleantrueNotify when agent finishes and needs input
events.permissionbooleantrueNotify when permission is requested
events.errorbooleantrueNotify on session errors

Full Configuration Example

{
"topic": "my-opencode-alerts",
"server": "https://ntfy.sh",
"token": "tk_xxx",
"priority": 3,
"events": {
"idle": true,
"permission": true,
"error": true
}
}

Subscribing to Notifications

  1. Install the ntfy app on your phone (Android, iOS)
  2. Subscribe to your topic (e.g., my-opencode-alerts)
  3. You'll receive push notifications when OpenCode events occur

You can also subscribe via the web at https://ntfy.sh/your-topic.

Self-Hosted ntfy

If you're running your own ntfy server, set the server option:

{
"topic": "opencode",
"server": "https://ntfy.example.com"
}

Authentication

For protected topics, add your access token:

{
"topic": "private-alerts",
"token": "tk_your_access_token"
}

License

MIT

About

OpenCode Plugin to invoke mobile push notification via ntfy

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Sponsor this project

Used by

Contributors

Languages