5
469
近 7 天 71
42.7
生态多维模型
3 天前
2026-08-16
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-session-tracker@2.3.34"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-session-tracker@2.3.34"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-session-trackeropencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
One session tracker for OpenCode, two surfaces: a TUI sidebar in your terminal and a Telegram remote control on your phone. Both stay in sync automatically — pick up a session in one place, and it's right where you left it in the other.
What you get
- One session list, everywhere. Sessions and subagents are tracked in real time and shown identically in the sidebar and in Telegram's
/sessionsand/history. Active and archived sessions are always bucketed the same way on both sides. - Session hierarchies. Subagents nest under their parent session like folders. Toggle
[+]/[-]to expand or collapse; active subagents pop out automatically even while their parent is collapsed. - Live status everywhere. The same status — running, waiting, idle, asking a question, waiting on a permission — is reflected as a colored tag in the sidebar and as a live-updating message in Telegram.
- Remote control from your phone. Send prompts, follow your agent's thinking and tool calls as they happen, and approve or deny permission requests and interactive questions — all via Telegram buttons, without touching your keyboard.
- Cross-window / cross-project routing. Multiple OpenCode windows are tracked together. Telegram routes prompts to the correct project's terminal window and follows you as you switch sessions.
- Instance management from Telegram. List running projects, launch OpenCode in a project that isn't running, or close/restart the current instance — all from
/projects. - History, your way. Sessions idle for 24h automatically move to History. Don't want to wait? Cmd+click (Alt+click on Windows/Linux) a session in the sidebar to archive it to History immediately.
🖥️ TUI Sidebar
- Session Hierarchies: Subagents nest under their parent session like folder trees. Toggle expand/collapse with
[+]or[-]. - Smart Active Pop-out: Collapsing a parent won't hide running work — active subagents pop out automatically.
- Cmd/Alt+click to archive: Cmd+click (Alt+click on Windows/Linux) any session to move it into History right away, without waiting for the 24h auto-expiry. (Plain right-click gets intercepted by your terminal's own context menu, and ctrl+click gets remapped to right-click by macOS itself — neither reaches the app reliably.)
- Visual Status Tags:
[RUN](Green): Agent is actively running a tool or generating code.[IDLE](Gray): Agent completed its task and is idle.[WAIT](Yellow): Agent is waiting or retrying an internal process.[ASK](Magenta): Agent is waiting for you to answer a question.[PERM](Magenta): Agent is waiting for permission to execute a command.
📱 Telegram Remote Control
Projects & sessions — select an active session to monitor or interact with.
Live prompt tracking — follow your agent's thinking and tool calls in real-time, with buttons to approve or deny commands.
- Live Status Streaming: Follow your agent's thinking process and tool executions, formatted cleanly, in real-time.
- Interactive Approvals: Answer questions and authorize terminal commands (
allowordenypermissions) directly via Telegram buttons. - Session & History Browsing:
/sessionslists everything currently active;/historylists everything archived — exactly matching what the sidebar shows. - Project Control:
/projectslists every known OpenCode project, shows which are online, and lets you launch, close, or restart an instance remotely. - Cross-Process Routing: Multi-window support automatically syncs session views and routes prompts to the correct terminal window.
- Zero Overhead: Idle-state polling is fully cached and throttled to respect Telegram rate limits.
[!TIP] To get started with the mobile control bot, check out the Telegram Setup Guide.
📥 Installation
Install globally using the official OpenCode plugin command (requires OpenCode >=1.4.3):
opencode plugin opencode-session-tracker --global
Restart OpenCode, and the sidebar will load automatically. Telegram control activates on top of it as soon as you add a telegram.json config — see the setup guide.
🔧 Developer Setup
If you want to customize or develop the plugin locally:
- Clone the repository and install dependencies:
git clone https://github.com/ykocaman/opencode-session-tracker.git cd opencode-session-tracker npm install - Build the plugin:
npm run build - Load the plugin locally in OpenCode by adding the absolute path of this folder to your
tui.jsonconfiguration file.