clew-code 0.2.4 → 0.2.5
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 +264 -292
- package/dist/clew-dev.js +5118 -2840
- package/dist/main.js +2358 -2133
- package/docs/_config.yml +1 -1
- package/docs/architecture.html +145 -166
- package/docs/architecture.th.html +2 -23
- package/docs/commands.html +1 -22
- package/docs/commands.th.html +1 -22
- package/docs/configuration.html +145 -166
- package/docs/configuration.th.html +2 -23
- package/docs/css/styles.css +22 -0
- package/docs/daemon.html +128 -160
- package/docs/daemon.th.html +2 -30
- package/docs/features/bridge-mode.html +98 -98
- package/docs/features/bridge-mode.th.html +1 -1
- package/docs/features/evals.html +181 -181
- package/docs/features/evals.th.html +1 -1
- package/docs/features/searxng-search.html +150 -150
- package/docs/features/searxng-search.th.html +1 -1
- package/docs/features/sentry-setup.html +156 -156
- package/docs/features/sentry-setup.th.html +1 -1
- package/docs/index.html +298 -333
- package/docs/index.th.html +1 -36
- package/docs/installation.html +103 -124
- package/docs/installation.th.html +2 -23
- package/docs/internals/growthbook-ab-testing.html +112 -112
- package/docs/internals/growthbook-ab-testing.th.html +1 -1
- package/docs/internals/hidden-features.html +147 -147
- package/docs/internals/hidden-features.th.html +1 -1
- package/docs/js/main.js +78 -7
- package/docs/loop.html +180 -0
- package/docs/loop.th.html +226 -0
- package/docs/mcp.html +246 -157
- package/docs/mcp.th.html +156 -60
- package/docs/models.html +1 -22
- package/docs/models.th.html +1 -22
- package/docs/peer.html +235 -0
- package/docs/peer.th.html +279 -0
- package/docs/permission-model.html +101 -122
- package/docs/permission-model.th.html +2 -23
- package/docs/plugins.html +101 -122
- package/docs/plugins.th.html +2 -23
- package/docs/providers.html +117 -138
- package/docs/providers.th.html +2 -23
- package/docs/quick-start.html +92 -120
- package/docs/quick-start.th.html +1 -29
- package/docs/research-memory.html +79 -111
- package/docs/research-memory.th.html +2 -30
- package/docs/skills.html +116 -137
- package/docs/skills.th.html +2 -23
- package/docs/taste.html +96 -29
- package/docs/taste.th.html +193 -54
- package/docs/tools.html +169 -190
- package/docs/tools.th.html +2 -23
- package/docs/troubleshooting.html +105 -126
- package/docs/troubleshooting.th.html +2 -23
- package/package.json +2 -2
package/docs/plugins.html
CHANGED
|
@@ -1,122 +1,101 @@
|
|
|
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>Plugins — Clew</title>
|
|
7
|
-
<meta name="description" content="Extend Clew with plugins — commands, agents, skills, hooks, MCP servers, and marketplace support.">
|
|
8
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
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
|
-
<link rel="icon" type="image/svg+xml" href="./assets/clew.svg">
|
|
13
|
-
</head>
|
|
14
|
-
<body>
|
|
15
|
-
<header class="header"
|
|
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
|
-
<h2>
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<tr><
|
|
61
|
-
<tr><td><code>
|
|
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
|
-
skills/ # Reusable task instructions
|
|
103
|
-
agents/ # Agent configurations
|
|
104
|
-
hooks/ # Hook implementations</code></pre>
|
|
105
|
-
|
|
106
|
-
<h2>Marketplace</h2>
|
|
107
|
-
<p>Plugins can be distributed through marketplaces. The <code>marketplaceManager</code> (<code>src/utils/plugins/marketplaceManager.ts</code>) handles marketplace source discovery, cache management, and plugin installation from remote sources.</p>
|
|
108
|
-
|
|
109
|
-
<footer class="footer">
|
|
110
|
-
<span>Clew v0.1.2 — Open Source</span>
|
|
111
|
-
<div class="footer-links">
|
|
112
|
-
<a href="https://github.com/JonusNattapong/ClewCode">GitHub</a>
|
|
113
|
-
<a href="https://github.com/JonusNattapong/ClewCode/issues">Issues</a>
|
|
114
|
-
</div>
|
|
115
|
-
</footer>
|
|
116
|
-
</main>
|
|
117
|
-
<nav class="toc-sidebar"></nav>
|
|
118
|
-
</div>
|
|
119
|
-
</div>
|
|
120
|
-
<script src="js/main.js"></script>
|
|
121
|
-
</body>
|
|
122
|
-
</html>
|
|
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>Plugins — Clew</title>
|
|
7
|
+
<meta name="description" content="Extend Clew with plugins — commands, agents, skills, hooks, MCP servers, and marketplace support.">
|
|
8
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
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
|
+
<link rel="icon" type="image/svg+xml" href="./assets/clew.svg">
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<header class="header"></header>
|
|
16
|
+
<div class="app"><aside class="sidebar" id="sidebar"></aside><div class="sidebar-overlay" id="sidebarOverlay"></div>
|
|
17
|
+
<div class="content-wrap"><main class="content">
|
|
18
|
+
<div class="breadcrumbs"><a href="index.html">Home</a><span class="sep">/</span><span>Plugins</span></div>
|
|
19
|
+
<h1>Plugins</h1>
|
|
20
|
+
<p class="section-subtitle">Plugins extend Clew with custom commands, agents, skills, execution hooks, MCP servers, and LSP integrations. Plugin management is handled by <code>src/services/plugins/</code> and <code>src/utils/plugins/</code>.</p>
|
|
21
|
+
|
|
22
|
+
<h2>What Plugins Can Provide</h2>
|
|
23
|
+
<table>
|
|
24
|
+
<tr><th>Extension</th><th>Description</th></tr>
|
|
25
|
+
<tr><td>Slash Commands</td><td>Custom <code>/command</code> implementations registered via plugin manifest</td></tr>
|
|
26
|
+
<tr><td>Agents</td><td>Specialized agent configurations with custom prompts and tool access</td></tr>
|
|
27
|
+
<tr><td>Skills</td><td>Reusable task instructions from plugin skill directories</td></tr>
|
|
28
|
+
<tr><td>Execution Hooks</td><td>Pre/post hooks at tool, bash, prompt, and edit stages</td></tr>
|
|
29
|
+
<tr><td>MCP Servers</td><td>Model Context Protocol server definitions bundled with the plugin</td></tr>
|
|
30
|
+
<tr><td>LSP Servers</td><td>Language Server Protocol integration</td></tr>
|
|
31
|
+
</table>
|
|
32
|
+
|
|
33
|
+
<h2>Hook System</h2>
|
|
34
|
+
<table>
|
|
35
|
+
<tr><th>Hook Point</th><th>When It Fires</th></tr>
|
|
36
|
+
<tr><td><code>PreToolUse</code></td><td>Before a tool executes — validation, input modification, logging</td></tr>
|
|
37
|
+
<tr><td><code>PostToolUse</code></td><td>After a tool completes — result transformation, audit</td></tr>
|
|
38
|
+
<tr><td><code>PreBash</code></td><td>Before shell command execution — sanitization, env injection</td></tr>
|
|
39
|
+
<tr><td><code>PostPrompt</code></td><td>After prompt construction — context augmentation</td></tr>
|
|
40
|
+
<tr><td><code>PreAcceptEdit</code></td><td>Before accepting an edit — validation, policy enforcement</td></tr>
|
|
41
|
+
</table>
|
|
42
|
+
|
|
43
|
+
<h2>Plugin Management</h2>
|
|
44
|
+
<pre><code>/plugin # List installed plugins
|
|
45
|
+
/plugin-details # Show detailed plugin information
|
|
46
|
+
/reload-plugins # Activate pending plugin changes
|
|
47
|
+
claude plugin validate /path # Validate a plugin manifest (CLI)</code></pre>
|
|
48
|
+
|
|
49
|
+
<p>Plugins are loaded from these locations:</p>
|
|
50
|
+
<ul>
|
|
51
|
+
<li><strong>Bundled</strong> — Shipped with Clew</li>
|
|
52
|
+
<li><strong>User</strong> — Installed by the user (via marketplace or manual)</li>
|
|
53
|
+
<li><strong>Plugin dir</strong> — Custom directories via <code>--plugin-dir <path></code> (repeatable)</li>
|
|
54
|
+
</ul>
|
|
55
|
+
|
|
56
|
+
<p>The <code>PluginInstallationManager</code> (<code>src/services/plugins/PluginInstallationManager.ts</code>) handles automatic installation, marketplace reconciliation, and plugin refresh. Use <code>/reload-plugins</code> after installing or updating plugins.</p>
|
|
57
|
+
|
|
58
|
+
<h2>Built-in Plugins</h2>
|
|
59
|
+
<table>
|
|
60
|
+
<tr><th>Plugin</th><th>Description</th></tr>
|
|
61
|
+
<tr><td><code>commit-commands</code></td><td>Git workflow — commit, push, PR creation, branch cleanup (<code>clean_gone</code>)</td></tr>
|
|
62
|
+
<tr><td><code>commit-push-pr</code></td><td>Commit, push, and open a PR in one step</td></tr>
|
|
63
|
+
<tr><td><code>code-review</code></td><td>Automated PR code review</td></tr>
|
|
64
|
+
<tr><td><code>feature-dev</code></td><td>Guided feature development with codebase understanding</td></tr>
|
|
65
|
+
<tr><td><code>frontend-design</code></td><td>Production-grade UI/UX generation</td></tr>
|
|
66
|
+
<tr><td><code>verify</code></td><td>Typecheck, lint, build, and test pipeline</td></tr>
|
|
67
|
+
<tr><td><code>precommit</code></td><td>Pre-commit review with full verification</td></tr>
|
|
68
|
+
<tr><td><code>commit</code></td><td>Conventional git commit message generation</td></tr>
|
|
69
|
+
<tr><td><code>simplify</code></td><td>Code quality and reuse review</td></tr>
|
|
70
|
+
<tr><td><code>debug</code></td><td>Debugging assistance and diagnosis</td></tr>
|
|
71
|
+
<tr><td><code>web-search</code></td><td>Multi-provider web search</td></tr>
|
|
72
|
+
<tr><td><code>scrapling</code></td><td>Web scraping with Scrapling framework</td></tr>
|
|
73
|
+
<tr><td><code>skillify</code></td><td>Create reusable skills from workflows</td></tr>
|
|
74
|
+
<tr><td><code>remember</code></td><td>Save user preferences</td></tr>
|
|
75
|
+
</table>
|
|
76
|
+
|
|
77
|
+
<h2>Plugin Structure</h2>
|
|
78
|
+
<pre><code>my-plugin/
|
|
79
|
+
manifest.json # Plugin metadata and capability declarations
|
|
80
|
+
commands/ # Custom slash commands
|
|
81
|
+
skills/ # Reusable task instructions
|
|
82
|
+
agents/ # Agent configurations
|
|
83
|
+
hooks/ # Hook implementations</code></pre>
|
|
84
|
+
|
|
85
|
+
<h2>Marketplace</h2>
|
|
86
|
+
<p>Plugins can be distributed through marketplaces. The <code>marketplaceManager</code> (<code>src/utils/plugins/marketplaceManager.ts</code>) handles marketplace source discovery, cache management, and plugin installation from remote sources.</p>
|
|
87
|
+
|
|
88
|
+
<footer class="footer">
|
|
89
|
+
<span>Clew Code v0.2.4 — Open Source</span>
|
|
90
|
+
<div class="footer-links">
|
|
91
|
+
<a href="https://github.com/JonusNattapong/ClewCode">GitHub</a>
|
|
92
|
+
<a href="https://github.com/JonusNattapong/ClewCode/issues">Issues</a>
|
|
93
|
+
</div>
|
|
94
|
+
</footer>
|
|
95
|
+
</main>
|
|
96
|
+
<nav class="toc-sidebar"></nav>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
<script src="js/main.js"></script>
|
|
100
|
+
</body>
|
|
101
|
+
</html>
|
package/docs/plugins.th.html
CHANGED
|
@@ -12,28 +12,7 @@
|
|
|
12
12
|
<link rel="icon" type="image/svg+xml" href="./assets/clew.svg">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
|
-
<header class="header"
|
|
16
|
-
<span>Clew Code</span>
|
|
17
|
-
</a><nav class="header-nav"><a href="index.th.html">หน้าแรก</a><a href="index.th.html#features">ฟีเจอร์</a><a href="index.th.html#commands">คำสั่ง</a><a href="quick-start.th.html" class="active">เอกสาร</a><a href="https://github.com/JonusNattapong/ClewCode" target="_blank">GitHub</a>
|
|
18
|
-
<div class="lang-wrap">
|
|
19
|
-
<button class="lang-btn">🌐</button>
|
|
20
|
-
<div class="lang-menu">
|
|
21
|
-
<a href="../readme/README.zh.md">中文</a>
|
|
22
|
-
<a href="../readme/README.th.md">ไทย</a>
|
|
23
|
-
<a href="../readme/README.ja.md">日本語</a>
|
|
24
|
-
<a href="../readme/README.ko.md">한국어</a>
|
|
25
|
-
<a href="../readme/README.es.md">Español</a>
|
|
26
|
-
<a href="../readme/README.fr.md">Français</a>
|
|
27
|
-
<a href="../readme/README.de.md">Deutsch</a>
|
|
28
|
-
<a href="../readme/README.pt.md">Português</a>
|
|
29
|
-
<a href="../readme/README.vi.md">Tiếng Việt</a>
|
|
30
|
-
<a href="../readme/README.id.md">Bahasa Indonesia</a>
|
|
31
|
-
<a href="../readme/README.ru.md">Русский</a>
|
|
32
|
-
<a href="../readme/README.hi.md">हिन्दी</a>
|
|
33
|
-
<a href="plugins.html">English</a>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</nav><button class="menu-btn" id="menuToggle" aria-label="เปิด/ปิดเมนู"><span></span><span></span><span></span></button></div></header>
|
|
15
|
+
<header class="header"></header>
|
|
37
16
|
<div class="app"><aside class="sidebar" id="sidebar"></aside><div class="sidebar-overlay" id="sidebarOverlay"></div>
|
|
38
17
|
<div class="content-wrap"><main class="content">
|
|
39
18
|
<div class="breadcrumbs"><a href="index.th.html">หน้าแรก</a><span class="sep">/</span><span>ปลั๊กอิน</span></div>
|
|
@@ -84,7 +63,7 @@
|
|
|
84
63
|
hooks/ # การใช้งานฮุค</code></pre>
|
|
85
64
|
|
|
86
65
|
<footer class="footer">
|
|
87
|
-
<span>Clew v0.
|
|
66
|
+
<span>Clew Code v0.2.4 — โอเพนซอร์ส</span>
|
|
88
67
|
<div class="footer-links">
|
|
89
68
|
<a href="https://github.com/JonusNattapong/ClewCode">GitHub</a>
|
|
90
69
|
<a href="https://github.com/JonusNattapong/ClewCode/issues">ปัญหา</a>
|
package/docs/providers.html
CHANGED
|
@@ -1,138 +1,117 @@
|
|
|
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>Providers — Clew</title>
|
|
7
|
-
<meta name="description" content="Complete AI provider reference for Clew — 27 supported providers with configuration and capabilities.">
|
|
8
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
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
|
-
<link rel="icon" type="image/svg+xml" href="./assets/clew.svg">
|
|
13
|
-
</head>
|
|
14
|
-
<body>
|
|
15
|
-
<header class="header"
|
|
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
|
-
<tr><
|
|
48
|
-
<tr><td>
|
|
49
|
-
<tr><td>
|
|
50
|
-
<tr><td>
|
|
51
|
-
<tr><td>
|
|
52
|
-
<tr><td>
|
|
53
|
-
<tr><td>
|
|
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
|
-
<li><strong>
|
|
91
|
-
<li><strong>
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
/model
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
<
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
export OLLAMA_HOST=http://localhost:11434
|
|
119
|
-
clew
|
|
120
|
-
> /model ollama/llama4:70b
|
|
121
|
-
|
|
122
|
-
# Debug specific provider
|
|
123
|
-
DEBUG=provider:anthropic clew</code></pre>
|
|
124
|
-
|
|
125
|
-
<footer class="footer">
|
|
126
|
-
<span>Clew v0.1.2 — Open Source</span>
|
|
127
|
-
<div class="footer-links">
|
|
128
|
-
<a href="https://github.com/JonusNattapong/ClewCode">GitHub</a>
|
|
129
|
-
<a href="https://github.com/JonusNattapong/ClewCode/issues">Issues</a>
|
|
130
|
-
</div>
|
|
131
|
-
</footer>
|
|
132
|
-
</main>
|
|
133
|
-
<nav class="toc-sidebar"></nav>
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
<script src="js/main.js"></script>
|
|
137
|
-
</body>
|
|
138
|
-
</html>
|
|
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>Providers — Clew</title>
|
|
7
|
+
<meta name="description" content="Complete AI provider reference for Clew — 27 supported providers with configuration and capabilities.">
|
|
8
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
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
|
+
<link rel="icon" type="image/svg+xml" href="./assets/clew.svg">
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<header class="header"></header>
|
|
16
|
+
<div class="app"><aside class="sidebar" id="sidebar"></aside><div class="sidebar-overlay" id="sidebarOverlay"></div>
|
|
17
|
+
<div class="content-wrap"><main class="content">
|
|
18
|
+
<div class="breadcrumbs"><a href="index.html">Home</a><span class="sep">/</span><span>Providers</span></div>
|
|
19
|
+
<h1>Providers</h1>
|
|
20
|
+
<p class="section-subtitle">Clew supports <strong>27 AI providers</strong> with a unified adapter layer. Set your API keys as environment variables and switch between providers at runtime with <code>/model</code>.</p>
|
|
21
|
+
|
|
22
|
+
<p>Provider configuration is declared in <code>src/services/ai/providers.json</code>. The <strong>ProviderManager</strong> resolves API keys, selects models, and manages provider config. Non-Anthropic providers are normalized via the <strong>AnthropicAdapter</strong> or <strong>GoogleAdapter</strong>.</p>
|
|
23
|
+
|
|
24
|
+
<h2>All Providers</h2>
|
|
25
|
+
<table>
|
|
26
|
+
<tr><th>Provider</th><th>Env Key</th><th>Default Model</th><th>Notes</th></tr>
|
|
27
|
+
<tr><td>Anthropic</td><td><code>ANTHROPIC_API_KEY</code></td><td>claude-sonnet-4-7</td><td>Native Claude support with full tool calling and reasoning. Context: 1M tokens.</td></tr>
|
|
28
|
+
<tr><td>OpenAI</td><td><code>OPENAI_API_KEY</code></td><td>gpt-5.5</td><td>GPT-5.5, GPT-5.5 Pro, GPT-5.4 Mini. Context: 1M+ tokens.</td></tr>
|
|
29
|
+
<tr><td>Google</td><td><code>GOOGLE_API_KEY</code></td><td>gemini-3.1-flash</td><td>Gemini 3.1 Flash, Pro. Context: up to 2M tokens. Uses GoogleAdapter.</td></tr>
|
|
30
|
+
<tr><td>GitHub Copilot</td><td><code>COPILOT_GITHUB_TOKEN</code></td><td>gpt-5.5</td><td>Access via GitHub token. Includes Claude and GPT models. Context: 1M tokens.</td></tr>
|
|
31
|
+
<tr><td>OpenRouter</td><td><code>OPENROUTER_API_KEY</code></td><td>—</td><td>100+ models via routed API. OpenAI-compatible.</td></tr>
|
|
32
|
+
<tr><td>DeepSeek</td><td><code>DEEPSEEK_API_KEY</code></td><td>deepseek-v4-pro</td><td>DeepSeek V4 Pro, V4 Flash. Context: 1M tokens. MoE architecture.</td></tr>
|
|
33
|
+
<tr><td>OpenCode</td><td><code>OPENCODE_API_KEY</code></td><td>claude-opus-4-7</td><td>OpenCode AI gateway. OpenAI-compatible. Includes Claude, GPT, Gemini, Kimi, GLM, MiniMax.</td></tr>
|
|
34
|
+
<tr><td>OpenCode Go</td><td><code>OPENCODE_GO_API_KEY</code></td><td>minimax-m2.7</td><td>Low cost subscription tier for open coding models.</td></tr>
|
|
35
|
+
<tr><td>Cline API</td><td><code>CLINE_API_KEY</code></td><td>anthropic/claude-opus-4-7</td><td>OpenAI-compatible. Model IDs format: provider/model-name.</td></tr>
|
|
36
|
+
<tr><td>Groq</td><td><code>GROQ_API_KEY</code></td><td>—</td><td>Llama 4 70B, 8B. Fast inference. Context: 128K tokens.</td></tr>
|
|
37
|
+
<tr><td>xAI</td><td><code>XAI_API_KEY</code></td><td>grok-4-20</td><td>Grok 4.20, Grok 4. Context: 128K tokens. Vision and tool calling.</td></tr>
|
|
38
|
+
<tr><td>Mistral</td><td><code>MISTRAL_API_KEY</code></td><td>mistral-small-latest</td><td>Mistral Large 4, Small 4, Ministral 3 14B. Tool calling and vision support.</td></tr>
|
|
39
|
+
<tr><td>KiloCode</td><td><code>KILOCODE_API_KEY</code></td><td>kilo-auto/free</td><td>Gateway with 500+ models. Includes free tier.</td></tr>
|
|
40
|
+
<tr><td>Ollama (Local)</td><td><code>OLLAMA_API_KEY</code></td><td>llama3.3</td><td>Local models via Ollama server at <code>http://localhost:11434/v1</code>. Offline-capable.</td></tr>
|
|
41
|
+
<tr><td>Together AI</td><td><code>TOGETHER_API_KEY</code></td><td>—</td><td>Llama 4 models. OpenAI-compatible.</td></tr>
|
|
42
|
+
<tr><td>Fireworks AI</td><td><code>FIREWORKS_API_KEY</code></td><td>—</td><td>Llama 4 70B. Fast inference.</td></tr>
|
|
43
|
+
<tr><td>NVIDIA NIM</td><td><code>NVIDIA_API_KEY</code></td><td>—</td><td>NVIDIA AI Foundation Models. DeepSeek, Llama 3.1, Nemotron. Live model list fetched from API on /model list.</td></tr>
|
|
44
|
+
<tr><td>Cohere</td><td><code>COHERE_API_KEY</code></td><td>command-r-plus</td><td>Command R+ model. 128K context. No vision.</td></tr>
|
|
45
|
+
<tr><td>Deep Infra</td><td><code>DEEPINFRA_API_KEY</code></td><td>—</td><td>OpenAI-compatible gateway. Llama 4 Scout with 327K context.</td></tr>
|
|
46
|
+
<tr><td>Perplexity</td><td><code>PERPLEXITY_API_KEY</code></td><td>—</td><td>Sonar Huge Online. No tool calling support.</td></tr>
|
|
47
|
+
<tr><td>Cerebras</td><td><code>CEREBRAS_API_KEY</code></td><td>—</td><td>Wafer-Scale Engine. Extremely fast inference. Qwen 3 235B.</td></tr>
|
|
48
|
+
<tr><td>SiliconFlow</td><td><code>SILICONFLOW_API_KEY</code></td><td>—</td><td>China-based AI platform. DeepSeek V4 Pro and Flash.</td></tr>
|
|
49
|
+
<tr><td>Moonshot AI (Kimi)</td><td><code>MOONSHOT_API_KEY</code></td><td>kimi-latest</td><td>Kimi models. 128K context. Vision and tool calling.</td></tr>
|
|
50
|
+
<tr><td>Zhipu AI (GLM)</td><td><code>ZHIPU_API_KEY</code></td><td>glm-4</td><td>GLM-4 model. 128K context.</td></tr>
|
|
51
|
+
<tr><td>Hugging Face</td><td><code>HUGGINGFACE_API_KEY</code></td><td>—</td><td>Inference API. Llama 3.1 70B. No tool calling.</td></tr>
|
|
52
|
+
<tr><td>Poe</td><td><code>POE_API_KEY</code></td><td>—</td><td>OpenAI-compatible gateway. Claude 3.7 Sonnet available.</td></tr>
|
|
53
|
+
<tr><td>DigitalOcean</td><td><code>DIGITALOCEAN_API_KEY</code></td><td>—</td><td>Serverless Inference. Llama 3.1 70B.</td></tr>
|
|
54
|
+
</table>
|
|
55
|
+
|
|
56
|
+
<h2>Provider Selection</h2>
|
|
57
|
+
<p>ProviderManager resolves the active provider by:</p>
|
|
58
|
+
<ol>
|
|
59
|
+
<li>Scanning environment variables for configured API keys</li>
|
|
60
|
+
<li>Loading provider metadata from <code>providers.json</code></li>
|
|
61
|
+
<li>Resolving model names to provider-specific identifiers</li>
|
|
62
|
+
<li>Applying the adapter layer for non-Anthropic providers</li>
|
|
63
|
+
<li>Handling config migration and backward compatibility</li>
|
|
64
|
+
</ol>
|
|
65
|
+
|
|
66
|
+
<h2>Adapter Layer</h2>
|
|
67
|
+
<p>Non-Anthropic providers pass through adapters that normalize:</p>
|
|
68
|
+
<ul>
|
|
69
|
+
<li><strong>Content blocks</strong> — text, tool_use, tool_result, thinking block conversion (<code>contentBlockUtils.ts</code>)</li>
|
|
70
|
+
<li><strong>Tool calls</strong> — parsing across provider formats (<code>toolCallParser.ts</code>)</li>
|
|
71
|
+
<li><strong>Streaming chunks</strong> — per-chunk normalization for real-time display</li>
|
|
72
|
+
<li><strong>Errors</strong> — normalization with retry/rate-limit handling (<code>errorNormalizer.ts</code>)</li>
|
|
73
|
+
<li><strong>Usage</strong> — token counting and cost estimation (<code>usageNormalizer.ts</code>)</li>
|
|
74
|
+
</ul>
|
|
75
|
+
|
|
76
|
+
<h2>Runtime Switching</h2>
|
|
77
|
+
<pre><code>/model # Interactive model picker
|
|
78
|
+
/model list # List all available models across providers
|
|
79
|
+
/model claude-sonnet-4-7 # Switch to a specific model
|
|
80
|
+
/provider-select # Show or change active provider</code></pre>
|
|
81
|
+
|
|
82
|
+
<h2>Provider Capabilities</h2>
|
|
83
|
+
<p>Each provider declares capabilities in <code>providers.json</code>:</p>
|
|
84
|
+
<ul>
|
|
85
|
+
<li><strong>chat</strong> — Chat completion endpoint</li>
|
|
86
|
+
<li><strong>streaming</strong> — full, partial, or none</li>
|
|
87
|
+
<li><strong>toolCalling</strong> — native, adapted, or none</li>
|
|
88
|
+
<li><strong>vision</strong> — Image input support</li>
|
|
89
|
+
<li><strong>jsonSchema</strong> — Structured output via JSON schema</li>
|
|
90
|
+
<li><strong>reasoningEffort</strong> — Configurable reasoning depth</li>
|
|
91
|
+
<li><strong>contextLength</strong> — Maximum context window size</li>
|
|
92
|
+
</ul>
|
|
93
|
+
|
|
94
|
+
<h2>Local / Offline Development</h2>
|
|
95
|
+
<pre><code># Ollama — fully offline
|
|
96
|
+
export OLLAMA_API_KEY=ollama # (any non-empty value)
|
|
97
|
+
export OLLAMA_HOST=http://localhost:11434
|
|
98
|
+
clew
|
|
99
|
+
> /model ollama/llama4:70b
|
|
100
|
+
|
|
101
|
+
# Debug specific provider
|
|
102
|
+
DEBUG=provider:anthropic clew</code></pre>
|
|
103
|
+
|
|
104
|
+
<footer class="footer">
|
|
105
|
+
<span>Clew Code v0.2.4 — Open Source</span>
|
|
106
|
+
<div class="footer-links">
|
|
107
|
+
<a href="https://github.com/JonusNattapong/ClewCode">GitHub</a>
|
|
108
|
+
<a href="https://github.com/JonusNattapong/ClewCode/issues">Issues</a>
|
|
109
|
+
</div>
|
|
110
|
+
</footer>
|
|
111
|
+
</main>
|
|
112
|
+
<nav class="toc-sidebar"></nav>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
<script src="js/main.js"></script>
|
|
116
|
+
</body>
|
|
117
|
+
</html>
|