n8n-nodes-claude-code-cli 1.0.0

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 (104) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +603 -0
  3. package/dist/credentials/ClaudeCodeDockerApi.credentials.d.ts +9 -0
  4. package/dist/credentials/ClaudeCodeDockerApi.credentials.d.ts.map +1 -0
  5. package/dist/credentials/ClaudeCodeDockerApi.credentials.js +82 -0
  6. package/dist/credentials/ClaudeCodeDockerApi.credentials.js.map +1 -0
  7. package/dist/credentials/ClaudeCodeLocalApi.credentials.d.ts +9 -0
  8. package/dist/credentials/ClaudeCodeLocalApi.credentials.d.ts.map +1 -0
  9. package/dist/credentials/ClaudeCodeLocalApi.credentials.js +35 -0
  10. package/dist/credentials/ClaudeCodeLocalApi.credentials.js.map +1 -0
  11. package/dist/credentials/ClaudeCodeSshApi.credentials.d.ts +9 -0
  12. package/dist/credentials/ClaudeCodeSshApi.credentials.d.ts.map +1 -0
  13. package/dist/credentials/ClaudeCodeSshApi.credentials.js +119 -0
  14. package/dist/credentials/ClaudeCodeSshApi.credentials.js.map +1 -0
  15. package/dist/icons/claudecode.svg +40 -0
  16. package/dist/index.d.ts +5 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +21 -0
  19. package/dist/index.js.map +1 -0
  20. package/dist/nodes/ClaudeCode/ClaudeCode.node.d.ts +6 -0
  21. package/dist/nodes/ClaudeCode/ClaudeCode.node.d.ts.map +1 -0
  22. package/dist/nodes/ClaudeCode/ClaudeCode.node.js +131 -0
  23. package/dist/nodes/ClaudeCode/ClaudeCode.node.js.map +1 -0
  24. package/dist/nodes/ClaudeCode/descriptions/connectionModeDescription.d.ts +3 -0
  25. package/dist/nodes/ClaudeCode/descriptions/connectionModeDescription.d.ts.map +1 -0
  26. package/dist/nodes/ClaudeCode/descriptions/connectionModeDescription.js +30 -0
  27. package/dist/nodes/ClaudeCode/descriptions/connectionModeDescription.js.map +1 -0
  28. package/dist/nodes/ClaudeCode/descriptions/contextDescription.d.ts +3 -0
  29. package/dist/nodes/ClaudeCode/descriptions/contextDescription.d.ts.map +1 -0
  30. package/dist/nodes/ClaudeCode/descriptions/contextDescription.js +52 -0
  31. package/dist/nodes/ClaudeCode/descriptions/contextDescription.js.map +1 -0
  32. package/dist/nodes/ClaudeCode/descriptions/index.d.ts +9 -0
  33. package/dist/nodes/ClaudeCode/descriptions/index.d.ts.map +1 -0
  34. package/dist/nodes/ClaudeCode/descriptions/index.js +20 -0
  35. package/dist/nodes/ClaudeCode/descriptions/index.js.map +1 -0
  36. package/dist/nodes/ClaudeCode/descriptions/modelDescription.d.ts +3 -0
  37. package/dist/nodes/ClaudeCode/descriptions/modelDescription.d.ts.map +1 -0
  38. package/dist/nodes/ClaudeCode/descriptions/modelDescription.js +49 -0
  39. package/dist/nodes/ClaudeCode/descriptions/modelDescription.js.map +1 -0
  40. package/dist/nodes/ClaudeCode/descriptions/operationDescription.d.ts +3 -0
  41. package/dist/nodes/ClaudeCode/descriptions/operationDescription.d.ts.map +1 -0
  42. package/dist/nodes/ClaudeCode/descriptions/operationDescription.js +39 -0
  43. package/dist/nodes/ClaudeCode/descriptions/operationDescription.js.map +1 -0
  44. package/dist/nodes/ClaudeCode/descriptions/optionsDescription.d.ts +3 -0
  45. package/dist/nodes/ClaudeCode/descriptions/optionsDescription.d.ts.map +1 -0
  46. package/dist/nodes/ClaudeCode/descriptions/optionsDescription.js +67 -0
  47. package/dist/nodes/ClaudeCode/descriptions/optionsDescription.js.map +1 -0
  48. package/dist/nodes/ClaudeCode/descriptions/promptDescription.d.ts +3 -0
  49. package/dist/nodes/ClaudeCode/descriptions/promptDescription.d.ts.map +1 -0
  50. package/dist/nodes/ClaudeCode/descriptions/promptDescription.js +28 -0
  51. package/dist/nodes/ClaudeCode/descriptions/promptDescription.js.map +1 -0
  52. package/dist/nodes/ClaudeCode/descriptions/sessionDescription.d.ts +3 -0
  53. package/dist/nodes/ClaudeCode/descriptions/sessionDescription.d.ts.map +1 -0
  54. package/dist/nodes/ClaudeCode/descriptions/sessionDescription.js +20 -0
  55. package/dist/nodes/ClaudeCode/descriptions/sessionDescription.js.map +1 -0
  56. package/dist/nodes/ClaudeCode/descriptions/toolPermissionsDescription.d.ts +3 -0
  57. package/dist/nodes/ClaudeCode/descriptions/toolPermissionsDescription.d.ts.map +1 -0
  58. package/dist/nodes/ClaudeCode/descriptions/toolPermissionsDescription.js +31 -0
  59. package/dist/nodes/ClaudeCode/descriptions/toolPermissionsDescription.js.map +1 -0
  60. package/dist/nodes/ClaudeCode/interfaces/ClaudeCodeTypes.d.ts +143 -0
  61. package/dist/nodes/ClaudeCode/interfaces/ClaudeCodeTypes.d.ts.map +1 -0
  62. package/dist/nodes/ClaudeCode/interfaces/ClaudeCodeTypes.js +3 -0
  63. package/dist/nodes/ClaudeCode/interfaces/ClaudeCodeTypes.js.map +1 -0
  64. package/dist/nodes/ClaudeCode/interfaces/index.d.ts +2 -0
  65. package/dist/nodes/ClaudeCode/interfaces/index.d.ts.map +1 -0
  66. package/dist/nodes/ClaudeCode/interfaces/index.js +3 -0
  67. package/dist/nodes/ClaudeCode/interfaces/index.js.map +1 -0
  68. package/dist/nodes/ClaudeCode/transport/DockerExecutor.d.ts +29 -0
  69. package/dist/nodes/ClaudeCode/transport/DockerExecutor.d.ts.map +1 -0
  70. package/dist/nodes/ClaudeCode/transport/DockerExecutor.js +153 -0
  71. package/dist/nodes/ClaudeCode/transport/DockerExecutor.js.map +1 -0
  72. package/dist/nodes/ClaudeCode/transport/ExecutorFactory.d.ts +6 -0
  73. package/dist/nodes/ClaudeCode/transport/ExecutorFactory.d.ts.map +1 -0
  74. package/dist/nodes/ClaudeCode/transport/ExecutorFactory.js +22 -0
  75. package/dist/nodes/ClaudeCode/transport/ExecutorFactory.js.map +1 -0
  76. package/dist/nodes/ClaudeCode/transport/LocalExecutor.d.ts +18 -0
  77. package/dist/nodes/ClaudeCode/transport/LocalExecutor.d.ts.map +1 -0
  78. package/dist/nodes/ClaudeCode/transport/LocalExecutor.js +83 -0
  79. package/dist/nodes/ClaudeCode/transport/LocalExecutor.js.map +1 -0
  80. package/dist/nodes/ClaudeCode/transport/SshExecutor.d.ts +25 -0
  81. package/dist/nodes/ClaudeCode/transport/SshExecutor.d.ts.map +1 -0
  82. package/dist/nodes/ClaudeCode/transport/SshExecutor.js +174 -0
  83. package/dist/nodes/ClaudeCode/transport/SshExecutor.js.map +1 -0
  84. package/dist/nodes/ClaudeCode/transport/index.d.ts +5 -0
  85. package/dist/nodes/ClaudeCode/transport/index.d.ts.map +1 -0
  86. package/dist/nodes/ClaudeCode/transport/index.js +12 -0
  87. package/dist/nodes/ClaudeCode/transport/index.js.map +1 -0
  88. package/dist/nodes/ClaudeCode/utils/commandBuilder.d.ts +16 -0
  89. package/dist/nodes/ClaudeCode/utils/commandBuilder.d.ts.map +1 -0
  90. package/dist/nodes/ClaudeCode/utils/commandBuilder.js +100 -0
  91. package/dist/nodes/ClaudeCode/utils/commandBuilder.js.map +1 -0
  92. package/dist/nodes/ClaudeCode/utils/index.d.ts +4 -0
  93. package/dist/nodes/ClaudeCode/utils/index.d.ts.map +1 -0
  94. package/dist/nodes/ClaudeCode/utils/index.js +14 -0
  95. package/dist/nodes/ClaudeCode/utils/index.js.map +1 -0
  96. package/dist/nodes/ClaudeCode/utils/optionsBuilder.d.ts +7 -0
  97. package/dist/nodes/ClaudeCode/utils/optionsBuilder.d.ts.map +1 -0
  98. package/dist/nodes/ClaudeCode/utils/optionsBuilder.js +84 -0
  99. package/dist/nodes/ClaudeCode/utils/optionsBuilder.js.map +1 -0
  100. package/dist/nodes/ClaudeCode/utils/outputParser.d.ts +14 -0
  101. package/dist/nodes/ClaudeCode/utils/outputParser.d.ts.map +1 -0
  102. package/dist/nodes/ClaudeCode/utils/outputParser.js +80 -0
  103. package/dist/nodes/ClaudeCode/utils/outputParser.js.map +1 -0
  104. package/package.json +75 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Thomas Tartrau
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,603 @@
1
+ <div align="center">
2
+
3
+ ```
4
+ _____ _ _ _____ _
5
+ / ____| | | | / ____| | |
6
+ | | | | __ _ _ _ __| | ___ | | ___ __| | ___
7
+ | | | |/ _` | | | |/ _` |/ _ \ | | / _ \ / _` |/ _ \
8
+ | |____| | (_| | |_| | (_| | __/ | |___| (_) | (_| | __/
9
+ \_____|_|\__,_|\__,_|\__,_|\___| \_____\___/ \__,_|\___|
10
+
11
+ ⚡ for n8n ⚡
12
+ ```
13
+
14
+ # n8n-nodes-claude-code-cli
15
+
16
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)
17
+ [![n8n](https://img.shields.io/badge/n8n-community_node-FF6D5A?style=for-the-badge&logo=n8n&logoColor=white)](https://n8n.io)
18
+
19
+ **🤖 Bring the power of Claude Code AI directly into your n8n workflows**
20
+
21
+ *Automate code reviews • Generate documentation • Fix bugs • Build coding bots*
22
+
23
+ [Getting Started](#-quick-start) •
24
+ [Use Cases](#-use-cases) •
25
+ [Documentation](#-node-operations)
26
+
27
+ </div>
28
+
29
+ ---
30
+
31
+ ## ✨ Features
32
+
33
+ <table>
34
+ <tr>
35
+ <td width="50%">
36
+
37
+ ### 🐳 Multiple Connection Modes
38
+ Execute Claude Code locally, via SSH, or inside Docker containers
39
+
40
+ ### 🔄 Session Management
41
+ Maintain multi-turn conversations across workflow executions
42
+
43
+ ### 🎯 Tool Permissions
44
+ Fine-grained control over which tools Claude Code can use
45
+
46
+ </td>
47
+ <td width="50%">
48
+
49
+ ### 📁 Context File Support
50
+ Include files and directories as context for code analysis
51
+
52
+ ### 🧠 Multiple Models
53
+ Support for Opus, Sonnet, Haiku and specific versions
54
+
55
+ ### 📊 Rich Output
56
+ Detailed metadata including costs, tokens, and session IDs
57
+
58
+ </td>
59
+ </tr>
60
+ </table>
61
+
62
+ ---
63
+
64
+ ## ⚡ Quick Start
65
+
66
+ ```
67
+ 1️⃣ Install → 2️⃣ Setup Claude Code → 3️⃣ Authenticate → 4️⃣ Create Workflow → 5️⃣ Run!
68
+ ```
69
+
70
+ <details>
71
+ <summary><b>📋 Step-by-step guide</b></summary>
72
+
73
+ ### 1️⃣ Install the node
74
+
75
+
76
+ #### **Install the node in n8n community nodes**
77
+
78
+ Search for "n8n-nodes-claude-code-cli" in the n8n community nodes interface.
79
+ Then install the node.
80
+
81
+
82
+ #### **Install the node locally with git:**
83
+
84
+ I recommend using git to install the node locally.
85
+ *If there is a supply chain attack, you will not be affected by the automatic updates of the community nodes of n8n. And therefore your service will not be corrupted. Supply chain attacks are very dangerous, more and more frequent and can compromise your service. It is therefore recommended to use git to install the node locally.*
86
+
87
+ ```bash
88
+ git clone https://github.com/n8n-io/n8n-nodes-claude-code-cli.git
89
+ cd n8n-nodes-claude-code-cli
90
+ npm install
91
+ npm run build
92
+ ```
93
+
94
+
95
+ #### **Install locally with npm:**
96
+
97
+ ```bash
98
+ npm install n8n-nodes-claude-code-cli
99
+ ```
100
+
101
+ **For local installation you need to add the environment variable `- N8N_CUSTOM_EXTENSIONS=/home/node/.n8n/custom` in your n8n configuration file.**
102
+
103
+ ### 2️⃣ Set up Claude Code
104
+
105
+ Choose your deployment method (see [Installation](#-installation--deployment))
106
+
107
+ ### 3️⃣ Authenticate with Claude
108
+
109
+ ```bash
110
+ # For Docker
111
+ docker exec -it your-container-name claude login
112
+
113
+ # For SSH or Local
114
+ claude login
115
+ ```
116
+
117
+ ### 4️⃣ Create credentials in n8n
118
+
119
+ Go to **Settings → Credentials → Add Credential** and select your connection type
120
+
121
+ ### 5️⃣ Add the node and run!
122
+
123
+ Search for "Claude Code" in the node panel, configure, and execute
124
+
125
+ </details>
126
+
127
+ ### 🐳 Docker (Recommended)
128
+
129
+ > **Why Docker?** Isolation, easy setup, portability, and security.
130
+
131
+ <details>
132
+ <summary><b>Option 1: Node.js Container (Lightweight)</b></summary>
133
+
134
+ Best for code analysis without system tools:
135
+
136
+ ```dockerfile
137
+ FROM node:24-slim
138
+
139
+ # Install Claude Code CLI
140
+ RUN npm install -g @anthropic-ai/claude-code
141
+
142
+ # Set up workspace
143
+ WORKDIR /workspace
144
+
145
+ # Keep container running
146
+ CMD ["tail", "-f", "/dev/null"]
147
+ ```
148
+
149
+ ```yaml
150
+ # docker-compose.yml
151
+ services:
152
+ claude-code-runner:
153
+ build: .
154
+ volumes:
155
+ - ./workspace:/workspace
156
+ ```
157
+
158
+ </details>
159
+
160
+ <details>
161
+ <summary><b>Option 2: Debian Container (Full Tooling)</b></summary>
162
+
163
+ Best when Claude Code needs system tools (git, build tools, etc.):
164
+
165
+ ```dockerfile
166
+ FROM debian:bookworm-slim
167
+
168
+ # Install Node.js and common tools
169
+ RUN apt-get update && apt-get install -y \
170
+ curl git build-essential \
171
+ && curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
172
+ && apt-get install -y nodejs \
173
+ && rm -rf /var/lib/apt/lists/*
174
+
175
+ # Install Claude Code CLI
176
+ RUN npm install -g @anthropic-ai/claude-code
177
+
178
+ WORKDIR /workspace
179
+ CMD ["tail", "-f", "/dev/null"]
180
+ ```
181
+
182
+ </details>
183
+
184
+ **🔑 Authenticate:**
185
+ ```bash
186
+ docker exec -it claude-code-runner claude login
187
+ ```
188
+
189
+ **⚙️ n8n Credentials:**
190
+ | Parameter | Value |
191
+ |-----------|-------|
192
+ | Container Name | `claude-code-runner` |
193
+ | Working Directory | `/workspace` |
194
+
195
+ ---
196
+
197
+ ### 🔐 SSH (Alternative)
198
+
199
+ > **Why SSH?** Full system access and dedicated resource isolation.
200
+
201
+ <details>
202
+ <summary><b>Setup Instructions</b></summary>
203
+
204
+ 1. **Set up a VM** (AWS EC2, GCP, DigitalOcean, etc.)
205
+
206
+ 2. **Install Claude Code:**
207
+ ```bash
208
+ # Install Node.js
209
+ curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
210
+ sudo apt-get install -y nodejs
211
+
212
+ # Install Claude Code
213
+ npm install -g @anthropic-ai/claude-code
214
+
215
+ # Authenticate
216
+ claude login
217
+ ```
218
+
219
+ 3. **Configure SSH** with key-based authentication
220
+
221
+ </details>
222
+
223
+ **⚙️ n8n Credentials:**
224
+ | Parameter | Value |
225
+ |-----------|-------|
226
+ | Host | Your VM IP/hostname |
227
+ | Port | `22` |
228
+ | Auth Method | `privateKey` |
229
+
230
+ ---
231
+
232
+ ### 💻 Local (Not Recommended)
233
+
234
+ > ⚠️ **Security concerns** - Claude Code runs in the same context as n8n
235
+
236
+ <details>
237
+ <summary><b>Why not recommended?</b></summary>
238
+
239
+ - Security risks (shared execution context)
240
+ - Resource contention
241
+ - Harder to manage and update
242
+
243
+ **If you must use local:**
244
+ 1. Install Claude Code inside your n8n container
245
+ 2. Run `claude login`
246
+ 3. Use "Local" connection mode
247
+
248
+ </details>
249
+
250
+ ---
251
+
252
+ ## 🔑 Authentication
253
+
254
+ ### Recommended: Claude Login (Subscription)
255
+
256
+ > 💰 **Cheaper!** Claude Code subscription costs less than API usage.
257
+
258
+ ```bash
259
+ # Docker
260
+ docker exec -it container_name claude login
261
+
262
+ # SSH (on remote server)
263
+ claude login
264
+
265
+ # Local
266
+ claude login
267
+ ```
268
+
269
+ Follow the browser prompts to authenticate.
270
+
271
+ ### Alternative: API Key
272
+
273
+ <details>
274
+ <summary><b>Using ANTHROPIC_API_KEY (not recommended)</b></summary>
275
+
276
+ > ⚠️ More expensive than subscription pricing
277
+
278
+ Set via environment variable:
279
+ ```bash
280
+ export ANTHROPIC_API_KEY="your-api-key"
281
+ ```
282
+
283
+ Or in Docker Compose:
284
+ ```yaml
285
+ environment:
286
+ - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
287
+ ```
288
+
289
+ </details>
290
+
291
+ ---
292
+
293
+ ## ⚙️ Node Operations
294
+
295
+ | Operation | Description | Use Case |
296
+ |-----------|-------------|----------|
297
+ | **Execute Prompt** | Send a prompt and get a response | Direct AI interaction |
298
+ | **Execute with Context** | Include files as context | Code review, analysis |
299
+ | **Continue Session** | Continue last conversation | Multi-turn interactions |
300
+ | **Resume Session** | Resume specific session by ID | Continue after interruption |
301
+
302
+ <details>
303
+ <summary><b>📝 Detailed Parameters</b></summary>
304
+
305
+ ### Execute Prompt
306
+ - **Prompt** (required): Instruction for Claude Code
307
+ - **Model**: Claude model to use
308
+ - **Options**: Working directory, timeout, system prompt
309
+
310
+ ### Execute with Context
311
+ - **Prompt** (required): Instruction for Claude Code
312
+ - **Context Files**: File paths to include
313
+ - **Additional Directories**: Directory paths
314
+
315
+ ### Continue / Resume Session
316
+ - **Prompt** (required): Follow-up message
317
+ - **Session ID** (resume only): Previous session ID
318
+
319
+ </details>
320
+
321
+ ---
322
+
323
+ ## 💡 Use Cases
324
+
325
+ ### 🔍 MR/PR Code Review Agent
326
+
327
+ ```
328
+ ┌─────────────┐ ┌──────────────┐ ┌─────────────┐ ┌──────────────┐
329
+ │ GitLab │────▶│ Get Diff & │────▶│ Claude Code │────▶│ Post │
330
+ │ Webhook │ │ Files │ │ Review │ │ Comments │
331
+ └─────────────┘ └──────────────┘ └─────────────┘ └──────────────┘
332
+ ```
333
+
334
+ <details>
335
+ <summary><b>Workflow Steps</b></summary>
336
+
337
+ 1. **Trigger**: GitLab/GitHub webhook on new MR/PR
338
+ 2. **Fetch**: Get changed files and diff via API
339
+ 3. **Review**: Claude Code with `executeWithContext`
340
+ - *"Review this code. Check for bugs, security issues, suggest improvements."*
341
+ 4. **Post**: Send review comments back to GitLab/GitHub
342
+ 5. **Notify**: Alert team via Slack/Discord (optional)
343
+
344
+ </details>
345
+
346
+ ---
347
+
348
+ ### 🎧 Support Assistant
349
+
350
+ ```
351
+ ┌─────────────┐ ┌──────────────┐ ┌─────────────┐ ┌──────────────┐
352
+ │ Support │────▶│ Analyze │────▶│ Claude Code │────▶│ Respond │
353
+ │ Ticket │ │ Issue │ │ Solution │ │ or Route │
354
+ └─────────────┘ └──────────────┘ └─────────────┘ └──────────────┘
355
+ ```
356
+
357
+ <details>
358
+ <summary><b>Workflow Steps</b></summary>
359
+
360
+ 1. **Trigger**: Webhook from support system (Zendesk, Intercom)
361
+ 2. **Analyze**: Claude Code understands the issue
362
+ - *"User reports: [issue]. Analyze and suggest solution."*
363
+ 3. **Respond**: Send AI response back via API
364
+ 4. **Escalate**: Route complex issues to humans
365
+
366
+ </details>
367
+
368
+ ---
369
+
370
+ ### 📚 Auto Documentation
371
+
372
+ ```
373
+ ┌─────────────┐ ┌──────────────┐ ┌─────────────┐ ┌──────────────┐
374
+ │ Code │────▶│ Get Changed │────▶│ Claude Code │────▶│ Commit │
375
+ │ Push │ │ Files │ │ Gen Docs │ │ Docs │
376
+ └─────────────┘ └──────────────┘ └─────────────┘ └──────────────┘
377
+ ```
378
+
379
+ <details>
380
+ <summary><b>Workflow Steps</b></summary>
381
+
382
+ 1. **Trigger**: Webhook on code push to main
383
+ 2. **Identify**: Get list of changed files
384
+ 3. **Generate**: Claude Code generates documentation
385
+ - *"Generate docs for this code. Include descriptions, params, examples."*
386
+ 4. **Commit**: Create commit with updated docs
387
+ 5. **PR**: Optionally create a PR for review
388
+
389
+ </details>
390
+
391
+ ---
392
+
393
+ ### 🐛 Auto Bug Fixing
394
+
395
+ ```
396
+ ┌─────────────┐ ┌──────────────┐ ┌─────────────┐ ┌──────────────┐
397
+ │ Sentry │────▶│ Parse │────▶│ Claude Code │────▶│ Create PR │
398
+ │ Alert │ │ Stack Trace │ │ Fix Bug │ │ + Notify │
399
+ └─────────────┘ └──────────────┘ └─────────────┘ └──────────────┘
400
+ ```
401
+
402
+ <details>
403
+ <summary><b>Workflow Steps</b></summary>
404
+
405
+ 1. **Trigger**: Webhook from error monitoring (Sentry, Datadog)
406
+ 2. **Analyze**: Parse error stack trace
407
+ 3. **Fix**: Claude Code analyzes and fixes
408
+ - *"Error: [stack trace]. Analyze code and provide a fix."*
409
+ 4. **Test**: Run tests to validate
410
+ 5. **PR**: Create pull request with fix
411
+ 6. **Notify**: Alert team about automated fix
412
+
413
+ </details>
414
+
415
+ ---
416
+
417
+ ### 🤖 Cloud Coding Bots
418
+
419
+ Build AI coding assistants on any platform:
420
+
421
+ <table>
422
+ <tr>
423
+ <td align="center" width="25%">
424
+
425
+ **📱 Telegram**
426
+
427
+ ```
428
+ User ──▶ Bot ──▶ Claude
429
+ ──▶ Reply
430
+ ```
431
+
432
+ </td>
433
+ <td align="center" width="25%">
434
+
435
+ **💬 Slack**
436
+
437
+ ```
438
+ @bot ──▶ Fetch ──▶ Claude
439
+ ──▶ Thread
440
+ ```
441
+
442
+ </td>
443
+ <td align="center" width="25%">
444
+
445
+ **🎮 Discord**
446
+
447
+ ```
448
+ !help ──▶ Parse ──▶ Claude
449
+ ──▶ Embed
450
+ ```
451
+
452
+ </td>
453
+ <td align="center" width="25%">
454
+
455
+ **🦊 GitLab/GitHub**
456
+
457
+ ```
458
+ Comment ──▶ API ──▶ Claude
459
+ ──▶ Reply
460
+ ```
461
+
462
+ </td>
463
+ </tr>
464
+ </table>
465
+
466
+ <details>
467
+ <summary><b>Example: Telegram Bot</b></summary>
468
+
469
+ 1. **Trigger**: Telegram trigger on new message
470
+ 2. **Process**: Claude Code handles coding question
471
+ 3. **Reply**: Send response via Telegram node
472
+
473
+ </details>
474
+
475
+ <details>
476
+ <summary><b>Example: Slack Bot</b></summary>
477
+
478
+ 1. **Trigger**: Slack mention or slash command
479
+ 2. **Context**: Fetch relevant code from repos (optional)
480
+ 3. **Respond**: Post response to channel
481
+
482
+ </details>
483
+
484
+ <details>
485
+ <summary><b>Example: GitLab/GitHub Bot</b></summary>
486
+
487
+ 1. **Trigger**: Issue comment with keyword (e.g., `/claude`)
488
+ 2. **Analyze**: Fetch issue context and code
489
+ 3. **Comment**: Post Claude's analysis
490
+
491
+ </details>
492
+
493
+ ---
494
+
495
+ ## 📤 Output Structure
496
+
497
+ ```json
498
+ {
499
+ "success": true,
500
+ "sessionId": "550e8400-e29b-41d4-a716-446655440000",
501
+ "output": "Here's my analysis of the code...",
502
+ "exitCode": 0,
503
+ "duration": 15234,
504
+ "cost": 0.0523,
505
+ "numTurns": 3,
506
+ "usage": {
507
+ "inputTokens": 1250,
508
+ "outputTokens": 890
509
+ }
510
+ }
511
+ ```
512
+
513
+ | Field | Description |
514
+ |-------|-------------|
515
+ | `success` | ✅ Execution completed successfully |
516
+ | `sessionId` | 🔗 ID for continuing conversations |
517
+ | `output` | 📝 Response text from Claude Code |
518
+ | `cost` | 💰 Estimated cost in USD |
519
+ | `usage` | 📊 Token breakdown |
520
+
521
+ ---
522
+
523
+ ## 🔒 Security
524
+
525
+ <table>
526
+ <tr>
527
+ <td width="50%">
528
+
529
+ ### 🛡️ Tool Permissions
530
+
531
+ Control what Claude Code can do:
532
+
533
+ ```
534
+ ✅ Allowed: Read, Glob, Grep
535
+ ❌ Blocked: Bash(rm:*), Write(.env)
536
+ ```
537
+
538
+ </td>
539
+ <td width="50%">
540
+
541
+ ### 🐳 Isolation
542
+
543
+ - Use Docker containers
544
+ - Mount only needed directories
545
+ - Read-only mounts when possible
546
+
547
+ </td>
548
+ </tr>
549
+ </table>
550
+
551
+ <details>
552
+ <summary><b>🔐 Recommended Security Settings</b></summary>
553
+
554
+ **Disallow dangerous operations:**
555
+ - `Bash(rm:*)` - Prevent file deletion
556
+ - `Bash(sudo:*)` - No sudo access
557
+ - `Write(.env)` - Protect secrets
558
+ - `Bash(curl:*)` - Block network (if not needed)
559
+
560
+ **Isolation best practices:**
561
+ - Always set specific working directory
562
+ - Avoid `/` or home directories
563
+ - Create dedicated workspace per project
564
+
565
+ </details>
566
+
567
+ ---
568
+
569
+ ## 🤝 Contributing
570
+
571
+ Contributions welcome!
572
+
573
+ ```bash
574
+ # 1. Fork the repo
575
+ # 2. Create feature branch
576
+ git checkout -b feature/amazing-feature
577
+
578
+ # 3. Commit changes
579
+ git commit -m 'feat: add amazing feature'
580
+
581
+ # 4. Push & create PR
582
+ git push origin feature/amazing-feature
583
+ ```
584
+
585
+ ---
586
+
587
+ ## 📄 License
588
+
589
+ MIT License - see [LICENSE](LICENSE) for details.
590
+
591
+ ---
592
+
593
+ <div align="center">
594
+
595
+ **[GitHub](https://github.com/ThomasTartrau/n8n-nodes-claude-code-cli)** •
596
+ <!-- **[npm](https://www.npmjs.com/package/n8n-nodes-claude-code-cli)** • -->
597
+ **[n8n Community](https://community.n8n.io/)**
598
+
599
+ ---
600
+
601
+ Made with ❤️ for the n8n community
602
+
603
+ </div>
@@ -0,0 +1,9 @@
1
+ import type { ICredentialType, INodeProperties, Icon } from "n8n-workflow";
2
+ export declare class ClaudeCodeDockerApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ icon: Icon;
6
+ documentationUrl: string;
7
+ properties: INodeProperties[];
8
+ }
9
+ //# sourceMappingURL=ClaudeCodeDockerApi.credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClaudeCodeDockerApi.credentials.d.ts","sourceRoot":"","sources":["../../credentials/ClaudeCodeDockerApi.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE3E,qBAAa,mBAAoB,YAAW,eAAe;IAC1D,IAAI,SAAyB;IAC7B,WAAW,SAAwB;IACnC,IAAI,EAAE,IAAI,CAAiE;IAC3E,gBAAgB,SAC8C;IAE9D,UAAU,EAAE,eAAe,EAAE,CAuE3B;CACF"}