@guan612/opencode-ai-lightOpenCode plugin that forwards session events to AI Light (desktop traffic light widget)
0
11
2 in 7 days
23.5
Multi-signal model
2 months ago
2026-06-18
Install and configure
opencode.jsonWrites to this project's opencode.json — applies to this repository only.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@guan612/opencode-ai-light@0.1.0"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@guan612/opencode-ai-light@0.1.0"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D @guan612/opencode-ai-lightopencode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
OpenCode plugin that forwards session events to AI Light — the desktop traffic light widget for monitoring AI coding assistants.
When OpenCode starts a session, submits a prompt, requests permission, or completes a task, this plugin sends real-time status updates to AI Light so you can see your OpenCode sessions alongside Claude Code and Codex at a glance.
Installation
Add the plugin to your opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@guan612/opencode-ai-light"]
}
OpenCode installs the package automatically at startup using Bun. Restart OpenCode and the plugin will connect to AI Light automatically.
OpenCode loads plugins at startup. Quit and reopen OpenCode after changing this package or your opencode.json plugin list.
Configuration
No manual configuration needed. The plugin auto-discovers AI Light by reading:
~/.ai_light/runtime.json— for the local AI Light HTTP portAI_LIGHT_URLenvironment variable — overrides auto-discovery if set
Logs are written to ~/.ai_light/opencode-plugin.log.
Event Mapping
| OpenCode Event | AI Light Event | Status |
|---|---|---|
session.created |
session-start |
Idle (green) |
session.status (busy/retry) |
prompt-submit |
Working (yellow) |
session.status (idle) |
stop |
Done (green) |
session.idle |
stop |
Done (green) |
session.error |
notification |
Error (red) |
permission.asked |
permission-request |
Error (red) |
session.deleted |
session-end |
Removed |
session.updated is intentionally ignored because OpenCode also emits it for background session saves after completion. Treating it as work would turn the light yellow again after a task is done.
Completed assistant message.updated events are also ignored because they can occur while OpenCode is still busy, such as before a tool call or follow-up assistant output.
AI Light Integration Note
OpenCode sessions appear as Claude Code tool type in AI Light's UI (the upstream AI Light project uses a hardcoded tool label). To show them as OpenCode, fork ai-light and:
- Add
OpenCodeto theToolenum insrc-tauri/src/types.rs - Use a dedicated route like
/events/opencodeto tag sessions correctly
License
AGPL-3.0-only