clew-code 0.4.8 → 0.4.9
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 +339 -334
- package/dist/main.js +1986 -1986
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,334 +1,339 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
|
|
3
|
-
<img src="assets/clew-logo-long.png" alt="Clew Code" width="520" />
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<
|
|
9
|
-
<a href="https://github.com/ClewCode/ClewCode/
|
|
10
|
-
<a href="https://
|
|
11
|
-
<a href="https://
|
|
12
|
-
<a href="
|
|
13
|
-
<a href="
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="assets/clew-logo-long.png" alt="Clew Code" width="520" />
|
|
4
|
+
|
|
5
|
+
### *The agent that works where you do.*
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://github.com/ClewCode/ClewCode/stargazers"><img src="https://img.shields.io/github/stars/ClewCode/ClewCode?style=for-the-badge&color=blue" alt="GitHub stars"></a>
|
|
9
|
+
<a href="https://github.com/ClewCode/ClewCode/releases"><img src="https://img.shields.io/github/v/release/ClewCode/ClewCode?style=for-the-badge&color=orange" alt="Release"></a>
|
|
10
|
+
<a href="https://www.npmjs.com/package/clew-code"><img src="https://img.shields.io/npm/v/clew-code?style=for-the-badge&color=red" alt="npm"></a>
|
|
11
|
+
<a href="https://github.com/ClewCode/ClewCode/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/ClewCode/ClewCode/ci.yml?branch=main&style=for-the-badge" alt="CI"></a>
|
|
12
|
+
<a href="LICENSE.md"><img src="https://img.shields.io/badge/License-GPL--3.0-blue.svg?style=for-the-badge" alt="License"></a>
|
|
13
|
+
<a href="https://bun.sh"><img src="https://img.shields.io/badge/built%20with-Bun-ff69b4.svg?style=for-the-badge" alt="Bun"></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="https://clew-code.org">Website</a> · <a href="https://clew-docs.pages.dev">Docs</a> · <a href="https://github.com/ClewCode/ClewCode/wiki">Wiki</a> · <a href="https://github.com/ClewCode/ClewCode">GitHub</a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
<img src="assets/screenshots/clew-code-repl.png" alt="Clew Code REPL" width="680" />
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
Clew Code is a terminal-native AI coding agent that lives in your repo, works with your API keys, and **doesn't phone home**. It reads your code, writes files, runs commands, and talks to any LLM you bring — all on your machine, no telemetry, no vendor lock-in.
|
|
31
|
+
|
|
32
|
+
If you want a coding assistant that feels local, fast, and doesn't ship your context to a third-party server, this is it.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Table of Contents
|
|
37
|
+
|
|
38
|
+
- [Prerequisites](#prerequisites)
|
|
39
|
+
- [Quick Install](#quick-install)
|
|
40
|
+
- [Getting Started](#getting-started)
|
|
41
|
+
- [Features](#features)
|
|
42
|
+
- [Use Cases](#use-cases)
|
|
43
|
+
- [CLI Quick Reference](#cli-quick-reference)
|
|
44
|
+
- [Configuration](#configuration)
|
|
45
|
+
- [Security](#security)
|
|
46
|
+
- [Documentation](#documentation)
|
|
47
|
+
- [Architecture](#architecture)
|
|
48
|
+
- [Development](#development)
|
|
49
|
+
- [Contributing](#contributing)
|
|
50
|
+
- [Star History](#star-history)
|
|
51
|
+
- [License](#license)
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Prerequisites
|
|
56
|
+
|
|
57
|
+
- **Node.js** 18+ or **Bun** 1.x (recommended for development)
|
|
58
|
+
- An **API key** from at least one supported provider (see [Providers docs](https://clew-docs.pages.dev/providers))
|
|
59
|
+
- *Optional:* Git, Playwright (for browser automation), microphone (for voice input)
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Quick Install
|
|
64
|
+
|
|
65
|
+
### macOS / Linux
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
curl -fsSL https://raw.githubusercontent.com/ClewCode/ClewCode/main/scripts/install.sh | bash
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Windows (PowerShell)
|
|
72
|
+
|
|
73
|
+
```powershell
|
|
74
|
+
irm https://raw.githubusercontent.com/ClewCode/ClewCode/main/scripts/install.ps1 | iex
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### npm (cross-platform)
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
npm install -g clew-code
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Getting Started
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
cd your-project
|
|
89
|
+
clew # Launch the REPL
|
|
90
|
+
clew -p "fix the tests" # One-shot mode
|
|
91
|
+
clew --resume last # Pick up where you left off
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
First launch walks you through provider setup. After that, use `/model` to switch providers mid-session.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Features
|
|
99
|
+
|
|
100
|
+
<table>
|
|
101
|
+
<tr>
|
|
102
|
+
<td><strong>29+ Providers</strong></td>
|
|
103
|
+
<td>OpenAI, Anthropic, DeepSeek, Groq, Google, Ollama (local), and 22+ more. Switch mid-session with <code>/model</code>. No lock-in.</td>
|
|
104
|
+
</tr>
|
|
105
|
+
<tr>
|
|
106
|
+
<td><strong>Persistent Memory</strong></td>
|
|
107
|
+
<td>SQLite-backed, MiMo-inspired store with importance ranking, confidence scoring, and cross-session persistence. Auto-consolidation via Dream + Distill.</td>
|
|
108
|
+
</tr>
|
|
109
|
+
<tr>
|
|
110
|
+
<td><strong>76+ Tools</strong></td>
|
|
111
|
+
<td>Read, Write, Edit, Grep, Bash, Browser, MCP, LSP, git, web search, task management, peer coordination, media generation, voice input.</td>
|
|
112
|
+
</tr>
|
|
113
|
+
<tr>
|
|
114
|
+
<td><strong>LAN Peer Swarm</strong></td>
|
|
115
|
+
<td>Zero-config peer discovery over UDP multicast. Sync memory across machines, delegate tasks, broadcast shell commands with worktree isolation and dependency ordering.</td>
|
|
116
|
+
</tr>
|
|
117
|
+
<tr>
|
|
118
|
+
<td><strong>MCP + Plugins + Skills</strong></td>
|
|
119
|
+
<td>Model Context Protocol over stdio/SSE/WebSocket. Extend with plugins, <code>SKILL.md</code> workflows, or lifecycle hooks.</td>
|
|
120
|
+
</tr>
|
|
121
|
+
<tr>
|
|
122
|
+
<td><strong>Enterprise Audit Logging</strong></td>
|
|
123
|
+
<td>SIEM-compatible NDJSON audit trail with rotation, filtering, and level-based capture. Records tool calls, file access, and command execution.</td>
|
|
124
|
+
</tr>
|
|
125
|
+
<tr>
|
|
126
|
+
<td><strong>Project Rules</strong></td>
|
|
127
|
+
<td>Auto-observed behavioral rules scoped to your repo via <code>/rule</code>. Configured in <code>.clew/rules.json</code> — Clew reads and follows them without being reminded.</td>
|
|
128
|
+
</tr>
|
|
129
|
+
<tr>
|
|
130
|
+
<td><strong>Ultracode Reasoning</strong></td>
|
|
131
|
+
<td>Max-effort reasoning mode (<code>/ultracode</code> or <code>--effort max</code>) for complex debugging, architecture design, and multi-step refactoring.</td>
|
|
132
|
+
</tr>
|
|
133
|
+
<tr>
|
|
134
|
+
<td><strong>Rewind / Undo</strong></td>
|
|
135
|
+
<td><code>/rewind</code> restores code and/or conversation to any previous checkpoint. Integrated with structured 20%/45%/70% progress snapshots.</td>
|
|
136
|
+
</tr>
|
|
137
|
+
<tr>
|
|
138
|
+
<td><strong>Cross-Repo Workspace</strong></td>
|
|
139
|
+
<td><code>/workspace link ../other-repo</code> — edit across linked projects with full context loaded from both. Bidirectional and persistent.</td>
|
|
140
|
+
</tr>
|
|
141
|
+
<tr>
|
|
142
|
+
<td><strong>Background Daemon</strong></td>
|
|
143
|
+
<td>Task queue with lease-based concurrency, cron scheduling, dead-letter retries, memory consolidation, and cross-session task persistence.</td>
|
|
144
|
+
</tr>
|
|
145
|
+
<tr>
|
|
146
|
+
<td><strong>Multi-Agent Architecture</strong></td>
|
|
147
|
+
<td>Agents, Subagents, LAN Peers, Process Peers. Personal profile turns Clew into a command center that delegates to Codex workers.</td>
|
|
148
|
+
</tr>
|
|
149
|
+
</table>
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Use Cases
|
|
154
|
+
|
|
155
|
+
| Scenario | How Clew Code Helps |
|
|
156
|
+
|---|---|
|
|
157
|
+
| **Fix failing tests** | `clew -p "Fix the failing tests and explain what was wrong"` — reads test output, diagnoses root cause, applies fixes. |
|
|
158
|
+
| **Refactor a module** | Point it at a file, describe the target structure. Uses multi-file edit tools, git status awareness, and checkpoint rollback on mistakes. |
|
|
159
|
+
| **Research a codebase** | `/research "How does auth work?"` — searches code, docs, and web, then compiles a dossier with source references. |
|
|
160
|
+
| **Background automation** | Run `/bg` to delegate long-running tasks (migration, lint fixes) to a background agent while you keep working in the REPL. |
|
|
161
|
+
| **Cross-repo changes** | `/workspace link ../other-repo` — edit across linked projects with full context from both. |
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## CLI Quick Reference
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
-p, --prompt <text> One-shot prompt, then exit
|
|
169
|
+
-c, --continue Continue last conversation
|
|
170
|
+
-r, --resume [id] Resume a session (opens picker if no id)
|
|
171
|
+
--model <model> Override model (sonnet, opus, gemini-2.5-flash, etc.)
|
|
172
|
+
--effort <level> Reasoning effort (low|medium|high|max)
|
|
173
|
+
--agent <agent> Custom agent profile
|
|
174
|
+
--permission-mode <mode> default|ask|plan|auto
|
|
175
|
+
--peer-share Start as a LAN worker peer
|
|
176
|
+
--computer Enable OS-level computer use (Windows only)
|
|
177
|
+
--debug Developer debug output
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Notable slash commands: `/model`, `/effort`, `/ultracode`, `/memory`, `/rule`, `/task`, `/goal`, `/compact`, `/rewind`, `/workspace`, `/peer`, `/mcp`, `/agent`, `/plan`, `/voice`, `/research`, `/workflow`, `/skills`, `/code-review`, `/guardian`, `/bg`, `/daemon`, `/buddy`, `/doctor`, `/stats`, `/cost`, `/session`, `/diff`, `/fork`, `/theme`, and [many more](https://clew-docs.pages.dev/cli).
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Configuration
|
|
185
|
+
|
|
186
|
+
### Environment Variables
|
|
187
|
+
|
|
188
|
+
| Variable | Required | Description |
|
|
189
|
+
|---|---|---|
|
|
190
|
+
| `ANTHROPIC_API_KEY` | No | Anthropic Claude models |
|
|
191
|
+
| `OPENAI_API_KEY` | No | OpenAI GPT models |
|
|
192
|
+
| `DEEPSEEK_API_KEY` | No | DeepSeek models |
|
|
193
|
+
| `GOOGLE_API_KEY` | No | Google Gemini models |
|
|
194
|
+
| `GROQ_API_KEY` | No | Groq-hosted models |
|
|
195
|
+
| `TAVILY_API_KEY` | No | Enhanced web search provider |
|
|
196
|
+
| `CLEW_DISABLE_TELEMETRY` | No | Disable anonymous usage stats (`1`) |
|
|
197
|
+
|
|
198
|
+
All provider keys can also be set via the `/model` provider setup flow or in `.clew/settings.json` under `env`.
|
|
199
|
+
|
|
200
|
+
### Project Rules
|
|
201
|
+
|
|
202
|
+
Create `.clew/rules.json` in your repo to define auto-observed behavioral rules — Clew reads them at session start and follows them without being reminded. Manage them interactively with `/rule`. Disable temporarily with `/rule off`.
|
|
203
|
+
|
|
204
|
+
```json
|
|
205
|
+
{
|
|
206
|
+
"rules": [
|
|
207
|
+
"Always use the project's existing test framework for new tests",
|
|
208
|
+
"Prefer named exports over default exports"
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Enterprise Audit Logging
|
|
214
|
+
|
|
215
|
+
Audit logging is opt-in and writes newline-delimited JSON events for SIEM ingestion. When enabled, Clew records tool calls, tool results/failures, file read/write access, and Bash/PowerShell command execution/results.
|
|
216
|
+
|
|
217
|
+
| Variable | Required | Description |
|
|
218
|
+
|---|---|---|
|
|
219
|
+
| `CLEW_AUDIT_LOG` | No | Enable audit logging when set to `1` |
|
|
220
|
+
| `CLEW_AUDIT_LOG_PATH` | No | Audit log directory, relative to the project root by default (`.clew/audit`) |
|
|
221
|
+
| `CLEW_AUDIT_LOG_MAX_BYTES` | No | Rotate `audit.ndjson` after this size in bytes (default: 100 MB) |
|
|
222
|
+
| `CLEW_AUDIT_LOG_MAX_FILES` | No | Number of audit log files to retain, including the active file (default: 10) |
|
|
223
|
+
| `CLEW_AUDIT_LOG_INCLUDE` | No | Comma-separated event allowlist, such as `tool.call,tool.result` |
|
|
224
|
+
| `CLEW_AUDIT_LOG_EXCLUDE` | No | Comma-separated event blocklist |
|
|
225
|
+
| `CLEW_AUDIT_LOG_MIN_LEVEL` | No | Minimum level to write: `info`, `warn`, `error`, or `audit` |
|
|
226
|
+
| `CLEW_AUDIT_LOG_CONSOLE` | No | Also mirror audit summaries to stderr when set to `1` |
|
|
227
|
+
| `CLEW_AUDIT_USER` | No | User identifier to include in each audit event |
|
|
228
|
+
|
|
229
|
+
Example:
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
CLEW_AUDIT_LOG=1 CLEW_AUDIT_LOG_PATH=.clew/audit bun run dev
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Security
|
|
238
|
+
|
|
239
|
+
Clew Code runs entirely on your machine. No code or context leaves your network unless you explicitly configure a remote provider or send a web fetch.
|
|
240
|
+
|
|
241
|
+
- Prompts for permission before read, write, or terminal execution
|
|
242
|
+
- Fine-tune auto-approve rules per workspace
|
|
243
|
+
- Permission scopes: default, ask, plan, auto
|
|
244
|
+
- Guardian system for auto-review using secondary LLM
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Documentation
|
|
249
|
+
|
|
250
|
+
| Guide | Description |
|
|
251
|
+
|---|---|
|
|
252
|
+
| [Quick Start](https://clew-docs.pages.dev/quick-start) | Launch the CLI and start coding |
|
|
253
|
+
| [Installation](https://clew-docs.pages.dev/installation) | One-liner, npm, or build from source |
|
|
254
|
+
| [CLI Reference](https://clew-docs.pages.dev/cli) | Full CLI options, providers, commands |
|
|
255
|
+
| [Configuration](https://clew-docs.pages.dev/configuration) | Settings files, hooks, permission modes |
|
|
256
|
+
| [MCP Guide](https://clew-docs.pages.dev/mcp) | Connect external tools and APIs |
|
|
257
|
+
| [Plugins](https://clew-docs.pages.dev/plugins) | Lifecycle hooks and customization |
|
|
258
|
+
| [Security & Permissions](https://clew-docs.pages.dev/security-permissions) | Permission scopes, guardian system |
|
|
259
|
+
| [Skills System](https://clew-docs.pages.dev/skills) | Automate repeatable workflows |
|
|
260
|
+
| [Memory System](https://clew-docs.pages.dev/memory-system) | SQLite-backed long-term memory |
|
|
261
|
+
| [Peer-to-Peer LAN](https://clew-docs.pages.dev/peer-to-peer) | Discover, delegate, swarm commands |
|
|
262
|
+
| [Architecture](https://clew-docs.pages.dev/concepts-agents-subagents-peers) | Agents, Subagents, Peers |
|
|
263
|
+
| [Troubleshooting](https://clew-docs.pages.dev/troubleshooting) | Common issues and fixes |
|
|
264
|
+
|
|
265
|
+
Also available on the [GitHub Wiki](https://github.com/ClewCode/ClewCode/wiki).
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## Architecture
|
|
270
|
+
|
|
271
|
+
```
|
|
272
|
+
┌─ REPL ─────────────────────────────┐
|
|
273
|
+
│ Ink + React 19 ┌───────┐ │
|
|
274
|
+
│ Slash commands / skills │ Tools │ │
|
|
275
|
+
│ Streaming / history └───┬───┘ │
|
|
276
|
+
└────────┬─────────────────────┘ │
|
|
277
|
+
▼ │
|
|
278
|
+
┌─ QueryEngine ──────────────────────┘
|
|
279
|
+
│ Tool loop · Provider routing · Streaming
|
|
280
|
+
│ Context compaction · Checkpoints
|
|
281
|
+
└──┬────┬────┬────┬────┐
|
|
282
|
+
▼ ▼ ▼ ▼ ▼
|
|
283
|
+
┌────┐┌────┐┌────┐┌────┐┌──────────┐
|
|
284
|
+
│ MCP││LSP ││Git ││Web ││ Provider │
|
|
285
|
+
│ ││ ││ ││ ││ Manager │
|
|
286
|
+
└────┘└────┘└────┘└────┘└──────────┘
|
|
287
|
+
│ LAN │
|
|
288
|
+
▼ ▼ ▼
|
|
289
|
+
┌──────┐┌──────────┐┌──────────────┐
|
|
290
|
+
│ SQLite││ Peer ││ AgentRuntime │
|
|
291
|
+
│Memory ││ Server ││ Task Queue │
|
|
292
|
+
└──────┘└──────────┘└──────────────┘
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Development
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
bun run dev # Live-reload REPL
|
|
301
|
+
bun run build # Production build to dist/
|
|
302
|
+
bun test # Vitest suite
|
|
303
|
+
bun run check:ci # Biome lint + format check
|
|
304
|
+
bun x tsc --noEmit # TypeScript check
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### Full Pre-Commit
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
bun run check:ci && bun x tsc --noEmit && bun test --bail
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Shadow `.js` Files
|
|
314
|
+
|
|
315
|
+
`src/` has ~410 `.js` files alongside `.ts` twins (leftover from JS → TS migration). Bun resolves `.js` import specifiers to the real `.js` file on disk — it does **not** prefer the `.ts` source. If you're making a runtime fix, check for a `.js` sibling and edit **both** files.
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
## Contributing
|
|
320
|
+
|
|
321
|
+
Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
322
|
+
|
|
323
|
+
- Report bugs via [GitHub Issues](https://github.com/ClewCode/ClewCode/issues)
|
|
324
|
+
- Discuss ideas in [GitHub Discussions](https://github.com/ClewCode/ClewCode/discussions)
|
|
325
|
+
- Read [AGENTS.md](AGENTS.md) for architecture and code conventions
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## Star History
|
|
330
|
+
|
|
331
|
+
[](https://star-history.com/#ClewCode/ClewCode&Date)
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## License
|
|
336
|
+
|
|
337
|
+
GPL-3.0. See [LICENSE.md](LICENSE.md).
|
|
338
|
+
|
|
339
|
+
Release history in [CHANGELOG.md](CHANGELOG.md).
|