Send Gotify notifications for Opencode session events.
- Notifications when tasks complete successfully
- Alerts when sessions encounter errors
- Permission request notifications
- Question notifications when agent needs user input
- Session title display in notifications
Add to your ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-gotify-notifier"]
}Set the following environment variables:
| Variable | Description | Default |
|---|---|---|
GOTIFY_URL |
Your Gotify server URL | Required |
GOTIFY_TOKEN |
Application token from Gotify | Required |
GOTIFY_TLS_REJECT_UNAUTHORIZED |
Set to false to disable TLS verification |
true |
GOTIFY_CA_PATH |
Path to custom CA certificate (PEM format) | - |
Example:
export GOTIFY_URL="https://gotify.example.com"
export GOTIFY_TOKEN="your-application-token"TLS verification is enabled by default for secure connections.
If your Gotify server uses a self-signed certificate, you have options:
Option 1: Use a custom CA certificate (recommended)
export GOTIFY_CA_PATH=/path/to/your-ca.pemOption 2: Disable TLS verification (not recommended for production)
export GOTIFY_TLS_REJECT_UNAUTHORIZED=falseOption 3: Use Node.js environment variable
export NODE_TLS_REJECT_UNAUTHORIZED=0
⚠️ Disabling TLS verification makes your connection vulnerable to man-in-the-middle attacks. Only use this for development or trusted internal networks.
| Event | Title | Priority |
|---|---|---|
| Task complete | Task Complete | 5 |
| Session cancelled | Session Cancelled | 6 |
| Permission required | Permission Required | 7 |
| Question awaiting input | Question | 7 |
| Error | Error | 8 |
# Install dependencies
npm install
# Build
npm run build
# Type check
npm run typecheck
# Lint
npm run lint
# Format
npm run format:fixTo test the plugin locally before publishing:
# Build and deploy to opencode plugins directory
npm run deploy:local
# Or manually:
npm run build
mkdir -p ~/.config/opencode/plugins
cp dist/index.js ~/.config/opencode/plugins/opencode-gotify-notifier.jsThen restart opencode to load the plugin. The plugin file is auto-loaded from ~/.config/opencode/plugins/.
MIT