Tmux Alert
Tmux alert plugin for OpenCode — get notified when your AI agent needs attention
0
488
近 7 天 486
36.5
生态多维模型
3 天前
2026-10-17
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-tmux-alert@1.0.1"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-tmux-alert@1.0.1"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-tmux-alertOpenCode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
opencode-tmux-alert
Tmux alert plugin for OpenCode. Get notified when your AI agent needs attention.
Quick Start
Package
Install in your OpenCode config directory:
bun install opencode-tmux-alert
Then add the plugin to your opencode.json:
{
"plugins": ["opencode-tmux-alert"]
}
Requires OpenCode V2.
How It Works
When OpenCode needs your attention (a task finishes, a permission is requested, or a question is asked), the plugin triggers a tmux alert on the current window. When you respond, the alert clears automatically.
The bundled scripts do two things:
- Set a tmux user option (
@opencode-alert) that you can reference in your status line - Send a bell character (
\a) which triggers tmux's built-inmonitor-bellnotification
This means alerts work out of the box with a standard tmux config, and can be further customised with status line formatting.
Events
| Event | Trigger | Action |
|---|---|---|
session.idle |
Task completed, agent waiting | Alert |
permission.asked |
Agent needs permission to proceed | Alert |
session.tool.called (not executed) |
Tool pending approval | Alert |
tui.prompt.append |
Agent asking a question | Alert |
session.inbox.enqueued (user) |
User submits a message | Clear |
Customisation
Status line indicator
Use the @opencode-alert user option in your tmux status format to show a visual indicator:
# In tmux.conf, show an indicator when OpenCode needs attention
set -g status-right "#{?@opencode-alert,#[fg=yellow] OpenCode,} ..."
Custom scripts
Override the bundled alert and clear scripts with your own via environment variables:
export OPENCODE_ALERT_SCRIPT="$HOME/my-scripts/alert.sh"
export OPENCODE_CLEAR_SCRIPT="$HOME/my-scripts/clear.sh"
Your scripts receive no arguments. The TMUX_PANE environment variable is available if you need to target the current window.
tmux bell monitoring
To use the bell-based alerts, enable monitoring in your tmux.conf:
set -g monitor-bell on
set -g visual-bell off # optional, suppress the visual flash
Requirements
Licence
同类生态推荐
Simple Notify
opencode-simple-notify
Desktop notification plugin for OpenCode - works on Linux (dbus) and macOS (osascript)
Alert
@chousyn/opencode-alert
Cross-platform notification plugin for OpenCode — desktop alerts, sound alerts, and webhook notifications with project-level configuration
Notification
opencode-notification
OpenCode plugin for simple system notifications when permissions are needed, generation completes, or errors occur