@votadev/tooncode 2.2.3 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +243 -243
- package/package.json +42 -42
- package/tooncode.py +46 -16
package/README.md
CHANGED
|
@@ -1,243 +1,243 @@
|
|
|
1
|
-
# ToonCode —
|
|
2
|
-
|
|
3
|
-
> **by VotaLab** | v2.0.0 | Claude Code alternative powered by free AI models
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
████████╗ ██████╗ ██████╗ ███╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗
|
|
7
|
-
██║ ██║ ██║██║ ██║██╔██╗ ██║██║ ██║ ██║██║ ██║█████╗
|
|
8
|
-
╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
ToonCode is a **free, open-source** AI coding agent that runs in your terminal. It uses free AI models (no API key needed) and provides a Claude Code-like experience with 20+ tools, multi-agent teams, browser automation, and more.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Requirements
|
|
16
|
-
|
|
17
|
-
- **Python 3.10+**
|
|
18
|
-
- **Git**
|
|
19
|
-
- **Node.js 16+** (optional, for npm install method)
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## Installation
|
|
24
|
-
|
|
25
|
-
### Method 1: One-line install (recommended)
|
|
26
|
-
|
|
27
|
-
**Mac / Linux:**
|
|
28
|
-
```bash
|
|
29
|
-
curl -fsSL https://raw.githubusercontent.com/votalab/tooncode/main/install.sh | bash
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
**Windows (PowerShell):**
|
|
33
|
-
```powershell
|
|
34
|
-
irm https://raw.githubusercontent.com/votalab/tooncode/main/install.bat -OutFile install.bat; .\install.bat
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### Method 2: Git clone (manual)
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
# Clone
|
|
41
|
-
git clone https://github.com/votalab/tooncode.git ~/.tooncode
|
|
42
|
-
|
|
43
|
-
# Install dependencies
|
|
44
|
-
pip install -r ~/.tooncode/requirements.txt
|
|
45
|
-
|
|
46
|
-
# Optional: Playwright for browser tool
|
|
47
|
-
pip install playwright && playwright install chromium
|
|
48
|
-
|
|
49
|
-
# Run
|
|
50
|
-
python ~/.tooncode/tooncode.py
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
**Add to PATH (run from anywhere):**
|
|
54
|
-
|
|
55
|
-
Mac/Linux — add to `~/.bashrc` or `~/.zshrc`:
|
|
56
|
-
```bash
|
|
57
|
-
alias tooncode="python ~/.tooncode/tooncode.py"
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Windows — create `tooncode.cmd` in a PATH directory:
|
|
61
|
-
```cmd
|
|
62
|
-
@echo off
|
|
63
|
-
python %USERPROFILE%\.tooncode\tooncode.py %*
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### Method 3: npm
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
npm install -g tooncode
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Method 4: Copy the folder
|
|
73
|
-
|
|
74
|
-
Just copy the entire `tooncode` folder anywhere and run:
|
|
75
|
-
```bash
|
|
76
|
-
cd /path/to/tooncode
|
|
77
|
-
pip install -r requirements.txt
|
|
78
|
-
python tooncode.py
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## Quick Start
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
tooncode # Start in current directory
|
|
87
|
-
tooncode big-pickle # Start with specific model
|
|
88
|
-
tooncode minimax-m2.5-free ~/my-project # Model + directory
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
## Features
|
|
94
|
-
|
|
95
|
-
### 20 Tools
|
|
96
|
-
|
|
97
|
-
| Tool | Description |
|
|
98
|
-
|------|-------------|
|
|
99
|
-
| `bash` | Run shell commands (auto-detects PowerShell/bash) |
|
|
100
|
-
| `read` | Read files with line numbers |
|
|
101
|
-
| `write` | Create/overwrite files (shows diff) |
|
|
102
|
-
| `edit` | String replacement in files (shows diff) |
|
|
103
|
-
| `multi_edit` | Batch edits in one call |
|
|
104
|
-
| `glob` | Find files by pattern |
|
|
105
|
-
| `grep` | Search file contents with regex |
|
|
106
|
-
| `list_dir` | Browse directory structure |
|
|
107
|
-
| `web_search` | Search the web (DuckDuckGo) |
|
|
108
|
-
| `web_fetch` | Fetch web page content |
|
|
109
|
-
| `http` | Full HTTP client (GET/POST/PUT/DELETE + auth) |
|
|
110
|
-
| `browser` | Playwright browser: open, click, fill, screenshot, console, network |
|
|
111
|
-
| `screenshot` | Capture desktop/window screenshot |
|
|
112
|
-
| `spawn_agent` | Spawn sub-agent (coder/reviewer/tester/researcher) |
|
|
113
|
-
| `memory_save` | Save notes for future sessions |
|
|
114
|
-
| `memory_search` | Search past memories |
|
|
115
|
-
| `task_create/update/list` | Task management |
|
|
116
|
-
| `bosshelp` | Escalate to Claude Code or fallback model |
|
|
117
|
-
|
|
118
|
-
### Slash Commands
|
|
119
|
-
|
|
120
|
-
| Command | Description |
|
|
121
|
-
|---------|-------------|
|
|
122
|
-
| `/help` | Show all commands |
|
|
123
|
-
| `/model [name]` | Switch AI model |
|
|
124
|
-
| `/boss <task>` | Create task plan (uses Claude Code or own model) |
|
|
125
|
-
| `/team <task>` | Multi-agent team: planner + frontend + backend + reviewer + tester |
|
|
126
|
-
| `/plan` | Toggle Plan Mode (read-only) |
|
|
127
|
-
| `/do` | Execute pending tasks |
|
|
128
|
-
| `/tasks` | Show task progress |
|
|
129
|
-
| `/continue`, `/c` | Continue where AI left off |
|
|
130
|
-
| `/save`, `/s` | Save session |
|
|
131
|
-
| `/resume`, `/r` | Load saved session |
|
|
132
|
-
| `/compact` | Compress context |
|
|
133
|
-
| `/memory` | Browse saved memories |
|
|
134
|
-
| `/paste`, `/v` | Send clipboard content |
|
|
135
|
-
| `/send <msg>` | Chat between ToonCode windows |
|
|
136
|
-
| `/bg`, `/ps` | Manage background processes |
|
|
137
|
-
| `/commit` | Git add & commit |
|
|
138
|
-
| `/diff` | Git diff |
|
|
139
|
-
| `/status` | Git status |
|
|
140
|
-
| `/undo` | Undo last file edit |
|
|
141
|
-
| `/init` | Create TOONCODE.md (auto-imports CLAUDE.md etc.) |
|
|
142
|
-
| `/config` | Show/edit config |
|
|
143
|
-
| `/skills` | List 32 built-in skills |
|
|
144
|
-
| `/cost` | Token usage stats |
|
|
145
|
-
|
|
146
|
-
### Multi-Agent Team
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
/team สร้างเว็บ portfolio # Default: planner + frontend + backend
|
|
150
|
-
/team สร้าง API --roles planner,backend,tester # Custom roles
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
Agents coordinate automatically via shared channel:
|
|
154
|
-
- 📋 **planner** — Creates plan, assigns work
|
|
155
|
-
- 🎨 **frontend** — Builds UI (HTML/CSS/JS)
|
|
156
|
-
- ⚙️ **backend** — Builds API/server logic
|
|
157
|
-
- 🔍 **reviewer** — Reviews code, fixes bugs
|
|
158
|
-
- 🧪 **tester** — Writes & runs tests
|
|
159
|
-
|
|
160
|
-
### 32 Built-in Skills
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
/refactor src/utils.py # Refactor code
|
|
164
|
-
/review # Code review
|
|
165
|
-
/test api/users.js # Generate tests
|
|
166
|
-
/fix # Fix bugs
|
|
167
|
-
/explain server.py # Explain code
|
|
168
|
-
/optimize # Performance optimization
|
|
169
|
-
/docker # Create Dockerfile
|
|
170
|
-
/commit # Smart git commit
|
|
171
|
-
/audit # Security audit
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
### Available Models
|
|
175
|
-
|
|
176
|
-
| Model | Context | Notes |
|
|
177
|
-
|-------|---------|-------|
|
|
178
|
-
| `minimax-m2.5-free` | 200K | Default, good all-round |
|
|
179
|
-
| `big-pickle` | 200K | Strong coding |
|
|
180
|
-
| `nemotron-3-super-free` | 131K | Fast |
|
|
181
|
-
| `gpt-5-nano` | 1M | Largest context |
|
|
182
|
-
|
|
183
|
-
Auto-fallback: if a model fails, ToonCode automatically tries the next one.
|
|
184
|
-
|
|
185
|
-
---
|
|
186
|
-
|
|
187
|
-
## Project Context
|
|
188
|
-
|
|
189
|
-
ToonCode auto-reads these files from your project:
|
|
190
|
-
- `TOONCODE.md` — ToonCode project context
|
|
191
|
-
- `CLAUDE.md` — Claude Code context (auto-imported)
|
|
192
|
-
- `GEMINI.md` — Gemini context
|
|
193
|
-
- `.cursorrules` — Cursor rules
|
|
194
|
-
- `COPILOT.md` — Copilot instructions
|
|
195
|
-
|
|
196
|
-
Run `/init` to auto-create `TOONCODE.md` with imported content.
|
|
197
|
-
|
|
198
|
-
---
|
|
199
|
-
|
|
200
|
-
## Browser Tool
|
|
201
|
-
|
|
202
|
-
Requires Playwright:
|
|
203
|
-
```bash
|
|
204
|
-
pip install playwright && playwright install chromium
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
AI can control a real browser:
|
|
208
|
-
```
|
|
209
|
-
❯ เปิด google ค้นหา "ToonCode" แล้วสรุปผลลัพธ์
|
|
210
|
-
|
|
211
|
-
AI → browser open https://google.com/search?q=ToonCode
|
|
212
|
-
AI → browser text (reads search results)
|
|
213
|
-
AI → browser console (checks JS errors)
|
|
214
|
-
AI → browser screenshot (captures page)
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
---
|
|
218
|
-
|
|
219
|
-
## Update
|
|
220
|
-
|
|
221
|
-
```bash
|
|
222
|
-
cd ~/.tooncode && git pull
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
---
|
|
226
|
-
|
|
227
|
-
## Cross-Platform
|
|
228
|
-
|
|
229
|
-
| Feature | Windows | Mac | Linux |
|
|
230
|
-
|---------|:-------:|:---:|:-----:|
|
|
231
|
-
| All tools | ✅ | ✅ | ✅ |
|
|
232
|
-
| Shell | PowerShell | bash | bash |
|
|
233
|
-
| Screenshot | ImageGrab | screencapture | scrot |
|
|
234
|
-
| Clipboard | Get-Clipboard | pbpaste | xclip |
|
|
235
|
-
| Browser | ✅ | ✅ | ✅ |
|
|
236
|
-
|
|
237
|
-
---
|
|
238
|
-
|
|
239
|
-
## License
|
|
240
|
-
|
|
241
|
-
MIT — Free to use, modify, and distribute.
|
|
242
|
-
|
|
243
|
-
**Made with ❤️ by VotaLab**
|
|
1
|
+
# ToonCode — 🇹🇭 Thai Coding Agent CLI
|
|
2
|
+
|
|
3
|
+
> **by VotaLab** | v2.0.0 | Claude Code alternative powered by free AI models
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
████████╗ ██████╗ ██████╗ ███╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗
|
|
7
|
+
██║ ██║ ██║██║ ██║██╔██╗ ██║██║ ██║ ██║██║ ██║█████╗
|
|
8
|
+
╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
ToonCode is a **free, open-source** AI coding agent that runs in your terminal. It uses free AI models (no API key needed) and provides a Claude Code-like experience with 20+ tools, multi-agent teams, browser automation, and more.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Requirements
|
|
16
|
+
|
|
17
|
+
- **Python 3.10+**
|
|
18
|
+
- **Git**
|
|
19
|
+
- **Node.js 16+** (optional, for npm install method)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
### Method 1: One-line install (recommended)
|
|
26
|
+
|
|
27
|
+
**Mac / Linux:**
|
|
28
|
+
```bash
|
|
29
|
+
curl -fsSL https://raw.githubusercontent.com/votalab/tooncode/main/install.sh | bash
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Windows (PowerShell):**
|
|
33
|
+
```powershell
|
|
34
|
+
irm https://raw.githubusercontent.com/votalab/tooncode/main/install.bat -OutFile install.bat; .\install.bat
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Method 2: Git clone (manual)
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Clone
|
|
41
|
+
git clone https://github.com/votalab/tooncode.git ~/.tooncode
|
|
42
|
+
|
|
43
|
+
# Install dependencies
|
|
44
|
+
pip install -r ~/.tooncode/requirements.txt
|
|
45
|
+
|
|
46
|
+
# Optional: Playwright for browser tool
|
|
47
|
+
pip install playwright && playwright install chromium
|
|
48
|
+
|
|
49
|
+
# Run
|
|
50
|
+
python ~/.tooncode/tooncode.py
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Add to PATH (run from anywhere):**
|
|
54
|
+
|
|
55
|
+
Mac/Linux — add to `~/.bashrc` or `~/.zshrc`:
|
|
56
|
+
```bash
|
|
57
|
+
alias tooncode="python ~/.tooncode/tooncode.py"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Windows — create `tooncode.cmd` in a PATH directory:
|
|
61
|
+
```cmd
|
|
62
|
+
@echo off
|
|
63
|
+
python %USERPROFILE%\.tooncode\tooncode.py %*
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Method 3: npm
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npm install -g tooncode
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Method 4: Copy the folder
|
|
73
|
+
|
|
74
|
+
Just copy the entire `tooncode` folder anywhere and run:
|
|
75
|
+
```bash
|
|
76
|
+
cd /path/to/tooncode
|
|
77
|
+
pip install -r requirements.txt
|
|
78
|
+
python tooncode.py
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Quick Start
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
tooncode # Start in current directory
|
|
87
|
+
tooncode big-pickle # Start with specific model
|
|
88
|
+
tooncode minimax-m2.5-free ~/my-project # Model + directory
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Features
|
|
94
|
+
|
|
95
|
+
### 20 Tools
|
|
96
|
+
|
|
97
|
+
| Tool | Description |
|
|
98
|
+
|------|-------------|
|
|
99
|
+
| `bash` | Run shell commands (auto-detects PowerShell/bash) |
|
|
100
|
+
| `read` | Read files with line numbers |
|
|
101
|
+
| `write` | Create/overwrite files (shows diff) |
|
|
102
|
+
| `edit` | String replacement in files (shows diff) |
|
|
103
|
+
| `multi_edit` | Batch edits in one call |
|
|
104
|
+
| `glob` | Find files by pattern |
|
|
105
|
+
| `grep` | Search file contents with regex |
|
|
106
|
+
| `list_dir` | Browse directory structure |
|
|
107
|
+
| `web_search` | Search the web (DuckDuckGo) |
|
|
108
|
+
| `web_fetch` | Fetch web page content |
|
|
109
|
+
| `http` | Full HTTP client (GET/POST/PUT/DELETE + auth) |
|
|
110
|
+
| `browser` | Playwright browser: open, click, fill, screenshot, console, network |
|
|
111
|
+
| `screenshot` | Capture desktop/window screenshot |
|
|
112
|
+
| `spawn_agent` | Spawn sub-agent (coder/reviewer/tester/researcher) |
|
|
113
|
+
| `memory_save` | Save notes for future sessions |
|
|
114
|
+
| `memory_search` | Search past memories |
|
|
115
|
+
| `task_create/update/list` | Task management |
|
|
116
|
+
| `bosshelp` | Escalate to Claude Code or fallback model |
|
|
117
|
+
|
|
118
|
+
### Slash Commands
|
|
119
|
+
|
|
120
|
+
| Command | Description |
|
|
121
|
+
|---------|-------------|
|
|
122
|
+
| `/help` | Show all commands |
|
|
123
|
+
| `/model [name]` | Switch AI model |
|
|
124
|
+
| `/boss <task>` | Create task plan (uses Claude Code or own model) |
|
|
125
|
+
| `/team <task>` | Multi-agent team: planner + frontend + backend + reviewer + tester |
|
|
126
|
+
| `/plan` | Toggle Plan Mode (read-only) |
|
|
127
|
+
| `/do` | Execute pending tasks |
|
|
128
|
+
| `/tasks` | Show task progress |
|
|
129
|
+
| `/continue`, `/c` | Continue where AI left off |
|
|
130
|
+
| `/save`, `/s` | Save session |
|
|
131
|
+
| `/resume`, `/r` | Load saved session |
|
|
132
|
+
| `/compact` | Compress context |
|
|
133
|
+
| `/memory` | Browse saved memories |
|
|
134
|
+
| `/paste`, `/v` | Send clipboard content |
|
|
135
|
+
| `/send <msg>` | Chat between ToonCode windows |
|
|
136
|
+
| `/bg`, `/ps` | Manage background processes |
|
|
137
|
+
| `/commit` | Git add & commit |
|
|
138
|
+
| `/diff` | Git diff |
|
|
139
|
+
| `/status` | Git status |
|
|
140
|
+
| `/undo` | Undo last file edit |
|
|
141
|
+
| `/init` | Create TOONCODE.md (auto-imports CLAUDE.md etc.) |
|
|
142
|
+
| `/config` | Show/edit config |
|
|
143
|
+
| `/skills` | List 32 built-in skills |
|
|
144
|
+
| `/cost` | Token usage stats |
|
|
145
|
+
|
|
146
|
+
### Multi-Agent Team
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
/team สร้างเว็บ portfolio # Default: planner + frontend + backend
|
|
150
|
+
/team สร้าง API --roles planner,backend,tester # Custom roles
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Agents coordinate automatically via shared channel:
|
|
154
|
+
- 📋 **planner** — Creates plan, assigns work
|
|
155
|
+
- 🎨 **frontend** — Builds UI (HTML/CSS/JS)
|
|
156
|
+
- ⚙️ **backend** — Builds API/server logic
|
|
157
|
+
- 🔍 **reviewer** — Reviews code, fixes bugs
|
|
158
|
+
- 🧪 **tester** — Writes & runs tests
|
|
159
|
+
|
|
160
|
+
### 32 Built-in Skills
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
/refactor src/utils.py # Refactor code
|
|
164
|
+
/review # Code review
|
|
165
|
+
/test api/users.js # Generate tests
|
|
166
|
+
/fix # Fix bugs
|
|
167
|
+
/explain server.py # Explain code
|
|
168
|
+
/optimize # Performance optimization
|
|
169
|
+
/docker # Create Dockerfile
|
|
170
|
+
/commit # Smart git commit
|
|
171
|
+
/audit # Security audit
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Available Models
|
|
175
|
+
|
|
176
|
+
| Model | Context | Notes |
|
|
177
|
+
|-------|---------|-------|
|
|
178
|
+
| `minimax-m2.5-free` | 200K | Default, good all-round |
|
|
179
|
+
| `big-pickle` | 200K | Strong coding |
|
|
180
|
+
| `nemotron-3-super-free` | 131K | Fast |
|
|
181
|
+
| `gpt-5-nano` | 1M | Largest context |
|
|
182
|
+
|
|
183
|
+
Auto-fallback: if a model fails, ToonCode automatically tries the next one.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Project Context
|
|
188
|
+
|
|
189
|
+
ToonCode auto-reads these files from your project:
|
|
190
|
+
- `TOONCODE.md` — ToonCode project context
|
|
191
|
+
- `CLAUDE.md` — Claude Code context (auto-imported)
|
|
192
|
+
- `GEMINI.md` — Gemini context
|
|
193
|
+
- `.cursorrules` — Cursor rules
|
|
194
|
+
- `COPILOT.md` — Copilot instructions
|
|
195
|
+
|
|
196
|
+
Run `/init` to auto-create `TOONCODE.md` with imported content.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Browser Tool
|
|
201
|
+
|
|
202
|
+
Requires Playwright:
|
|
203
|
+
```bash
|
|
204
|
+
pip install playwright && playwright install chromium
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
AI can control a real browser:
|
|
208
|
+
```
|
|
209
|
+
❯ เปิด google ค้นหา "ToonCode" แล้วสรุปผลลัพธ์
|
|
210
|
+
|
|
211
|
+
AI → browser open https://google.com/search?q=ToonCode
|
|
212
|
+
AI → browser text (reads search results)
|
|
213
|
+
AI → browser console (checks JS errors)
|
|
214
|
+
AI → browser screenshot (captures page)
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Update
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
cd ~/.tooncode && git pull
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## Cross-Platform
|
|
228
|
+
|
|
229
|
+
| Feature | Windows | Mac | Linux |
|
|
230
|
+
|---------|:-------:|:---:|:-----:|
|
|
231
|
+
| All tools | ✅ | ✅ | ✅ |
|
|
232
|
+
| Shell | PowerShell | bash | bash |
|
|
233
|
+
| Screenshot | ImageGrab | screencapture | scrot |
|
|
234
|
+
| Clipboard | Get-Clipboard | pbpaste | xclip |
|
|
235
|
+
| Browser | ✅ | ✅ | ✅ |
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## License
|
|
240
|
+
|
|
241
|
+
MIT — Free to use, modify, and distribute.
|
|
242
|
+
|
|
243
|
+
**Made with ❤️ by VotaLab**
|
package/package.json
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@votadev/tooncode",
|
|
3
|
-
"version": "2.2.
|
|
4
|
-
"description": "
|
|
5
|
-
"author": "VotaLab",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"keywords": [
|
|
8
|
-
"ai",
|
|
9
|
-
"coding",
|
|
10
|
-
"agent",
|
|
11
|
-
"cli",
|
|
12
|
-
"claude",
|
|
13
|
-
"free",
|
|
14
|
-
"tooncode",
|
|
15
|
-
"copilot",
|
|
16
|
-
"cursor"
|
|
17
|
-
],
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/votalab/tooncode.git"
|
|
21
|
-
},
|
|
22
|
-
"homepage": "https://github.com/votalab/tooncode#readme",
|
|
23
|
-
"bin": {
|
|
24
|
-
"tooncode": "bin/tooncode.js"
|
|
25
|
-
},
|
|
26
|
-
"files": [
|
|
27
|
-
"bin/",
|
|
28
|
-
"tooncode.py",
|
|
29
|
-
"__main__.py",
|
|
30
|
-
"skills/",
|
|
31
|
-
"requirements.txt",
|
|
32
|
-
"setup.py",
|
|
33
|
-
"tooncode.cmd",
|
|
34
|
-
"README.md"
|
|
35
|
-
],
|
|
36
|
-
"scripts": {
|
|
37
|
-
"postinstall": "node bin/postinstall.js"
|
|
38
|
-
},
|
|
39
|
-
"engines": {
|
|
40
|
-
"node": ">=16"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@votadev/tooncode",
|
|
3
|
+
"version": "2.2.6",
|
|
4
|
+
"description": "🇹🇭 Thai Coding Agent CLI — Claude Code alternative powered by free models. 20 tools, multi-agent team, browser automation, MCP servers.",
|
|
5
|
+
"author": "VotaLab",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"ai",
|
|
9
|
+
"coding",
|
|
10
|
+
"agent",
|
|
11
|
+
"cli",
|
|
12
|
+
"claude",
|
|
13
|
+
"free",
|
|
14
|
+
"tooncode",
|
|
15
|
+
"copilot",
|
|
16
|
+
"cursor"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/votalab/tooncode.git"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/votalab/tooncode#readme",
|
|
23
|
+
"bin": {
|
|
24
|
+
"tooncode": "bin/tooncode.js"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"bin/",
|
|
28
|
+
"tooncode.py",
|
|
29
|
+
"__main__.py",
|
|
30
|
+
"skills/",
|
|
31
|
+
"requirements.txt",
|
|
32
|
+
"setup.py",
|
|
33
|
+
"tooncode.cmd",
|
|
34
|
+
"README.md"
|
|
35
|
+
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"postinstall": "node bin/postinstall.js"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=16"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/tooncode.py
CHANGED
|
@@ -8,7 +8,7 @@ Usage:
|
|
|
8
8
|
python tooncode.py
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
|
-
VERSION = "2.2.
|
|
11
|
+
VERSION = "2.2.6"
|
|
12
12
|
|
|
13
13
|
import httpx
|
|
14
14
|
import json
|
|
@@ -2915,10 +2915,40 @@ def _get_current_api_url() -> str:
|
|
|
2915
2915
|
return _get_api_url()
|
|
2916
2916
|
|
|
2917
2917
|
|
|
2918
|
+
def _validate_messages(messages: list):
|
|
2919
|
+
"""Fix message ordering issues before sending to API."""
|
|
2920
|
+
# Rule: tool_result must follow assistant with tool_use
|
|
2921
|
+
# Rule: alternating user/assistant (with tool_result counting as user)
|
|
2922
|
+
fixed = []
|
|
2923
|
+
for i, msg in enumerate(messages):
|
|
2924
|
+
role = msg.get("role", "")
|
|
2925
|
+
# Skip empty messages
|
|
2926
|
+
content = msg.get("content", [])
|
|
2927
|
+
if not content:
|
|
2928
|
+
continue
|
|
2929
|
+
# Prevent consecutive same-role messages (except tool_result after user)
|
|
2930
|
+
if fixed:
|
|
2931
|
+
prev_role = fixed[-1].get("role", "")
|
|
2932
|
+
if role == prev_role and role == "user":
|
|
2933
|
+
# Check if this is tool_result (allowed after tool_use response)
|
|
2934
|
+
is_tool_result = isinstance(content, list) and any(
|
|
2935
|
+
b.get("type") == "tool_result" for b in content if isinstance(b, dict))
|
|
2936
|
+
if not is_tool_result:
|
|
2937
|
+
fixed.append({"role": "assistant", "content": [{"type": "text", "text": "(continuing)"}]})
|
|
2938
|
+
elif role == prev_role and role == "assistant":
|
|
2939
|
+
fixed.append({"role": "user", "content": [{"type": "text", "text": "(continue)"}]})
|
|
2940
|
+
fixed.append(msg)
|
|
2941
|
+
messages.clear()
|
|
2942
|
+
messages.extend(fixed)
|
|
2943
|
+
|
|
2944
|
+
|
|
2918
2945
|
def stream_response(messages: list, renderer: StreamRenderer) -> dict:
|
|
2919
2946
|
"""Send request and stream the response, returning parsed content blocks."""
|
|
2920
2947
|
global total_input_tokens, total_output_tokens, last_input_tokens
|
|
2921
2948
|
|
|
2949
|
+
# Validate message ordering
|
|
2950
|
+
_validate_messages(messages)
|
|
2951
|
+
|
|
2922
2952
|
system_prompt = build_system_prompt()
|
|
2923
2953
|
body = {
|
|
2924
2954
|
"model": MODEL,
|
|
@@ -3285,7 +3315,7 @@ Be specific. Give copy-paste ready solutions."""
|
|
|
3285
3315
|
console.print("[bold magenta][bosshelp] Asking Claude Code...[/bold magenta]")
|
|
3286
3316
|
try:
|
|
3287
3317
|
result = subprocess.run(
|
|
3288
|
-
[claude_cmd, "--print"],
|
|
3318
|
+
[claude_cmd, "--print", "--dangerously-skip-permissions"],
|
|
3289
3319
|
input=help_prompt,
|
|
3290
3320
|
capture_output=True, text=True, cwd=CWD, timeout=180,
|
|
3291
3321
|
encoding="utf-8", errors="replace",
|
|
@@ -4197,7 +4227,7 @@ OUTPUT THE JSON ARRAY NOW:"""
|
|
|
4197
4227
|
console.print("[dim]Using Claude Code CLI...[/dim]")
|
|
4198
4228
|
try:
|
|
4199
4229
|
result = subprocess.run(
|
|
4200
|
-
[claude_cmd, "--print"],
|
|
4230
|
+
[claude_cmd, "--print", "--dangerously-skip-permissions"],
|
|
4201
4231
|
input=boss_prompt,
|
|
4202
4232
|
capture_output=True, text=True, cwd=CWD, timeout=180,
|
|
4203
4233
|
encoding="utf-8", errors="replace",
|
|
@@ -4696,7 +4726,7 @@ def print_banner():
|
|
|
4696
4726
|
tagline.append(" | ", style="dim")
|
|
4697
4727
|
tagline.append(f"v{VERSION}", style="bold #00ccff")
|
|
4698
4728
|
tagline.append(" | ", style="dim")
|
|
4699
|
-
tagline.append("
|
|
4729
|
+
tagline.append("🇹🇭 Thai Coding Agent", style="dim white")
|
|
4700
4730
|
|
|
4701
4731
|
# Count stats
|
|
4702
4732
|
install_dir = os.path.dirname(os.path.abspath(__file__))
|
|
@@ -5312,21 +5342,21 @@ def main(_initial_prompt=None):
|
|
|
5312
5342
|
)
|
|
5313
5343
|
_last_errors.clear()
|
|
5314
5344
|
_post_bosshelp = True
|
|
5315
|
-
#
|
|
5345
|
+
# MUST append tool_results first (API requires it after tool_use)
|
|
5316
5346
|
messages.append({"role": "user", "content": tool_results})
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
fix_instructions
|
|
5320
|
-
fix_instructions += "
|
|
5321
|
-
fix_instructions += "
|
|
5322
|
-
fix_instructions += "
|
|
5323
|
-
fix_instructions += "
|
|
5324
|
-
fix_instructions += "
|
|
5325
|
-
|
|
5347
|
+
# Then add bosshelp as assistant+user pair
|
|
5348
|
+
fix_instructions = f"[BOSSHELP]\n{boss_answer}\n\n"
|
|
5349
|
+
fix_instructions += "APPLY THIS FIX NOW:\n"
|
|
5350
|
+
fix_instructions += "1. Read each file mentioned\n"
|
|
5351
|
+
fix_instructions += "2. Use edit tool to apply changes\n"
|
|
5352
|
+
fix_instructions += "3. Run commands if needed\n"
|
|
5353
|
+
fix_instructions += "4. Verify the fix works\n"
|
|
5354
|
+
fix_instructions += "USE TOOLS. Do NOT explain."
|
|
5355
|
+
messages.append({"role": "assistant", "content": [{"type": "text", "text": "Let me apply the fix."}]})
|
|
5326
5356
|
messages.append({"role": "user", "content": [{"type": "text", "text":
|
|
5327
5357
|
fix_instructions,
|
|
5328
5358
|
"cache_control": {"type": "ephemeral"}}]})
|
|
5329
|
-
continue
|
|
5359
|
+
continue
|
|
5330
5360
|
else:
|
|
5331
5361
|
# Successful tool = reset error tracking
|
|
5332
5362
|
_last_errors.clear()
|
|
@@ -5400,7 +5430,7 @@ def _cli():
|
|
|
5400
5430
|
|
|
5401
5431
|
parser = argparse.ArgumentParser(
|
|
5402
5432
|
prog="tooncode",
|
|
5403
|
-
description="ToonCode —
|
|
5433
|
+
description="ToonCode — 🇹🇭 Thai Coding Agent CLI by VotaLab",
|
|
5404
5434
|
epilog="""Examples:
|
|
5405
5435
|
tooncode Start interactive mode
|
|
5406
5436
|
tooncode -m big-pickle Use specific model
|