|
1 | | -# OpenCode Telegram Bot |
| 1 | +# tp-opencode |
2 | 2 |
|
3 | 3 | [](https://www.python.org/downloads/) |
4 | 4 | [](LICENSE) |
5 | 5 | [](https://opencode.ai) |
6 | 6 |
|
7 | | -**OpenCode mobile client via Telegram** — run and monitor AI coding tasks from your phone while everything runs locally on your machine. A lightweight [OpenClaw](https://github.com/openclaw/openclaw) alternative built for [OpenCode](https://github.com/anomalyco/opencode). |
8 | | - |
9 | | -[](https://opencode.ai) |
| 7 | +**Desktop GUI app for running OpenCode with a Telegram bot** — one click to start everything. A lightweight [OpenClaw](https://github.com/openclaw/openclaw) alternative built for [OpenCode](https://github.com/anomalyco/opencode). |
10 | 8 |
|
11 | 9 | ## Features |
12 | 10 |
|
13 | | -- **Remote coding** — send prompts to OpenCode from anywhere, receive complete results with code sent as files |
14 | | -- **Session management** — create, switch, rename, compact, and abort sessions from Telegram |
15 | | -- **Live status** — pinned message with current project, model, context usage, updated in real time |
16 | | -- **Model switching** — pick models directly in the chat via inline keyboard |
17 | | -- **Agent modes** — switch between Plan and Build modes on the fly with `/mode` |
18 | | -- **Interactive Q&A** — answer agent questions and approve permissions via inline buttons |
19 | | -- **Voice prompts** — send voice messages, transcribe them via Whisper-compatible API |
20 | | -- **File attachments** — send images, documents, and text-based files to OpenCode |
| 11 | +- **Desktop GUI** — one-window app with setup wizard, server control, bot control, live logs, and model picker |
| 12 | +- **One-command launch** — `opencode-telegram` opens the GUI, auto-starts the server and bot |
| 13 | +- **Remote coding** — send prompts to OpenCode from Telegram, receive results on your phone |
| 14 | +- **Session management** — create, switch, rename, and abort sessions from Telegram or the GUI |
| 15 | +- **Model picker** — browse and switch models from the GUI dashboard |
| 16 | +- **Agent modes** — switch between Plan and Build modes with `/mode` |
| 17 | +- **Voice prompts** — send voice messages, transcribe via Whisper-compatible API |
21 | 18 | - **Scheduled tasks** — schedule prompts to run later or on a recurring interval |
22 | | -- **Server control** — start/stop the OpenCode server remotely via `/opencode_start` and `/opencode_stop` |
23 | | -- **Web GUI** — built-in monitoring dashboard at `http://localhost:8765` |
24 | 19 | - **Security** — strict user ID whitelist; no external attack surface |
25 | 20 | - **Localization** — English, Deutsch, Español, Français, Русский, 简体中文 |
26 | 21 | - **Docker support** — one-command deployment with docker-compose |
| 22 | +- **CLI mode** — run headless with `opencode-telegram cli` |
27 | 23 |
|
28 | 24 | ## Architecture |
29 | 25 |
|
@@ -65,44 +61,45 @@ Get your **Telegram User ID** by messaging [@userinfobot](https://t.me/userinfob |
65 | 61 | ### 2. Install OpenCode |
66 | 62 |
|
67 | 63 | ```bash |
68 | | -# Install OpenCode CLI |
69 | 64 | curl -fsSL https://opencode.ai/install | bash |
70 | | - |
71 | | -# Start the server in your project directory |
72 | | -cd /path/to/project |
73 | | -opencode serve |
74 | 65 | ``` |
75 | 66 |
|
76 | | -### 3. Install & Run the Bot |
77 | | - |
78 | | -#### Option A: pip install (recommended) |
| 67 | +### 3. Install & Launch the App |
79 | 68 |
|
80 | 69 | ```bash |
81 | 70 | pip install tp-opencode |
82 | | -opencode-telegram config # Interactive setup wizard |
83 | | -opencode-telegram start # Launch the bot |
| 71 | +opencode-telegram |
84 | 72 | ``` |
85 | 73 |
|
86 | | -#### Option B: From source |
| 74 | +That's it. The GUI opens, you fill in your bot token and user ID on first launch, then click **Start Server** and **Start Bot**. Everything runs from one window. |
| 75 | + |
| 76 | +#### From source |
87 | 77 |
|
88 | 78 | ```bash |
89 | 79 | git clone https://github.com/2241812/tp-opencode.git |
90 | 80 | cd tp-opencode |
91 | | -pip install -r requirements.txt |
92 | | -opencode-telegram config # Interactive setup wizard |
93 | | -opencode-telegram start # Launch the bot |
| 81 | +pip install -e . |
| 82 | +opencode-telegram |
94 | 83 | ``` |
95 | 84 |
|
96 | | -#### Option C: Docker |
| 85 | +#### CLI mode (headless, no GUI) |
97 | 86 |
|
98 | 87 | ```bash |
99 | | -git clone https://github.com/2241812/tp-opencode.git |
100 | | -cd tp-opencode |
101 | | -cp .env.example .env |
102 | | -# Edit .env with your bot token and user ID |
103 | | -docker compose up -d |
| 88 | +opencode-telegram cli |
104 | 89 | ``` |
105 | 90 |
|
| 91 | +## Desktop GUI |
| 92 | + |
| 93 | +The app opens a single window with everything you need: |
| 94 | + |
| 95 | +- **Setup Wizard** — on first launch, enter your bot token, user ID, and OpenCode URL |
| 96 | +- **Dashboard** — server status, bot status, model info at a glance |
| 97 | +- **Start/Stop buttons** — one click to start the OpenCode server and the Telegram bot |
| 98 | +- **Live Logs** — real-time log output from the bot |
| 99 | +- **Model Picker** — browse available models from your OpenCode config and select one |
| 100 | +- **Session List** — see recent sessions |
| 101 | +- **Reconfigure** — go back to the setup wizard anytime |
| 102 | + |
106 | 103 | ## Bot Commands |
107 | 104 |
|
108 | 105 | | Command | Description | |
@@ -251,7 +248,8 @@ tp-opencode/ |
251 | 248 | │ ├── web/ |
252 | 249 | │ │ └── gui.py # Flask monitoring dashboard |
253 | 250 | │ ├── locales/ # Translation files (en, ru, zh, de, es, fr) |
254 | | -│ └── main.py # Entry point and CLI |
| 251 | +│ ├── gui.py # Desktop GUI app (customtkinter) |
| 252 | +│ └── main.py # Entry point (defaults to GUI, cli for headless) |
255 | 253 | ├── tests/ |
256 | 254 | ├── Dockerfile |
257 | 255 | ├── docker-compose.yml |
|
0 commit comments