clew-code 0.3.2 → 0.3.4

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.
Files changed (49) hide show
  1. package/README.md +196 -114
  2. package/dist/generated/version.json +1 -1
  3. package/dist/main.js +2963 -3272
  4. package/package.json +5 -5
  5. package/scripts/bun-run.mjs +33 -0
  6. package/scripts/postbuild-inject-macro.mjs +36 -0
  7. package/docs/.nojekyll +0 -0
  8. package/docs/_config.yml +0 -3
  9. package/docs/architecture.html +0 -90
  10. package/docs/assets/clew-agent-loop.png +0 -0
  11. package/docs/assets/clew-general-architecture.png +0 -0
  12. package/docs/assets/clew-mcp-architecture.png +0 -0
  13. package/docs/assets/clew-p2p-swarm.png +0 -0
  14. package/docs/assets/clew.svg +0 -33
  15. package/docs/changelog.html +0 -141
  16. package/docs/cli-reference.html +0 -89
  17. package/docs/commands.html +0 -161
  18. package/docs/configuration.html +0 -85
  19. package/docs/contributing.html +0 -91
  20. package/docs/css/styles.css +0 -545
  21. package/docs/daemon.html +0 -62
  22. package/docs/features/bridge-mode.html +0 -62
  23. package/docs/features/evals.html +0 -58
  24. package/docs/features/searxng-search.html +0 -59
  25. package/docs/features/sentry-setup.html +0 -62
  26. package/docs/generated/providers.html +0 -625
  27. package/docs/generated/tools.html +0 -559
  28. package/docs/index.html +0 -182
  29. package/docs/installation.html +0 -77
  30. package/docs/internals/claude-ai-backend-dependencies.md +0 -278
  31. package/docs/internals/growthbook-ab-testing.html +0 -70
  32. package/docs/internals/hidden-features.html +0 -82
  33. package/docs/internals/long-term-memory-design.md +0 -173
  34. package/docs/js/main.js +0 -438
  35. package/docs/loop.html +0 -69
  36. package/docs/mcp.html +0 -99
  37. package/docs/models.html +0 -81
  38. package/docs/permission-model.html +0 -86
  39. package/docs/personal-profile.html +0 -113
  40. package/docs/plugins.html +0 -84
  41. package/docs/providers.html +0 -625
  42. package/docs/quick-start.html +0 -81
  43. package/docs/research-memory.html +0 -71
  44. package/docs/security.html +0 -71
  45. package/docs/skills.html +0 -67
  46. package/docs/swarm.html +0 -78
  47. package/docs/tools.html +0 -559
  48. package/docs/troubleshooting.html +0 -86
  49. package/docs/voice-mode.html +0 -79
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clew-code",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "ClewCode — multi-provider AI coding agent CLI",
5
5
  "main": "./dist/main.js",
6
6
  "type": "module",
@@ -26,10 +26,10 @@
26
26
  "homepage": "https://github.com/ClewCode/ClewCode#readme",
27
27
  "scripts": {
28
28
  "prebuild-version": "node scripts/prebuild-version.mjs",
29
- "dev": "bun run prebuild-version && bun --watch run --define.TRANSCRIPT_CLASSIFIER=true --define.CHICAGO_MCP=true --define.VOICE_MODE=true src/main.tsx",
30
- "start": "bun run prebuild-version && bun run --define.VOICE_MODE=true src/main.tsx",
31
- "dev:channels": "bun run prebuild-version && bun run --define.VOICE_MODE=true src/main.tsx -- --dangerously-load-development-channels server:clew-orc",
32
- "build": "bun run prebuild-version && NODE_ENV=production bun build --production --define.TRANSCRIPT_CLASSIFIER=true --define.CHICAGO_MCP=true --define.VOICE_MODE=true src/main.tsx --outdir ./dist --target bun --external electron --external 'chromium-bidi*' --external '@ant/claude-for-chrome-mcp' --external '@anthropic-ai/bedrock-sdk' --external '@anthropic-ai/foundry-sdk' --external '@anthropic-ai/vertex-sdk' --external '@anthropic-ai/mcpb' --external '@aws-sdk/client-bedrock-runtime' --external 'google-auth-library' --external 'sharp' --external 'asciichart' --external 'audio-capture-napi' --external 'modifiers-napi' --external '@xenova/transformers' --external 'onnxruntime-node' --external playwright --external 'playwright-core' --external 'node-pty' && mkdir -p dist/generated && cp src/generated/version.json dist/generated/",
29
+ "dev": "bun run prebuild-version && node scripts/bun-run.mjs --watch",
30
+ "start": "bun run prebuild-version && node scripts/bun-run.mjs",
31
+ "dev:channels": "bun run prebuild-version && node scripts/bun-run.mjs -- --dangerously-load-development-channels server:clew-orc",
32
+ "build": "bun run prebuild-version && NODE_ENV=production bun build --production --define.TRANSCRIPT_CLASSIFIER=true --define.CHICAGO_MCP=true --define.VOICE_MODE=true src/main.tsx --outdir ./dist --target bun --external electron --external 'chromium-bidi*' --external '@ant/claude-for-chrome-mcp' --external '@anthropic-ai/bedrock-sdk' --external '@anthropic-ai/foundry-sdk' --external '@anthropic-ai/vertex-sdk' --external '@anthropic-ai/mcpb' --external '@aws-sdk/client-bedrock-runtime' --external 'google-auth-library' --external 'sharp' --external 'asciichart' --external 'audio-capture-napi' --external 'modifiers-napi' --external '@xenova/transformers' --external 'onnxruntime-node' --external playwright --external 'playwright-core' --external 'node-pty' && node scripts/postbuild-inject-macro.mjs",
33
33
  "prepublishOnly": "bun run build",
34
34
  "test": "bun test",
35
35
  "lint": "biome lint --write src/",
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Bun runner — injects MACRO global via Bun's --define and runs main.tsx.
3
+ *
4
+ * Uses `--define MACRO:JSON_OBJECT` syntax where the value is parsed as JSON.
5
+ * This replaces bare `MACRO` identifier in all modules at transpile time,
6
+ * making MACRO.VERSION etc. work in dev mode without post-build injection.
7
+ */
8
+ import { spawn } from 'node:child_process';
9
+ import { readFileSync } from 'node:fs';
10
+ import { fileURLToPath } from 'node:url';
11
+ import { dirname, join } from 'node:path';
12
+
13
+ const __dirname = dirname(fileURLToPath(import.meta.url));
14
+ const root = dirname(__dirname);
15
+ const pkg = JSON.parse(readFileSync(join(root, 'package.json'), 'utf-8'));
16
+
17
+ const extraArgs = process.argv.slice(2);
18
+ const isWatch = extraArgs[0] === '--watch';
19
+ if (isWatch) extraArgs.shift();
20
+
21
+ const macroJson = JSON.stringify({
22
+ VERSION: pkg.version,
23
+ PACKAGE_URL: 'clew-code',
24
+ FEEDBACK_CHANNEL: 'https://github.com/ClewCode/ClewCode/issues',
25
+ ISSUES_EXPLAINER: 'visit https://github.com/ClewCode/ClewCode/issues',
26
+ });
27
+
28
+ const args = ['run', '--define', `MACRO:${macroJson}`];
29
+ if (isWatch) args.push('--watch');
30
+ args.push(join(root, 'src/main.tsx'), ...extraArgs);
31
+
32
+ const child = spawn('bun', args, { stdio: 'inherit', cwd: root });
33
+ child.on('exit', (code) => process.exit(code ?? 1));
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Post-build script: injects global `var MACRO` declaration into the bundled
3
+ * output so code that references the bare `MACRO` identifier works at runtime.
4
+ *
5
+ * main.tsx already sets `globalThis.MACRO` from generated/version.json, but
6
+ * bundled modules reference the bare `MACRO` identifier (intended for Bun's
7
+ * --define). Without --define, the identifier is undefined in module scope.
8
+ *
9
+ * This script prepends `var MACRO;` right before the bundle starts so the
10
+ * module scope finds `MACRO` on globalThis via the fallback chain.
11
+ */
12
+
13
+ import { readFileSync, writeFileSync } from 'node:fs';
14
+ import { dirname, join } from 'node:path';
15
+ import { fileURLToPath } from 'node:url';
16
+
17
+ const __dirname = dirname(fileURLToPath(import.meta.url));
18
+ const root = dirname(__dirname);
19
+
20
+ const pkg = JSON.parse(readFileSync(join(root, 'package.json'), 'utf-8'));
21
+ const bundlePath = join(root, 'dist', 'main.js');
22
+
23
+ // Inject MACRO with actual values so bundled modules that reference the bare
24
+ // `MACRO` identifier (intended for Bun's --define) work at runtime without
25
+ // --define flags.
26
+ const preamble = `var MACRO={VERSION:"${pkg.version}",PACKAGE_URL:"clew-code",FEEDBACK_CHANNEL:"https://github.com/ClewCode/ClewCode/issues",ISSUES_EXPLAINER:"visit https://github.com/ClewCode/ClewCode/issues"};\n`;
27
+
28
+ const original = readFileSync(bundlePath, 'utf-8');
29
+
30
+ // Only inject if not already present
31
+ if (!original.startsWith('var MACRO=') && !original.startsWith('var MACRO;')) {
32
+ writeFileSync(bundlePath, preamble + original, 'utf-8');
33
+ console.log(`[postbuild] Injected var MACRO (version: ${pkg.version})`);
34
+ } else {
35
+ console.log('[postbuild] var MACRO already present, skipping');
36
+ }
package/docs/.nojekyll DELETED
File without changes
package/docs/_config.yml DELETED
@@ -1,3 +0,0 @@
1
- title: Clew Code Documentation
2
- description: Multi-provider AI CLI with extensible plugin architecture
3
- show_downloads: false
@@ -1,90 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Architecture — Clew Code</title>
7
- <meta name="description" href="Codebase architecture of Clew Code.">
8
- <link rel="icon" type="image/svg+xml" href="assets/clew.svg">
9
- <link rel="preconnect" href="https://fonts.googleapis.com">
10
- <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
11
- <link rel="stylesheet" href="css/styles.css">
12
- </head>
13
- <body>
14
- <header class="header"></header>
15
- <div id="sidebarOverlay" class="sidebar-overlay"></div>
16
- <aside id="sidebar" class="sidebar"></aside>
17
-
18
- <div class="content-wrap">
19
- <div class="content">
20
-
21
- <div class="breadcrumbs"><a href="index.html">Home</a><span class="sep">/</span><span class="current">Architecture</span></div>
22
-
23
- <h1>Architecture</h1>
24
- <p class="sub">Clew Code is a single-entry Bun bundle built with TypeScript (ESM, strict mode).</p>
25
-
26
- <h2 id="layers">Layer Overview</h2>
27
- <p>The architecture is layered: CLI entrypoint → Orchestrator → Context/Tools/Policy/Provider → Session logger.</p>
28
-
29
- <pre><code>CLI (parseArgs)
30
-
31
- Orchestrator (Agent loop)
32
-
33
- Context ── Tools ── Policy ── Provider
34
-
35
- Session Logger
36
- </code></pre>
37
-
38
- <h2 id="sourcelayout">Source Layout</h2>
39
- <pre><code>src/
40
- ├── main.tsx # Entry point
41
- ├── query.ts / QueryEngine.ts
42
- ├── agentRuntime/ # Background agent orchestration
43
- ├── commands/ # Slash command implementations
44
- ├── tools/ # 50+ built-in tools
45
- ├── services/
46
- │ ├── ai/ # Provider manager + 27 providers
47
- │ ├── mcp/ # MCP client + auth + transports
48
- │ ├── plugins/ # Plugin hooks + marketplace
49
- │ ├── autonomous/ # Agent loop + task queue + cron
50
- │ ├── lsp/ # LSP integration
51
- │ └── Supervisor/ # Agent supervisor IPC
52
- ├── peer/ # PeerServer + PeerDiscovery
53
- ├── bridge/ # WebSocket bridge + relay
54
- ├── components/ # Ink terminal UI components
55
- ├── state/ # AppState management
56
- └── hooks/ # React hooks
57
- </code></pre>
58
-
59
- <h2 id="execution-layers">Execution Layers</h2>
60
- <p>Clew Code has several agent execution layers:</p>
61
-
62
- <table>
63
- <thead>
64
- <tr><th>Layer</th><th>Duration</th><th>Use Case</th></tr>
65
- </thead>
66
- <tbody>
67
- <tr><td>Agent</td><td>Session-long</td><td>Main chat, custom agents in <code>.clew/agents/*.md</code></td></tr>
68
- <tr><td>Subagent</td><td>One-shot</td><td>Explore codebase, test triage, review</td></tr>
69
- <tr><td>Teammate/Swarm</td><td>Multi-turn</td><td>Coordinated long-running agent teams</td></tr>
70
- <tr><td>LAN Peer</td><td>Persistent</td><td>Cross-machine coordination via <code>/peer</code></td></tr>
71
- <tr><td>Process Peer</td><td>One-shot</td><td>External CLI workers (Codex exec/pty)</td></tr>
72
- </tbody>
73
- </table>
74
-
75
- <h2 id="key-concepts">Key Concepts</h2>
76
-
77
- <h3>Multi-Pass Compaction</h3>
78
- <p>Automatic chunk-based context compression with recursive re-compaction when context exceeds the model window. Trigger manually with <code>/compact</code>.</p>
79
-
80
- <h3>Plan Mode</h3>
81
- <p>Full-access planning mode with bypass permissions. Plans persist to <code>.clew/plans/</code> with progress snapshots.</p>
82
-
83
- <h3>Provider Manager</h3>
84
- <p>The ProviderManager routes all LLM calls through a unified interface. Each provider has an adapter that normalizes requests and responses. The provider can be switched mid-session via <code>/model</code>.</p>
85
- </div>
86
- </div>
87
-
88
- <script src="js/main.js"></script>
89
- </body>
90
- </html>
Binary file
Binary file
@@ -1,33 +0,0 @@
1
- <svg width="180" height="231" viewBox="0 0 190 231" role="img" xmlns="http://www.w3.org/2000/svg" style="margin: 2rem auto; image-rendering: crisp-edges; background: transparent;">
2
- <title>Clawd one big eye</title>
3
-
4
- <!-- HORNS -->
5
- <rect fill="#8b5cf6" x="45" y="0" width="15" height="15"/>
6
- <rect fill="#8b5cf6" x="120" y="0" width="15" height="15"/>
7
-
8
- <!-- HEAD top row -->
9
- <rect fill="#8b5cf6" x="30" y="15" width="120" height="15"/>
10
-
11
- <!-- HEAD eye rows (2 rows tall): full purple bg, then big black eye -->
12
- <rect fill="#8b5cf6" x="30" y="30" width="120" height="30"/>
13
- <!-- big eye: 6 cells wide (90px), 2 rows tall (30px), centered: x=30+(120-90)/2=45 -->
14
- <rect fill="#000000" x="45" y="30" width="90" height="30"/>
15
-
16
- <!-- HEAD bottom row -->
17
- <rect fill="#8b5cf6" x="30" y="60" width="120" height="15"/>
18
-
19
- <!-- ARMS -->
20
- <rect fill="#8b5cf6" x="0" y="75" width="180" height="15"/>
21
- <rect fill="#8b5cf6" x="0" y="90" width="180" height="15"/>
22
-
23
- <!-- BODY -->
24
- <rect fill="#8b5cf6" x="30" y="105" width="120" height="15"/>
25
- <rect fill="#8b5cf6" x="30" y="120" width="120" height="15"/>
26
-
27
- <!-- LEGS -->
28
- <rect fill="#8b5cf6" x="30" y="135" width="15" height="45"/>
29
- <rect fill="#8b5cf6" x="60" y="135" width="15" height="45"/>
30
- <rect fill="#8b5cf6" x="105" y="135" width="15" height="45"/>
31
- <rect fill="#8b5cf6" x="135" y="135" width="15" height="45"/>
32
-
33
- </svg>
@@ -1,141 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Changelog — Clew Code</title>
7
- <meta name="description" content="Release history and changelog for Clew Code.">
8
- <link rel="icon" type="image/svg+xml" href="assets/clew.svg">
9
- <link rel="preconnect" href="https://fonts.googleapis.com">
10
- <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
11
- <link rel="stylesheet" href="css/styles.css">
12
- </head>
13
- <body>
14
- <header class="header"></header>
15
- <div id="sidebarOverlay" class="sidebar-overlay"></div>
16
- <aside id="sidebar" class="sidebar"></aside>
17
-
18
- <div class="content-wrap">
19
- <div class="content">
20
-
21
- <div class="breadcrumbs"><a href="index.html">Home</a><span class="sep">/</span><span class="current">Changelog</span></div>
22
-
23
- <h1>Changelog</h1>
24
-
25
- <h2 id="0.2.21">v0.2.21 — 2026-06-14</h2>
26
- <h3>Fixed</h3>
27
- <ul>
28
- <li><strong>Detect package manager from install path</strong> — now correctly detects whether to use <code>bun</code> or <code>npm</code> based on the installation path, not the runtime.</li>
29
- <li><strong>Polish UI rendering</strong> — fixed empty-state edge cases and visual glitches.</li>
30
- </ul>
31
-
32
- <h2 id="0.2.20">v0.2.20 — 2026-06-14</h2>
33
- <h3>Fixed</h3>
34
- <ul>
35
- <li><strong>peer-spawn</strong> — spawn <code>cmd.exe</code> directly with <code>/k</code> and set title inside command instead of using <code>start</code>.</li>
36
- <li><strong>peer-spawn cd fix</strong> — execute <code>cd</code> before running clew command to bypass cmd.exe quote stripping.</li>
37
- </ul>
38
-
39
- <h2 id="0.2.16">v0.2.16 — 2026-06-14</h2>
40
- <h3>Fixed</h3>
41
- <ul>
42
- <li><strong>Auto-relaunch after update</strong> — <code>UpdateDialog.startInstall()</code> now spawns a detached child process immediately after install completes. No more manual restart required.</li>
43
- </ul>
44
-
45
- <h2 id="0.2.15">v0.2.15 — 2026-06-14</h2>
46
-
47
- <h2 id="0.2.14">v0.2.14 — 2026-06-14</h2>
48
- <h3>Added</h3>
49
- <ul>
50
- <li><strong>Peer task queue system</strong> — queuing commands when busy with priority levels, auto-dequeue, SSE queue events.</li>
51
- <li><strong>Peer health monitoring</strong> — healthy/lagging/offline states, latency tracking.</li>
52
- <li><strong>Long-term memory system</strong> — auto-extraction, session consolidation, cross-session history, timeline queries.</li>
53
- <li><strong>Gemini Code Assist provider</strong> — OAuth-based provider integration.</li>
54
- <li><strong>Dashboard Monitor</strong> — real-time agent and daemon monitoring with tabbed views.</li>
55
- </ul>
56
- <h3>Changed</h3>
57
- <ul>
58
- <li><strong>peer naming reverted</strong> — the peer-facing command family stays on <code>/peer</code>.</li>
59
- </ul>
60
-
61
- <h2 id="0.2.13">v0.2.13 — 2026-06-13</h2>
62
- <h3>Changed</h3>
63
- <ul>
64
- <li>Formatting pass across codebase via Biome.</li>
65
- <li>bun.lock synchronized with updated dependencies.</li>
66
- </ul>
67
-
68
- <h2 id="0.2.12">v0.2.12 — 2026-06-13</h2>
69
- <h3>Added</h3>
70
- <ul>
71
- <li><strong>Provider consolidation</strong> — GoogleProvider and ClewGatewayProvider now extend OpenAICompatibleProvider, removing 679 lines of duplicated code.</li>
72
- <li>Zod v4 migration (<code>.passthrough()</code> → <code>.loose()</code>).</li>
73
- <li>PR command refactored to use <code>--json</code> + <code>JSON.parse</code>.</li>
74
- </ul>
75
-
76
- <h2 id="0.2.11">v0.2.11 — 2026-06-13</h2>
77
- <h3>Added</h3>
78
- <ul>
79
- <li>Further peer system refinements.</li>
80
- <li>Bug fixes and performance improvements.</li>
81
- </ul>
82
-
83
- <h2 id="0.2.7">v0.2.7 — 2026-06-11</h2>
84
- <h3>Added</h3>
85
- <ul>
86
- <li><strong>process_peer PTY terminal box</strong> — terminal-style progress box with ANSI-preserving output tail.</li>
87
- <li><strong><code>/peer run codex &lt;task&gt;</code></strong> — one-shot Codex process peer from chat.</li>
88
- <li><strong>Auto-update dialog</strong> — npm update notification before app starts.</li>
89
- <li><strong>Rich model fetching</strong> — API models now carry context window, vision, tools, reasoning, free tags.</li>
90
- <li><strong><code>/model list</code> capability tags</strong> — <code>[200K ctx, vision, tools, reason, free]</code> per model.</li>
91
- <li><strong>Cost in status line</strong> — shows session cost when &gt;$0.</li>
92
- </ul>
93
-
94
- <h2 id="0.2.6">v0.2.6 — 2026-06-10</h2>
95
- <h3>Added</h3>
96
- <ul>
97
- <li><strong>Peer HTTP heartbeat</strong> — 60s liveness checks, offline peers detected immediately.</li>
98
- <li><strong><code>/agents</code> visual polish</strong> — redesigned dashboard.</li>
99
- <li><strong>Auto-updater</strong> — switched from Anthropic GCS to npm registry.</li>
100
- </ul>
101
- <h3>Removed</h3>
102
- <ul>
103
- <li>GitHub Copilot provider and all references cleaned out.</li>
104
- </ul>
105
-
106
- <h2 id="0.2.5">v0.2.5 — 2026-06-10</h2>
107
- <h3>Added</h3>
108
- <ul>
109
- <li><strong>Rebranded to Clew Code</strong> — docs, UI copy, and package updated.</li>
110
- <li><strong>Memory search</strong> — <code>/memory search</code> for stored entries.</li>
111
- <li><strong>Peer tools</strong> — 14 AI coordination tools, peer help, connection count in footer.</li>
112
- </ul>
113
-
114
- <h2 id="0.2.4">v0.2.4 — 2026-06-08</h2>
115
- <h3>Added</h3>
116
- <ul>
117
- <li><strong>Peer-to-peer</strong> — UDP multicast discovery, file registry, 14 AI coordination tools, interactive PeerMenu.</li>
118
- <li><strong>Autonomous agents</strong> — agent loop, supervisor integration, task queue, Loop Lock.</li>
119
- <li><strong>Workflow Rainbow</strong> — per-character gradient highlight for "workflow" keyword.</li>
120
- </ul>
121
-
122
- <h2 id="0.2.3">v0.2.3 — 2026-06-07</h2>
123
- <h3>Added</h3>
124
- <ul>
125
- <li><code>/effort</code> works with any provider exposing <code>reasoningEffort</code>.</li>
126
- <li><code>/model</code> fetches live model list from provider APIs.</li>
127
- <li>Relay server for cross-network remote control.</li>
128
- <li>Bridge v2: provider-agnostic remote control.</li>
129
- <li><code>/pr create/list/view/review/merge/status</code>.</li>
130
- <li>Security: PowerShell rules, malformed tool call guard, 100 MB bash output cap.</li>
131
- </ul>
132
-
133
- <p><a href="https://github.com/ClewCode/ClewCode/blob/main/CHANGELOG.md">View full changelog on GitHub →</a></p>
134
- </div>
135
- </div>
136
-
137
- <script src="js/main.js"></script>
138
- </body>
139
- </html>
140
-
141
-
@@ -1,89 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>CLI Reference — Clew Code</title>
7
- <meta name="description" content="Command-line interface reference for Clew Code.">
8
- <link rel="icon" type="image/svg+xml" href="assets/clew.svg">
9
- <link rel="preconnect" href="https://fonts.googleapis.com">
10
- <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
11
- <link rel="stylesheet" href="css/styles.css">
12
- </head>
13
- <body>
14
- <header class="header"></header>
15
- <div id="sidebarOverlay" class="sidebar-overlay"></div>
16
- <aside id="sidebar" class="sidebar"></aside>
17
-
18
- <div class="content-wrap">
19
- <div class="content">
20
-
21
- <div class="breadcrumbs"><a href="index.html">Home</a><span class="sep">/</span><span class="current">CLI Reference</span></div>
22
-
23
- <h1>CLI Reference</h1>
24
- <p class="sub">Complete reference for Clew Code command-line flags and arguments.</p>
25
-
26
- <h2 id="usage">Usage</h2>
27
- <pre><code class="language-bash">clew [flags]
28
- clew [command] [flags]
29
- </code></pre>
30
-
31
- <h2 id="global">Global Flags</h2>
32
- <table>
33
- <thead>
34
- <tr><th>Flag</th><th>Description</th></tr>
35
- </thead>
36
- <tbody>
37
- <tr><td><code>-p, --prompt &lt;text&gt;</code></td><td>One-shot mode: run a prompt in non-interactive mode and exit</td></tr>
38
- <tr><td><code>--resume &lt;id&gt;</code></td><td>Resume a previous session by ID. Use <code>last</code> for the most recent session</td></tr>
39
- <tr><td><code>--version</code></td><td>Print version and exit</td></tr>
40
- <tr><td><code>--help</code></td><td>Show help message</td></tr>
41
- </tbody>
42
- </table>
43
-
44
- <h2 id="exec">Exec Commands</h2>
45
- <table>
46
- <thead>
47
- <tr><th>Command</th><th>Description</th></tr>
48
- </thead>
49
- <tbody>
50
- <tr><td><code>clew . &lt;prompt&gt;</code></td><td>Run prompt in current directory</td></tr>
51
- </tbody>
52
- </table>
53
-
54
- <h2 id="env">Environment Variables</h2>
55
- <table>
56
- <thead>
57
- <tr><th>Variable</th><th>Description</th></tr>
58
- </thead>
59
- <tbody>
60
- <tr><td><code>ANTHROPIC_API_KEY</code></td><td>Anthropic Claude API key</td></tr>
61
- <tr><td><code>OPENAI_API_KEY</code></td><td>OpenAI API key</td></tr>
62
- <tr><td><code>GOOGLE_API_KEY</code></td><td>Google Gemini API key</td></tr>
63
- <tr><td><code>DEEPSEEK_API_KEY</code></td><td>DeepSeek API key</td></tr>
64
- <tr><td><code>GROQ_API_KEY</code></td><td>Groq API key</td></tr>
65
- <tr><td><code>MISTRAL_API_KEY</code></td><td>Mistral API key</td></tr>
66
- <tr><td><code>OPENROUTER_API_KEY</code></td><td>OpenRouter API key</td></tr>
67
- <tr><td><code>OLLAMA_HOST</code></td><td>Ollama server URL (default: http://localhost:11434)</td></tr>
68
- <tr><td><code>SEARXNG_URL</code></td><td>SearXNG instance URL</td></tr>
69
- <tr><td><code>SENTRY_DSN</code></td><td>Sentry DSN for error tracking</td></tr>
70
- <tr><td><code>GROWTHBOOK_API_KEY</code></td><td>GrowthBook API key for feature flags</td></tr>
71
- </tbody>
72
- </table>
73
-
74
- <h2 id="exit-codes">Exit Codes</h2>
75
- <table>
76
- <thead>
77
- <tr><th>Code</th><th>Meaning</th></tr>
78
- </thead>
79
- <tbody>
80
- <tr><td><code>0</code></td><td>Success</td></tr>
81
- <tr><td><code>1</code></td><td>General error</td></tr>
82
- </tbody>
83
- </table>
84
- </div>
85
- </div>
86
-
87
- <script src="js/main.js"></script>
88
- </body>
89
- </html>
@@ -1,161 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Commands — Clew Code</title>
7
- <meta name="description" href="All slash commands available in Clew Code.">
8
- <link rel="icon" type="image/svg+xml" href="assets/clew.svg">
9
- <link rel="preconnect" href="https://fonts.googleapis.com">
10
- <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
11
- <link rel="stylesheet" href="css/styles.css">
12
- </head>
13
- <body>
14
- <header class="header"></header>
15
- <div id="sidebarOverlay" class="sidebar-overlay"></div>
16
- <aside id="sidebar" class="sidebar"></aside>
17
-
18
- <div class="content-wrap">
19
- <div class="content">
20
-
21
- <div class="breadcrumbs"><a href="index.html">Home</a><span class="sep">/</span><span class="current">Commands</span></div>
22
-
23
- <h1>Commands</h1>
24
- <p class="sub">Clew Code provides 35+ slash commands for managing providers, sessions, peer networking, MCP, plugins, and more.</p>
25
-
26
- <h2 id="session">Session Commands</h2>
27
- <table>
28
- <thead>
29
- <tr><th>Command</th><th>Description</th></tr>
30
- </thead>
31
- <tbody>
32
- <tr><td><code>/status</code></td><td>Show current provider, model, session, and context info</td></tr>
33
- <tr><td><code>/doctor</code></td><td>Run system diagnostics</td></tr>
34
- <tr><td><code>/context</code></td><td>Show active context usage breakdown</td></tr>
35
- <tr><td><code>/compact</code></td><td>Compress conversation history (multi-pass compaction)</td></tr>
36
- <tr><td><code>/clear</code></td><td>Clear conversation or caches</td></tr>
37
- <tr><td><code>/exit</code></td><td>Exit the REPL</td></tr>
38
- <tr><td><code>/help</code></td><td>List all available commands</td></tr>
39
- <tr><td><code>/resume</code></td><td>Resume a previous session</td></tr>
40
- <tr><td><code>/profile</code></td><td>Switch between <strong>coding</strong> and <strong>personal</strong> profiles. Personal profile turns Clew into a personal AI control center with delegation, memory-driven learning, and skill creation. See <a href="personal-profile.html">Personal Profile</a>.</td></tr>
41
- <tr><td><code>/maxmode on|off|candidates N</code></td><td>Toggle Max Mode — parallel N candidates via LLM judge</td></tr>
42
- </tbody>
43
- </table>
44
-
45
- <h2 id="provider">Provider &amp; Model Commands</h2>
46
- <table>
47
- <thead>
48
- <tr><th>Command</th><th>Description</th></tr>
49
- </thead>
50
- <tbody>
51
- <tr><td><code>/model</code></td><td>Switch provider or model. Use <code>/model list</code> to see available models</td></tr>
52
- <tr><td><code>/effort</code></td><td>Set reasoning effort (low/medium/high) for supported providers</td></tr>
53
- <tr><td><code>/fast</code></td><td>Toggle fast/turbo mode</td></tr>
54
- </tbody>
55
- </table>
56
-
57
- <h2 id="peer">Peer &amp; Networking Commands</h2>
58
- <table>
59
- <thead>
60
- <tr><th>Command</th><th>Description</th></tr>
61
- </thead>
62
- <tbody>
63
- <tr><td><code>/peer discover</code></td><td>Find other Clew instances on the LAN</td></tr>
64
- <tr><td><code>/peer share</code></td><td>Share this instance as a worker</td></tr>
65
- <tr><td><code>/peer run &lt;peer&gt; &lt;cmd&gt;</code></td><td>Run a command on a remote peer</td></tr>
66
- <tr><td><code>/peer send &lt;peer&gt; &lt;msg&gt;</code></td><td>Send a message to a peer</td></tr>
67
- <tr><td><code>/peer list</code></td><td>List discovered peers</td></tr>
68
- <tr><td><code>/peer info &lt;peer&gt;</code></td><td>Show peer details</td></tr>
69
- <tr><td><code>/peer help</code></td><td>Peer command reference</td></tr>
70
- </tbody>
71
- </table>
72
-
73
- <h2 id="mcp">MCP Commands</h2>
74
- <table>
75
- <thead>
76
- <tr><th>Command</th><th>Description</th></tr>
77
- </thead>
78
- <tbody>
79
- <tr><td><code>/mcp list</code></td><td>List connected MCP servers and tools</td></tr>
80
- <tr><td><code>/mcp add</code></td><td>Add an MCP server configuration</td></tr>
81
- <tr><td><code>/mcp remove</code></td><td>Remove an MCP server</td></tr>
82
- </tbody>
83
- </table>
84
-
85
- <h2 id="code">Code &amp; Review Commands</h2>
86
- <table>
87
- <thead>
88
- <tr><th>Command</th><th>Description</th></tr>
89
- </thead>
90
- <tbody>
91
- <tr><td><code>/code-review</code></td><td>Review changed files for bugs</td></tr>
92
- <tr><td><code>/simplify</code></td><td>Cleanup-focused code review</td></tr>
93
- <tr><td><code>/pr</code></td><td>PR management (create/list/view/review/merge/status)</td></tr>
94
- <tr><td><code>/diff</code></td><td>Show git diff</td></tr>
95
- </tbody>
96
- </table>
97
-
98
- <h2 id="plugin">Plugin &amp; Extension Commands</h2>
99
- <table>
100
- <thead>
101
- <tr><th>Command</th><th>Description</th></tr>
102
- </thead>
103
- <tbody>
104
- <tr><td><code>/plugin</code></td><td>Plugin and hook management (install, list, remove)</td></tr>
105
- <tr><td><code>/skills</code></td><td>List and manage skills</td></tr>
106
- <tr><td><code>/hooks</code></td><td>View active hooks</td></tr>
107
- </tbody>
108
- </table>
109
-
110
- <h2 id="autonomous">Autonomous &amp; Agent Commands</h2>
111
- <table>
112
- <thead>
113
- <tr><th>Command</th><th>Description</th></tr>
114
- </thead>
115
- <tbody>
116
- <tr><td><code>/loop</code></td><td>24/7 autonomous agent loop (start, stop, status)</td></tr>
117
- <tr><td><code>/daemon</code></td><td>Autonomous daemon dashboard</td></tr>
118
- <tr><td><code>/task</code></td><td>Manage scheduled tasks</td></tr>
119
- <tr><td><code>/agent</code></td><td>Background agent dispatch and subcommands</td></tr>
120
- <tr><td><code>/agents</code></td><td>Agent dashboard (TUI operational view)</td></tr>
121
- </tbody>
122
- </table>
123
-
124
- <h2 id="memory">Memory Commands</h2>
125
- <table>
126
- <thead>
127
- <tr><th>Command</th><th>Description</th></tr>
128
- </thead>
129
- <tbody>
130
- <tr><td><code>/memory save</code></td><td>Save session summary to long-term memory</td></tr>
131
- <tr><td><code>/memory timeline</code></td><td>Show chronological session history</td></tr>
132
- <tr><td><code>/memory stats</code></td><td>Activity density chart</td></tr>
133
- <tr><td><code>/memory digest</code></td><td>Show weekly/monthly digests</td></tr>
134
- <tr><td><code>/memory search</code></td><td>Search stored memory entries</td></tr>
135
- <tr><td><code>/maxmode on|off|candidates N</code></td><td>Toggle Max Mode — parallel candidate selection via LLM judge</td></tr>
136
- </tbody>
137
- </table>
138
-
139
- <h2 id="other">Other Commands</h2>
140
- <table>
141
- <thead>
142
- <tr><th>Command</th><th>Description</th></tr>
143
- </thead>
144
- <tbody>
145
- <tr><td><code>/remote</code></td><td>WebSocket remote control (listen, connect, token)</td></tr>
146
- <tr><td><code>/bridge</code></td><td>Bridge mode configuration</td></tr>
147
- <tr><td><code>/config</code></td><td>Open configuration panel</td></tr>
148
- <tr><td><code>/theme</code></td><td>Switch theme</td></tr>
149
- <tr><td><code>/mode</code></td><td>Switch execution mode — safe, yolo, afk, review-only, browser-safe</td></tr>
150
- <tr><td><code>/permissions</code></td><td>Change permission mode</td></tr>
151
- <tr><td><code>/export</code></td><td>Export session</td></tr>
152
- <tr><td><code>/recap</code></td><td>Session recap</td></tr>
153
- </tbody>
154
- </table>
155
- </div>
156
- </div>
157
-
158
- <script src="js/main.js"></script>
159
- </body>
160
- </html>
161
-