# oc-top **Repository Path**: gabrielslls/oc-top ## Basic Information - **Project Name**: oc-top - **Description**: Real-time TUI monitor for OpenCode - like top/iftop for LLM calls. - **Primary Language**: Python - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-24 - **Last Updated**: 2026-04-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # oc-top ๐Ÿ™ > Real-time TUI monitor for OpenCode - like `top`/`iftop` for LLM calls [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Node.js](https://img.shields.io/badge/Node.js-18+-green.svg)](https://nodejs.org/) [![TypeScript](https://img.shields.io/badge/TypeScript-5.3+-blue.svg)](https://www.typescriptlang.org/) **oc-top** (ๅ…ซ็ˆช็›‘ๆŽง) ๆ˜ฏไธ€ไธช็ฑปไผผ `top`/`iftop` ็š„็ปˆ็ซฏๅทฅๅ…ท๏ผŒ็”จไบŽๅฎžๆ—ถ็›‘ๆŽง OpenCode ๆจกๅž‹่ฐƒ็”จๆƒ…ๅ†ตใ€‚็›ดๆŽฅ่ฏปๅ–ๆœฌๅœฐ SQLite ๆ•ฐๆฎๅบ“๏ผŒ้›ถ้›†ๆˆใ€้›ถ้…็ฝฎใ€ๅฎŒๅ…จๆœฌๅœฐ่ฟ่กŒใ€‚ ## โœจ Features | Feature | Description | |---------|-------------| | ๐Ÿ”„ **Real-time** | 1-second refresh rate | | ๐Ÿ“Š **4 Views** | Model / Provider / Agent / Tool | | ๐Ÿ“ก **Live Stream** | Last 20 calls with status | | ๐ŸŒ **i18n** | English / ไธญๆ–‡ | | ๐Ÿ”Œ **MCP Highlighting** | Identify MCP tools (may have quota limits) | | ๐Ÿ” **Filter** | Filter by name/provider | | โŒจ๏ธ **Keyboard-first** | Full keyboard navigation | | ๐Ÿ”’ **Privacy** | 100% local, no data upload | | ๐Ÿš€ **Zero-config** | Works out of the box | ## ๐Ÿ“ฆ Installation ### Prerequisites - Node.js 18+ - OpenCode installed with data at `~/.local/share/opencode/` ### Quick Start ```bash # Clone git clone git@github.com:gabrielslls/oc-top.git cd oc-top # Install npm install # Build npm run build # Run npm start ``` ## ๐ŸŽฎ Usage ```bash npm start ``` ### Keyboard Shortcuts | Key | Action | |-----|--------| | `q` | Quit | | `p` | Pause/Resume | | `s` | Cycle sort | | `f` | Filter mode | | `l` | Switch language | | `h` | Help screen | | `Tab` | Next view | | `Shift+Tab` | Previous view | | `โ†‘`/`โ†“` | Selected row cursor | | `Enter` | Drill down to live calls | | `Esc` | Back from Detail view | ## โš™๏ธ Options | Flag | Description | |------|-------------| | `--db ` | Specify custom OpenCode SQLite database path | | `--help` | Show help information | | `--version` | Show current version | ## ๐Ÿ“Š Views ### 1. Model View Statistics by model with live call stream ### 2. Provider View Aggregate statistics by provider (baidu, cucloud, astroncodingplan) ### 3. Agent View Statistics by agent (Sisyphus, Atlas, oracle, etc.) ### 4. Tool View Tool call statistics with MCP highlighting (magenta + โšก) ## ๐Ÿ”Œ MCP Tools The following tools are highlighted (may have quota limits): - `websearch_web_search_exa` - Exa Search API - `context7_query-docs` - Context7 Documentation - `context7_resolve-library-id` - Context7 Library Resolution - `grep_app_searchGitHub` - GitHub Code Search - `skill_mcp` - Dynamic MCP calls ## ๐Ÿ“ Project Structure ``` oc-top/ โ”œโ”€โ”€ src/ โ”‚ โ”œโ”€โ”€ index.ts # Entry point โ”‚ โ”œโ”€โ”€ app.tsx # Main TUI component โ”‚ โ”œโ”€โ”€ db/connection.ts # SQLite queries โ”‚ โ”œโ”€โ”€ i18n/index.ts # Internationalization โ”‚ โ””โ”€โ”€ types/index.ts # TypeScript types โ”œโ”€โ”€ locales/ โ”‚ โ”œโ”€โ”€ en.json # English โ”‚ โ””โ”€โ”€ zh-CN.json # Chinese โ”œโ”€โ”€ _legacy/ โ”‚ โ””โ”€โ”€ python-monitor/ # Legacy Python tool โ”œโ”€โ”€ package.json โ”œโ”€โ”€ tsconfig.json โ”œโ”€โ”€ CHANGELOG.md โ”œโ”€โ”€ LICENSE โ””โ”€โ”€ README.md ``` ## ๐Ÿ”ง Development ```bash npm install npm run build npm start ``` ## ๐Ÿ“„ License [MIT](LICENSE) --- Made with โค๏ธ by Gabriel88