threadwell 0.0.1 → 0.0.3
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/CHANGELOG.md +3 -0
- package/README.md +402 -668
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +6 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +75 -15
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/utils/version-check.d.ts +3 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +9 -5
- package/dist/utils/version-check.js.map +1 -1
- package/docs/settings.md +1 -1
- package/docs/usage.md +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,668 +1,402 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
Threadwell
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
|
158
|
-
|
|
159
|
-
|
|
|
160
|
-
|
|
|
161
|
-
|
|
|
162
|
-
|
|
|
163
|
-
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
|
172
|
-
|
|
173
|
-
|
|
|
174
|
-
|
|
|
175
|
-
|
|
|
176
|
-
|
|
|
177
|
-
|
|
|
178
|
-
|
|
|
179
|
-
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
-
|
|
305
|
-
-
|
|
306
|
-
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
<
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
thread remove npm:@foo/threadwell-tools
|
|
404
|
-
thread uninstall npm:@foo/threadwell-tools # alias for remove
|
|
405
|
-
thread list
|
|
406
|
-
thread update # update Threadwell and packages (skips pinned packages)
|
|
407
|
-
thread update --extensions # update packages only
|
|
408
|
-
thread update --self # update Threadwell only
|
|
409
|
-
thread update --self --force # reinstall Threadwell even if current
|
|
410
|
-
thread update npm:@foo/threadwell-tools # update one package
|
|
411
|
-
thread config # enable/disable extensions, skills, prompts, themes
|
|
412
|
-
```
|
|
413
|
-
|
|
414
|
-
Packages install to `~/.threadwell/agent/git/` (git) or global npm. Use `-l` for project-local installs (`.threadwell/git/`, `.threadwell/npm/`). Git packages install dependencies with `npm install --omit=dev` by default, so runtime deps must be listed under `dependencies`; when `npmCommand` is configured, git packages use plain `install` for compatibility with wrappers. If you use a Node version manager and want package installs to reuse a stable npm context, set `npmCommand` in `settings.json`, for example `["mise", "exec", "node@20", "--", "npm"]`.
|
|
415
|
-
|
|
416
|
-
Create a package by adding a `thread` key to `package.json`:
|
|
417
|
-
|
|
418
|
-
```json
|
|
419
|
-
{
|
|
420
|
-
"name": "my-threadwell-package",
|
|
421
|
-
"keywords": ["threadwell-package"],
|
|
422
|
-
"threadwell": {
|
|
423
|
-
"extensions": ["./extensions"],
|
|
424
|
-
"skills": ["./skills"],
|
|
425
|
-
"prompts": ["./prompts"],
|
|
426
|
-
"themes": ["./themes"]
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
```
|
|
430
|
-
|
|
431
|
-
Without a `thread` manifest, Threadwell auto-discovers from conventional directories (`extensions/`, `skills/`, `prompts/`, `themes/`).
|
|
432
|
-
|
|
433
|
-
See [docs/packages.md](docs/packages.md).
|
|
434
|
-
|
|
435
|
-
---
|
|
436
|
-
|
|
437
|
-
## Programmatic Usage
|
|
438
|
-
|
|
439
|
-
### SDK
|
|
440
|
-
|
|
441
|
-
```typescript
|
|
442
|
-
import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "threadwell";
|
|
443
|
-
|
|
444
|
-
const authStorage = AuthStorage.create();
|
|
445
|
-
const modelRegistry = ModelRegistry.create(authStorage);
|
|
446
|
-
const { session } = await createAgentSession({
|
|
447
|
-
sessionManager: SessionManager.inMemory(),
|
|
448
|
-
authStorage,
|
|
449
|
-
modelRegistry,
|
|
450
|
-
});
|
|
451
|
-
|
|
452
|
-
await session.prompt("What files are in the current directory?");
|
|
453
|
-
```
|
|
454
|
-
|
|
455
|
-
For advanced multi-session runtime replacement, use `createAgentSessionRuntime()` and `AgentSessionRuntime`.
|
|
456
|
-
|
|
457
|
-
See [docs/sdk.md](docs/sdk.md) and [examples/sdk/](examples/sdk/).
|
|
458
|
-
|
|
459
|
-
### RPC Mode
|
|
460
|
-
|
|
461
|
-
For non-Node.js integrations, use RPC mode over stdin/stdout:
|
|
462
|
-
|
|
463
|
-
```bash
|
|
464
|
-
thread --mode rpc
|
|
465
|
-
```
|
|
466
|
-
|
|
467
|
-
RPC mode uses strict LF-delimited JSONL framing. Clients must split records on `\n` only. Do not use generic line readers like Node `readline`, which also split on Unicode separators inside JSON payloads.
|
|
468
|
-
|
|
469
|
-
See [docs/rpc.md](docs/rpc.md) for the protocol.
|
|
470
|
-
|
|
471
|
-
---
|
|
472
|
-
|
|
473
|
-
## Philosophy
|
|
474
|
-
|
|
475
|
-
Threadwell is aggressively extensible so it doesn't have to dictate your workflow. Features that other tools bake in can be built with [extensions](#extensions), [skills](#skills), or installed from third-party [thread packages](#threadwell-packages). This keeps the core minimal while letting you shape Threadwell to fit how you work.
|
|
476
|
-
|
|
477
|
-
**No MCP.** Build CLI tools with READMEs (see [Skills](#skills)), or build an extension that adds MCP support. [Why?](https://mariozechner.at/posts/2025-11-02-what-if-you-dont-need-mcp/)
|
|
478
|
-
|
|
479
|
-
**No sub-agents.** There's many ways to do this. Spawn Threadwell instances via tmux, or build your own with [extensions](#extensions), or install a package that does it your way.
|
|
480
|
-
|
|
481
|
-
**No permission popups.** Run in a container, or build your own confirmation flow with [extensions](#extensions) inline with your environment and security requirements.
|
|
482
|
-
|
|
483
|
-
**No plan mode.** Write plans to files, or build it with [extensions](#extensions), or install a package.
|
|
484
|
-
|
|
485
|
-
**No built-in to-dos.** They confuse models. Use a TODO.md file, or build your own with [extensions](#extensions).
|
|
486
|
-
|
|
487
|
-
**No background bash.** Use tmux. Full observability, direct interaction.
|
|
488
|
-
|
|
489
|
-
Read the [blog post](https://mariozechner.at/posts/2025-11-30-threadwell-coding-agent/) for the full rationale.
|
|
490
|
-
|
|
491
|
-
---
|
|
492
|
-
|
|
493
|
-
## CLI Reference
|
|
494
|
-
|
|
495
|
-
```bash
|
|
496
|
-
thread [options] [@files...] [messages...]
|
|
497
|
-
```
|
|
498
|
-
|
|
499
|
-
### Package Commands
|
|
500
|
-
|
|
501
|
-
```bash
|
|
502
|
-
thread install <source> [-l] # Install package, -l for project-local
|
|
503
|
-
thread remove <source> [-l] # Remove package
|
|
504
|
-
thread uninstall <source> [-l] # Alias for remove
|
|
505
|
-
thread update [source|self] # Update Threadwell and packages (skips pinned packages)
|
|
506
|
-
thread update --extensions # Update packages only
|
|
507
|
-
thread update --self # Update Threadwell only
|
|
508
|
-
thread update --self --force # Reinstall Threadwell even if current
|
|
509
|
-
thread update --extension <src> # Update one package
|
|
510
|
-
thread list # List installed packages
|
|
511
|
-
thread config # Enable/disable package resources
|
|
512
|
-
```
|
|
513
|
-
|
|
514
|
-
### Modes
|
|
515
|
-
|
|
516
|
-
| Flag | Description |
|
|
517
|
-
|------|-------------|
|
|
518
|
-
| (default) | Interactive mode |
|
|
519
|
-
| `-p`, `--print` | Print response and exit |
|
|
520
|
-
| `--mode json` | Output all events as JSON lines (see [docs/json.md](docs/json.md)) |
|
|
521
|
-
| `--mode rpc` | RPC mode for process integration (see [docs/rpc.md](docs/rpc.md)) |
|
|
522
|
-
| `--export <in> [out]` | Export session to HTML |
|
|
523
|
-
|
|
524
|
-
In print mode, Threadwell also reads piped stdin and merges it into the initial prompt:
|
|
525
|
-
|
|
526
|
-
```bash
|
|
527
|
-
cat README.md | Threadwell -p "Summarize this text"
|
|
528
|
-
```
|
|
529
|
-
|
|
530
|
-
### Model Options
|
|
531
|
-
|
|
532
|
-
| Option | Description |
|
|
533
|
-
|--------|-------------|
|
|
534
|
-
| `--provider <name>` | Provider (anthropic, openai, google, etc.) |
|
|
535
|
-
| `--model <pattern>` | Model pattern or ID (supports `provider/id` and optional `:<thinking>`) |
|
|
536
|
-
| `--api-key <key>` | API key (overrides env vars) |
|
|
537
|
-
| `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh` |
|
|
538
|
-
| `--models <patterns>` | Comma-separated patterns for Ctrl+P cycling |
|
|
539
|
-
| `--list-models [search]` | List available models |
|
|
540
|
-
|
|
541
|
-
### Session Options
|
|
542
|
-
|
|
543
|
-
| Option | Description |
|
|
544
|
-
|--------|-------------|
|
|
545
|
-
| `-c`, `--continue` | Continue most recent session |
|
|
546
|
-
| `-r`, `--resume` | Browse and select session |
|
|
547
|
-
| `--session <path\|id>` | Use specific session file or partial UUID |
|
|
548
|
-
| `--fork <path\|id>` | Fork specific session file or partial UUID into a new session |
|
|
549
|
-
| `--session-dir <dir>` | Custom session storage directory |
|
|
550
|
-
| `--no-session` | Ephemeral mode (don't save) |
|
|
551
|
-
|
|
552
|
-
### Tool Options
|
|
553
|
-
|
|
554
|
-
| Option | Description |
|
|
555
|
-
|--------|-------------|
|
|
556
|
-
| `--tools <list>`, `-t <list>` | Allowlist specific tool names across built-in, extension, and custom tools |
|
|
557
|
-
| `--no-builtin-tools`, `-nbt` | Disable built-in tools by default but keep extension/custom tools enabled |
|
|
558
|
-
| `--no-tools`, `-nt` | Disable all tools by default |
|
|
559
|
-
|
|
560
|
-
Available built-in tools: `read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`
|
|
561
|
-
|
|
562
|
-
### Resource Options
|
|
563
|
-
|
|
564
|
-
| Option | Description |
|
|
565
|
-
|--------|-------------|
|
|
566
|
-
| `-e`, `--extension <source>` | Load extension from path, npm, or git (repeatable) |
|
|
567
|
-
| `--no-extensions` | Disable extension discovery |
|
|
568
|
-
| `--skill <path>` | Load skill (repeatable) |
|
|
569
|
-
| `--no-skills` | Disable skill discovery |
|
|
570
|
-
| `--prompt-template <path>` | Load prompt template (repeatable) |
|
|
571
|
-
| `--no-prompt-templates` | Disable prompt template discovery |
|
|
572
|
-
| `--theme <path>` | Load theme (repeatable) |
|
|
573
|
-
| `--no-themes` | Disable theme discovery |
|
|
574
|
-
| `--no-context-files`, `-nc` | Disable AGENTS.md and CLAUDE.md context file discovery |
|
|
575
|
-
|
|
576
|
-
Combine `--no-*` with explicit flags to load exactly what you need, ignoring settings.json (e.g., `--no-extensions -e ./my-ext.ts`).
|
|
577
|
-
|
|
578
|
-
### Other Options
|
|
579
|
-
|
|
580
|
-
| Option | Description |
|
|
581
|
-
|--------|-------------|
|
|
582
|
-
| `--system-prompt <text>` | Replace default prompt (context files and skills still appended) |
|
|
583
|
-
| `--append-system-prompt <text>` | Append to system prompt |
|
|
584
|
-
| `--verbose` | Force verbose startup |
|
|
585
|
-
| `-h`, `--help` | Show help |
|
|
586
|
-
| `-v`, `--version` | Show version |
|
|
587
|
-
|
|
588
|
-
### File Arguments
|
|
589
|
-
|
|
590
|
-
Prefix files with `@` to include in the message:
|
|
591
|
-
|
|
592
|
-
```bash
|
|
593
|
-
thread @prompt.md "Answer this"
|
|
594
|
-
thread -p @screenshot.png "What's in this image?"
|
|
595
|
-
thread @code.ts @test.ts "Review these files"
|
|
596
|
-
```
|
|
597
|
-
|
|
598
|
-
### Examples
|
|
599
|
-
|
|
600
|
-
```bash
|
|
601
|
-
# Interactive with initial prompt
|
|
602
|
-
thread "List all .ts files in src/"
|
|
603
|
-
|
|
604
|
-
# Non-interactive
|
|
605
|
-
thread -p "Summarize this codebase"
|
|
606
|
-
|
|
607
|
-
# Non-interactive with piped stdin
|
|
608
|
-
cat README.md | Threadwell -p "Summarize this text"
|
|
609
|
-
|
|
610
|
-
# Different model
|
|
611
|
-
thread --provider openai --model gpt-4o "Help me refactor"
|
|
612
|
-
|
|
613
|
-
# Model with provider prefix (no --provider needed)
|
|
614
|
-
thread --model openai/gpt-4o "Help me refactor"
|
|
615
|
-
|
|
616
|
-
# Model with thinking level shorthand
|
|
617
|
-
thread --model sonnet:high "Solve this complex problem"
|
|
618
|
-
|
|
619
|
-
# Limit model cycling
|
|
620
|
-
thread --models "claude-*,gpt-4o"
|
|
621
|
-
|
|
622
|
-
# Read-only mode
|
|
623
|
-
thread --tools read,grep,find,ls -p "Review the code"
|
|
624
|
-
|
|
625
|
-
# High thinking level
|
|
626
|
-
thread --thinking high "Solve this complex problem"
|
|
627
|
-
```
|
|
628
|
-
|
|
629
|
-
### Environment Variables
|
|
630
|
-
|
|
631
|
-
| Variable | Description |
|
|
632
|
-
|----------|-------------|
|
|
633
|
-
| `THREADWELL_CODING_AGENT_DIR` | Override config directory (default: `~/.threadwell/agent`) |
|
|
634
|
-
| `THREADWELL_CODING_AGENT_SESSION_DIR` | Override session storage directory (overridden by `--session-dir`) |
|
|
635
|
-
| `THREADWELL_PACKAGE_DIR` | Override package directory (useful for Nix/Guix where store paths tokenize poorly) |
|
|
636
|
-
| `THREADWELL_OFFLINE` | Disable startup network operations, including update checks, package update checks, and install/update telemetry |
|
|
637
|
-
| `THREADWELL_SKIP_VERSION_CHECK` | Skip the Threadwell version update check at startup. This prevents the `threadwell.dev` latest-version request |
|
|
638
|
-
| `THREADWELL_TELEMETRY` | Override install/update telemetry. Use `1`/`true`/`yes` to enable or `0`/`false`/`no` to disable. This does not disable update checks |
|
|
639
|
-
| `THREADWELL_CACHE_RETENTION` | Set to `long` for extended prompt cache (Anthropic: 1h, OpenAI: 24h) |
|
|
640
|
-
| `VISUAL`, `EDITOR` | External editor for Ctrl+G |
|
|
641
|
-
|
|
642
|
-
---
|
|
643
|
-
|
|
644
|
-
## Contributing & Development
|
|
645
|
-
|
|
646
|
-
See [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines and [docs/development.md](docs/development.md) for setup, forking, and debugging.
|
|
647
|
-
|
|
648
|
-
---
|
|
649
|
-
|
|
650
|
-
## Repository and release policy
|
|
651
|
-
|
|
652
|
-
Threadwell's target repository is `EngramResearch/threadwell`. The `threadwell` npm package was reserved with a `0.0.0` placeholder and should only be replaced by an explicitly approved real release.
|
|
653
|
-
|
|
654
|
-
## License
|
|
655
|
-
|
|
656
|
-
MIT. See the repository `LICENSE` and `NOTICE.md` files.
|
|
657
|
-
|
|
658
|
-
## Attribution
|
|
659
|
-
|
|
660
|
-
Threadwell is derived from Pi, originally developed by Mario Zechner and contributors. Pi is licensed under the MIT License; the original copyright and license notice are preserved in this repository.
|
|
661
|
-
|
|
662
|
-
Original project: https://github.com/earendil-works/pi
|
|
663
|
-
|
|
664
|
-
## See Also
|
|
665
|
-
|
|
666
|
-
- [@threadwell/ai](https://www.npmjs.com/package/@threadwell/ai): Core LLM toolkit
|
|
667
|
-
- [@threadwell/agent-core](https://www.npmjs.com/package/@threadwell/agent-core): Agent framework
|
|
668
|
-
- [@threadwell/tui](https://www.npmjs.com/package/@threadwell/tui): Terminal UI components
|
|
1
|
+
# Threadwell
|
|
2
|
+
|
|
3
|
+
Threadwell is a standalone, terminal-native coding harness for long-running software work.
|
|
4
|
+
It focuses on continuity, project memory, durable decisions, and low-friction coding workflows.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
npm install -g threadwell
|
|
8
|
+
thread
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Package: [`threadwell`](https://www.npmjs.com/package/threadwell)
|
|
12
|
+
Repository: [`EngramResearch/threadwell`](https://github.com/EngramResearch/threadwell)
|
|
13
|
+
Command: `thread`
|
|
14
|
+
|
|
15
|
+
## Status
|
|
16
|
+
|
|
17
|
+
Threadwell is early. Version `0.0.x` is intended for real local use, but the public package and documentation are still being cleaned up after the fork and rebrand.
|
|
18
|
+
|
|
19
|
+
The product identity is Threadwell:
|
|
20
|
+
|
|
21
|
+
- CLI command: `thread`
|
|
22
|
+
- npm package: `threadwell`
|
|
23
|
+
- project config: `.threadwell/`
|
|
24
|
+
- global config: `~/.threadwell/agent/`
|
|
25
|
+
- env prefix: `THREADWELL_*`
|
|
26
|
+
|
|
27
|
+
## What Threadwell does
|
|
28
|
+
|
|
29
|
+
Threadwell gives an LLM a project-aware coding harness with:
|
|
30
|
+
|
|
31
|
+
- terminal-native interactive TUI;
|
|
32
|
+
- file tools: `read`, `write`, `edit`, `grep`, `find`, `ls`;
|
|
33
|
+
- shell execution via `bash`;
|
|
34
|
+
- persistent sessions with branching and compaction;
|
|
35
|
+
- native continuity state;
|
|
36
|
+
- semantic project memory;
|
|
37
|
+
- `CONTEXT.md` project vocabulary and operating context;
|
|
38
|
+
- architecture decision records via ADR support;
|
|
39
|
+
- prompt templates, skills, themes, and TypeScript extensions;
|
|
40
|
+
- JSON/RPC/SDK modes for automation and embedding.
|
|
41
|
+
|
|
42
|
+
Threadwell is not a browser IDE. It is a local coding harness that keeps the terminal workflow while adding durable project context.
|
|
43
|
+
|
|
44
|
+
## Quick start
|
|
45
|
+
|
|
46
|
+
Install:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm install -g threadwell
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Run interactively:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
thread
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Run with an initial prompt:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
thread "Review this repository and summarize the architecture"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Run non-interactively:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
thread -p "List likely bugs in this file" @src/index.ts
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Use a specific model:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
thread --provider anthropic --model claude-sonnet-4-5
|
|
74
|
+
thread --model openai/gpt-4o
|
|
75
|
+
thread --model sonnet:high
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Authentication
|
|
79
|
+
|
|
80
|
+
Threadwell supports API-key and OAuth/subscription login flows, depending on provider.
|
|
81
|
+
|
|
82
|
+
API-key example:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
86
|
+
thread
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Interactive login:
|
|
90
|
+
|
|
91
|
+
```text
|
|
92
|
+
/login
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Auth is stored under:
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
~/.threadwell/agent/auth.json
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
After the Threadwell rebrand, old Pi/Engram auth files are not silently migrated. Log in again if needed.
|
|
102
|
+
|
|
103
|
+
## Providers and models
|
|
104
|
+
|
|
105
|
+
Built-in provider support includes:
|
|
106
|
+
|
|
107
|
+
- Anthropic
|
|
108
|
+
- OpenAI
|
|
109
|
+
- OpenAI Codex
|
|
110
|
+
- GitHub Copilot
|
|
111
|
+
- Google Gemini
|
|
112
|
+
- Google Vertex
|
|
113
|
+
- Azure OpenAI
|
|
114
|
+
- Amazon Bedrock
|
|
115
|
+
- Mistral
|
|
116
|
+
- Groq
|
|
117
|
+
- Cerebras
|
|
118
|
+
- Cloudflare AI Gateway / Workers AI
|
|
119
|
+
- xAI
|
|
120
|
+
- OpenRouter
|
|
121
|
+
- Vercel AI Gateway
|
|
122
|
+
- Hugging Face
|
|
123
|
+
- Fireworks
|
|
124
|
+
- DeepSeek
|
|
125
|
+
- Kimi / Moonshot
|
|
126
|
+
- MiniMax
|
|
127
|
+
- Xiaomi MiMo
|
|
128
|
+
- OpenCode-compatible providers
|
|
129
|
+
|
|
130
|
+
See [`docs/providers.md`](docs/providers.md) and [`docs/models.md`](docs/models.md).
|
|
131
|
+
|
|
132
|
+
## Interactive mode
|
|
133
|
+
|
|
134
|
+
The TUI includes:
|
|
135
|
+
|
|
136
|
+
- transcript of user/assistant/tool messages;
|
|
137
|
+
- multiline editor;
|
|
138
|
+
- model and thinking controls;
|
|
139
|
+
- session resume/fork/tree navigation;
|
|
140
|
+
- tool output folding;
|
|
141
|
+
- image paste support;
|
|
142
|
+
- command palette via `/` commands;
|
|
143
|
+
- status/footer with project and model state.
|
|
144
|
+
|
|
145
|
+
Common commands:
|
|
146
|
+
|
|
147
|
+
| Command | Description |
|
|
148
|
+
| --- | --- |
|
|
149
|
+
| `/login`, `/logout` | Manage provider auth |
|
|
150
|
+
| `/model` | Switch model |
|
|
151
|
+
| `/settings` | Edit runtime settings |
|
|
152
|
+
| `/resume` | Resume previous session |
|
|
153
|
+
| `/new` | Start a new session |
|
|
154
|
+
| `/session` | Show session info |
|
|
155
|
+
| `/tree` | Navigate/fork the session tree |
|
|
156
|
+
| `/compact` | Compact long context |
|
|
157
|
+
| `/memory ...` | Inspect/search/manage memory |
|
|
158
|
+
| `/context ...` | Review `CONTEXT.md` candidates |
|
|
159
|
+
| `/adr ...` | Manage architecture decision records |
|
|
160
|
+
| `/review` | Review memory/context/ADR candidates |
|
|
161
|
+
| `/feature ...` | Create Threadwell feature packets |
|
|
162
|
+
| `/queue [long]` | Show continuity queue tasks |
|
|
163
|
+
| `/copy` | Copy last assistant message |
|
|
164
|
+
| `/export` | Export session to HTML |
|
|
165
|
+
| `/hotkeys` | Show keybindings |
|
|
166
|
+
| `/quit` | Exit |
|
|
167
|
+
|
|
168
|
+
Common shortcuts:
|
|
169
|
+
|
|
170
|
+
| Key | Action |
|
|
171
|
+
| --- | --- |
|
|
172
|
+
| Ctrl+C | Clear editor |
|
|
173
|
+
| Ctrl+C twice | Quit |
|
|
174
|
+
| Escape | Cancel/abort |
|
|
175
|
+
| Ctrl+L | Model selector |
|
|
176
|
+
| Ctrl+P / Shift+Ctrl+P | Cycle scoped models |
|
|
177
|
+
| Shift+Tab | Cycle thinking level |
|
|
178
|
+
| Ctrl+O | Collapse/expand tool output |
|
|
179
|
+
| Ctrl+T | Collapse/expand thinking blocks |
|
|
180
|
+
|
|
181
|
+
See [`docs/keybindings.md`](docs/keybindings.md) and [`docs/tui.md`](docs/tui.md).
|
|
182
|
+
|
|
183
|
+
## Sessions and continuity
|
|
184
|
+
|
|
185
|
+
Sessions are JSONL files stored under:
|
|
186
|
+
|
|
187
|
+
```text
|
|
188
|
+
~/.threadwell/agent/sessions/
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Useful CLI flags:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
thread -c # continue most recent session
|
|
195
|
+
thread -r # select previous session
|
|
196
|
+
thread --session <path|id> # use specific session
|
|
197
|
+
thread --fork <path|id> # fork from specific session
|
|
198
|
+
thread --no-session # ephemeral mode
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Threadwell also maintains project continuity state under `.threadwell/` so work can be resumed across sessions without relying only on chat history.
|
|
202
|
+
|
|
203
|
+
## Memory layer
|
|
204
|
+
|
|
205
|
+
Threadwell includes a native memory layer for project work:
|
|
206
|
+
|
|
207
|
+
- structured event storage;
|
|
208
|
+
- redaction and ignore rules;
|
|
209
|
+
- retrieval capsules injected into context;
|
|
210
|
+
- `CONTEXT.md` semantic project vocabulary;
|
|
211
|
+
- ADR files for durable decisions;
|
|
212
|
+
- review flows for proposed memory/context/ADR updates.
|
|
213
|
+
|
|
214
|
+
Primary commands:
|
|
215
|
+
|
|
216
|
+
```text
|
|
217
|
+
/memory status
|
|
218
|
+
/memory search <query>
|
|
219
|
+
/memory recent
|
|
220
|
+
/memory why
|
|
221
|
+
/memory doctor
|
|
222
|
+
/context review
|
|
223
|
+
/adr list
|
|
224
|
+
/review
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
See [`docs/memory.md`](docs/memory.md), [`docs/settings.md`](docs/settings.md), and the [ADR guide](https://github.com/EngramResearch/threadwell/tree/main/docs/adr).
|
|
228
|
+
|
|
229
|
+
## Configuration
|
|
230
|
+
|
|
231
|
+
Global config:
|
|
232
|
+
|
|
233
|
+
```text
|
|
234
|
+
~/.threadwell/agent/settings.json
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Project config:
|
|
238
|
+
|
|
239
|
+
```text
|
|
240
|
+
.threadwell/settings.json
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Example:
|
|
244
|
+
|
|
245
|
+
```json
|
|
246
|
+
{
|
|
247
|
+
"continuity": true,
|
|
248
|
+
"memory": {
|
|
249
|
+
"enabled": true,
|
|
250
|
+
"inject": true,
|
|
251
|
+
"store": "sqlite"
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Important env vars:
|
|
257
|
+
|
|
258
|
+
| Variable | Description |
|
|
259
|
+
| --- | --- |
|
|
260
|
+
| `THREADWELL_CODING_AGENT_DIR` | Override global config dir |
|
|
261
|
+
| `THREADWELL_CODING_AGENT_SESSION_DIR` | Override session dir |
|
|
262
|
+
| `THREADWELL_PACKAGE_DIR` | Override package install dir |
|
|
263
|
+
| `THREADWELL_OFFLINE` | Disable startup network operations |
|
|
264
|
+
| `THREADWELL_SKIP_VERSION_CHECK` | Skip version checks |
|
|
265
|
+
| `THREADWELL_TELEMETRY` | Enable/disable install/update telemetry |
|
|
266
|
+
| `THREADWELL_CACHE_RETENTION` | Set extended prompt cache behavior |
|
|
267
|
+
| `VISUAL`, `EDITOR` | External editor |
|
|
268
|
+
|
|
269
|
+
See [`docs/settings.md`](docs/settings.md).
|
|
270
|
+
|
|
271
|
+
## Extensions, skills, prompts, themes
|
|
272
|
+
|
|
273
|
+
Threadwell can be extended without changing core code.
|
|
274
|
+
|
|
275
|
+
Resource locations:
|
|
276
|
+
|
|
277
|
+
```text
|
|
278
|
+
~/.threadwell/agent/extensions/
|
|
279
|
+
~/.threadwell/agent/skills/
|
|
280
|
+
~/.threadwell/agent/prompts/
|
|
281
|
+
~/.threadwell/agent/themes/
|
|
282
|
+
|
|
283
|
+
.threadwell/extensions/
|
|
284
|
+
.threadwell/skills/
|
|
285
|
+
.threadwell/prompts/
|
|
286
|
+
.threadwell/themes/
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Package commands:
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
thread install npm:@scope/threadwell-tools
|
|
293
|
+
thread install git:github.com/user/repo
|
|
294
|
+
thread remove npm:@scope/threadwell-tools
|
|
295
|
+
thread list
|
|
296
|
+
thread update
|
|
297
|
+
thread config
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
Security note: extensions and third-party packages execute code locally. Review what you install.
|
|
301
|
+
|
|
302
|
+
Docs:
|
|
303
|
+
|
|
304
|
+
- [`docs/extensions.md`](docs/extensions.md)
|
|
305
|
+
- [`docs/skills.md`](docs/skills.md)
|
|
306
|
+
- [`docs/prompt-templates.md`](docs/prompt-templates.md)
|
|
307
|
+
- [`docs/themes.md`](docs/themes.md)
|
|
308
|
+
- [`docs/packages.md`](docs/packages.md)
|
|
309
|
+
|
|
310
|
+
## Programmatic usage
|
|
311
|
+
|
|
312
|
+
Threadwell can be embedded from Node.js:
|
|
313
|
+
|
|
314
|
+
```typescript
|
|
315
|
+
import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "threadwell";
|
|
316
|
+
|
|
317
|
+
const authStorage = AuthStorage.create();
|
|
318
|
+
const modelRegistry = ModelRegistry.create(authStorage);
|
|
319
|
+
const { session } = await createAgentSession({
|
|
320
|
+
sessionManager: SessionManager.inMemory(),
|
|
321
|
+
authStorage,
|
|
322
|
+
modelRegistry,
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
await session.prompt("What files are in the current directory?");
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
For non-Node integrations, use RPC mode:
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
thread --mode rpc
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
See [`docs/sdk.md`](docs/sdk.md), [`docs/rpc.md`](docs/rpc.md), and [`docs/json.md`](docs/json.md).
|
|
335
|
+
|
|
336
|
+
## CLI reference
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
thread [options] [@files...] [messages...]
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
Selected options:
|
|
343
|
+
|
|
344
|
+
| Option | Description |
|
|
345
|
+
| --- | --- |
|
|
346
|
+
| `-p`, `--print` | Print response and exit |
|
|
347
|
+
| `--mode json` | JSON event output |
|
|
348
|
+
| `--mode rpc` | RPC mode |
|
|
349
|
+
| `--provider <name>` | Provider |
|
|
350
|
+
| `--model <pattern>` | Model pattern/id |
|
|
351
|
+
| `--api-key <key>` | Runtime API key |
|
|
352
|
+
| `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh` |
|
|
353
|
+
| `--tools <list>` | Allowlist tools |
|
|
354
|
+
| `--no-tools` | Disable all tools |
|
|
355
|
+
| `--no-builtin-tools` | Disable built-in tools only |
|
|
356
|
+
| `--extension <path>` | Load extension |
|
|
357
|
+
| `--skill <path>` | Load skill |
|
|
358
|
+
| `--theme <path>` | Load theme |
|
|
359
|
+
| `--no-context-files` | Disable AGENTS.md/CLAUDE.md discovery |
|
|
360
|
+
| `--export <file>` | Export session HTML |
|
|
361
|
+
| `--list-models [search]` | List models |
|
|
362
|
+
| `--offline` | Disable startup network operations |
|
|
363
|
+
| `--help` | Show help |
|
|
364
|
+
| `--version` | Show version |
|
|
365
|
+
|
|
366
|
+
File arguments can be attached with `@`:
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
thread @README.md "Summarize this"
|
|
370
|
+
thread @screenshot.png "What is shown here?"
|
|
371
|
+
thread @src/index.ts @src/index.test.ts "Review these together"
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
## Development
|
|
375
|
+
|
|
376
|
+
Repository:
|
|
377
|
+
|
|
378
|
+
```text
|
|
379
|
+
https://github.com/EngramResearch/threadwell
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
Useful commands:
|
|
383
|
+
|
|
384
|
+
```bash
|
|
385
|
+
npm install
|
|
386
|
+
npm run check
|
|
387
|
+
npm run build
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
## Related packages
|
|
391
|
+
|
|
392
|
+
- [`@threadwell/ai`](https://www.npmjs.com/package/@threadwell/ai)
|
|
393
|
+
- [`@threadwell/agent-core`](https://www.npmjs.com/package/@threadwell/agent-core)
|
|
394
|
+
- [`@threadwell/tui`](https://www.npmjs.com/package/@threadwell/tui)
|
|
395
|
+
|
|
396
|
+
## License and attribution
|
|
397
|
+
|
|
398
|
+
MIT. See the repository [`LICENSE`](https://github.com/EngramResearch/threadwell/blob/main/LICENSE) and [`NOTICE.md`](https://github.com/EngramResearch/threadwell/blob/main/NOTICE.md).
|
|
399
|
+
|
|
400
|
+
Threadwell is derived from Pi, originally developed by Mario Zechner and contributors. Pi is licensed under the MIT License; the original copyright and license notice are preserved in this repository.
|
|
401
|
+
|
|
402
|
+
Original project: <https://github.com/earendil-works/pi>
|