@crewx/cli 0.8.0-rc.66 → 0.8.0-rc.82

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 (281) hide show
  1. package/bin/crewx +2 -0
  2. package/dist/bootstrap/crewx-cli.d.ts +11 -0
  3. package/dist/bootstrap/crewx-cli.js +31 -0
  4. package/dist/builtin.d.ts +15 -0
  5. package/dist/{cli/builtin.handler.js → builtin.js} +21 -7
  6. package/dist/commands/agent.d.ts +12 -0
  7. package/dist/commands/agent.js +246 -0
  8. package/dist/commands/doctor.d.ts +12 -0
  9. package/dist/commands/doctor.js +190 -0
  10. package/dist/commands/execute.d.ts +21 -0
  11. package/dist/commands/execute.js +117 -0
  12. package/dist/commands/hook/install.d.ts +21 -0
  13. package/dist/commands/hook/install.js +175 -0
  14. package/dist/commands/hook/paths.d.ts +19 -0
  15. package/dist/commands/hook/paths.js +94 -0
  16. package/dist/commands/hook/status.d.ts +7 -0
  17. package/dist/commands/hook/status.js +86 -0
  18. package/dist/commands/hook/uninstall.d.ts +8 -0
  19. package/dist/commands/hook/uninstall.js +71 -0
  20. package/dist/commands/hook-dispatch.d.ts +15 -0
  21. package/dist/commands/hook-dispatch.js +180 -0
  22. package/dist/commands/init.d.ts +24 -0
  23. package/dist/commands/init.js +133 -0
  24. package/dist/commands/kill.d.ts +12 -0
  25. package/dist/commands/kill.js +49 -0
  26. package/dist/commands/log.d.ts +13 -0
  27. package/dist/commands/log.js +97 -0
  28. package/dist/commands/parse-agent-message.d.ts +31 -0
  29. package/dist/commands/parse-agent-message.js +52 -0
  30. package/dist/commands/parse-common-flags.d.ts +36 -0
  31. package/dist/commands/parse-common-flags.js +105 -0
  32. package/dist/commands/ps.d.ts +12 -0
  33. package/dist/commands/ps.js +71 -0
  34. package/dist/commands/query.d.ts +21 -0
  35. package/dist/commands/query.js +117 -0
  36. package/dist/commands/result.d.ts +13 -0
  37. package/dist/commands/result.js +73 -0
  38. package/dist/commands/slack.d.ts +12 -0
  39. package/dist/commands/slack.js +559 -0
  40. package/dist/commands/task-db.d.ts +33 -0
  41. package/dist/commands/task-db.js +107 -0
  42. package/dist/examples/deny-secrets-plugin.d.ts +22 -0
  43. package/dist/examples/deny-secrets-plugin.js +40 -0
  44. package/dist/index.d.ts +1 -0
  45. package/dist/index.js +5 -0
  46. package/dist/logging.d.ts +21 -0
  47. package/dist/logging.js +86 -0
  48. package/dist/main.d.ts +10 -0
  49. package/dist/main.js +246 -256
  50. package/dist/plugins/examples/echo-hook.d.ts +24 -0
  51. package/dist/plugins/examples/echo-hook.js +60 -0
  52. package/dist/plugins/examples/verify-echo-hook.d.ts +8 -0
  53. package/dist/plugins/examples/verify-echo-hook.js +47 -0
  54. package/dist/plugins/sqlite-tracing.d.ts +13 -0
  55. package/dist/plugins/sqlite-tracing.js +20 -0
  56. package/dist/register-builtin-tools.d.ts +5 -0
  57. package/dist/register-builtin-tools.js +9 -0
  58. package/dist/slack/file-download.d.ts +17 -0
  59. package/dist/slack/file-download.js +134 -0
  60. package/dist/slack/markdown.d.ts +5 -0
  61. package/dist/slack/markdown.js +33 -0
  62. package/dist/utils/env-defaults.d.ts +5 -0
  63. package/dist/utils/env-defaults.js +10 -0
  64. package/dist/utils/version.d.ts +1 -0
  65. package/dist/utils/version.js +28 -0
  66. package/package.json +32 -115
  67. package/README.md +0 -663
  68. package/dist/ai-provider.service.d.ts +0 -36
  69. package/dist/ai-provider.service.js +0 -315
  70. package/dist/ai-provider.service.js.map +0 -1
  71. package/dist/ai.service.d.ts +0 -17
  72. package/dist/ai.service.js +0 -51
  73. package/dist/ai.service.js.map +0 -1
  74. package/dist/app.module.d.ts +0 -5
  75. package/dist/app.module.js +0 -165
  76. package/dist/app.module.js.map +0 -1
  77. package/dist/cli/agent.handler.d.ts +0 -2
  78. package/dist/cli/agent.handler.js +0 -186
  79. package/dist/cli/agent.handler.js.map +0 -1
  80. package/dist/cli/builtin.handler.d.ts +0 -3
  81. package/dist/cli/builtin.handler.js.map +0 -1
  82. package/dist/cli/chat.handler.d.ts +0 -20
  83. package/dist/cli/chat.handler.js +0 -446
  84. package/dist/cli/chat.handler.js.map +0 -1
  85. package/dist/cli/cli.handler.d.ts +0 -4
  86. package/dist/cli/cli.handler.js +0 -119
  87. package/dist/cli/cli.handler.js.map +0 -1
  88. package/dist/cli/doctor.handler.d.ts +0 -38
  89. package/dist/cli/doctor.handler.js +0 -495
  90. package/dist/cli/doctor.handler.js.map +0 -1
  91. package/dist/cli/execute.handler.d.ts +0 -2
  92. package/dist/cli/execute.handler.js +0 -376
  93. package/dist/cli/execute.handler.js.map +0 -1
  94. package/dist/cli/help.handler.d.ts +0 -2
  95. package/dist/cli/help.handler.js +0 -10
  96. package/dist/cli/help.handler.js.map +0 -1
  97. package/dist/cli/init.handler.d.ts +0 -26
  98. package/dist/cli/init.handler.js +0 -450
  99. package/dist/cli/init.handler.js.map +0 -1
  100. package/dist/cli/log.handler.d.ts +0 -2
  101. package/dist/cli/log.handler.js +0 -69
  102. package/dist/cli/log.handler.js.map +0 -1
  103. package/dist/cli/mcp.handler.d.ts +0 -3
  104. package/dist/cli/mcp.handler.js +0 -121
  105. package/dist/cli/mcp.handler.js.map +0 -1
  106. package/dist/cli/query.handler.d.ts +0 -2
  107. package/dist/cli/query.handler.js +0 -392
  108. package/dist/cli/query.handler.js.map +0 -1
  109. package/dist/cli/skill.handler.d.ts +0 -2
  110. package/dist/cli/skill.handler.js +0 -252
  111. package/dist/cli/skill.handler.js.map +0 -1
  112. package/dist/cli/slack-files.handler.d.ts +0 -2
  113. package/dist/cli/slack-files.handler.js +0 -291
  114. package/dist/cli/slack-files.handler.js.map +0 -1
  115. package/dist/cli/template.handler.d.ts +0 -2
  116. package/dist/cli/template.handler.js +0 -188
  117. package/dist/cli/template.handler.js.map +0 -1
  118. package/dist/cli/templates.handler.d.ts +0 -2
  119. package/dist/cli/templates.handler.js +0 -100
  120. package/dist/cli/templates.handler.js.map +0 -1
  121. package/dist/cli-options.d.ts +0 -40
  122. package/dist/cli-options.js +0 -371
  123. package/dist/cli-options.js.map +0 -1
  124. package/dist/config/timeout.config.d.ts +0 -14
  125. package/dist/config/timeout.config.js +0 -34
  126. package/dist/config/timeout.config.js.map +0 -1
  127. package/dist/conversation/base-conversation-history.provider.d.ts +0 -12
  128. package/dist/conversation/base-conversation-history.provider.js +0 -45
  129. package/dist/conversation/base-conversation-history.provider.js.map +0 -1
  130. package/dist/conversation/cli-box-reader.adapter.d.ts +0 -6
  131. package/dist/conversation/cli-box-reader.adapter.js +0 -10
  132. package/dist/conversation/cli-box-reader.adapter.js.map +0 -1
  133. package/dist/conversation/cli-conversation-history.provider.d.ts +0 -16
  134. package/dist/conversation/cli-conversation-history.provider.js +0 -112
  135. package/dist/conversation/cli-conversation-history.provider.js.map +0 -1
  136. package/dist/conversation/cli-task-reader.adapter.d.ts +0 -6
  137. package/dist/conversation/cli-task-reader.adapter.js +0 -25
  138. package/dist/conversation/cli-task-reader.adapter.js.map +0 -1
  139. package/dist/conversation/conversation-provider.factory.d.ts +0 -10
  140. package/dist/conversation/conversation-provider.factory.js +0 -50
  141. package/dist/conversation/conversation-provider.factory.js.map +0 -1
  142. package/dist/conversation/index.d.ts +0 -8
  143. package/dist/conversation/index.js +0 -29
  144. package/dist/conversation/index.js.map +0 -1
  145. package/dist/conversation/slack-conversation-history.provider.d.ts +0 -29
  146. package/dist/conversation/slack-conversation-history.provider.js +0 -302
  147. package/dist/conversation/slack-conversation-history.provider.js.map +0 -1
  148. package/dist/crewx.tool.d.ts +0 -360
  149. package/dist/crewx.tool.js +0 -2531
  150. package/dist/crewx.tool.js.map +0 -1
  151. package/dist/crewx.tool.spec.d.ts +0 -1
  152. package/dist/crewx.tool.spec.js +0 -222
  153. package/dist/crewx.tool.spec.js.map +0 -1
  154. package/dist/guards/bearer-auth.guard.d.ts +0 -7
  155. package/dist/guards/bearer-auth.guard.js +0 -44
  156. package/dist/guards/bearer-auth.guard.js.map +0 -1
  157. package/dist/health.controller.d.ts +0 -6
  158. package/dist/health.controller.js +0 -32
  159. package/dist/health.controller.js.map +0 -1
  160. package/dist/main.js.map +0 -1
  161. package/dist/mcp.controller.d.ts +0 -8
  162. package/dist/mcp.controller.js +0 -62
  163. package/dist/mcp.controller.js.map +0 -1
  164. package/dist/package.json +0 -3
  165. package/dist/providers/dynamic-provider.factory.d.ts +0 -17
  166. package/dist/providers/dynamic-provider.factory.js +0 -138
  167. package/dist/providers/dynamic-provider.factory.js.map +0 -1
  168. package/dist/providers/logger.adapter.d.ts +0 -7
  169. package/dist/providers/logger.adapter.js +0 -107
  170. package/dist/providers/logger.adapter.js.map +0 -1
  171. package/dist/services/agent-loader.service.d.ts +0 -35
  172. package/dist/services/agent-loader.service.js +0 -623
  173. package/dist/services/agent-loader.service.js.map +0 -1
  174. package/dist/services/auth.service.d.ts +0 -9
  175. package/dist/services/auth.service.js +0 -47
  176. package/dist/services/auth.service.js.map +0 -1
  177. package/dist/services/config-validator.service.d.ts +0 -29
  178. package/dist/services/config-validator.service.js +0 -483
  179. package/dist/services/config-validator.service.js.map +0 -1
  180. package/dist/services/config.service.d.ts +0 -45
  181. package/dist/services/config.service.js +0 -352
  182. package/dist/services/config.service.js.map +0 -1
  183. package/dist/services/document-loader.service.d.ts +0 -26
  184. package/dist/services/document-loader.service.js +0 -186
  185. package/dist/services/document-loader.service.js.map +0 -1
  186. package/dist/services/help.service.d.ts +0 -5
  187. package/dist/services/help.service.js +0 -139
  188. package/dist/services/help.service.js.map +0 -1
  189. package/dist/services/intelligent-compression.service.d.ts +0 -20
  190. package/dist/services/intelligent-compression.service.js +0 -179
  191. package/dist/services/intelligent-compression.service.js.map +0 -1
  192. package/dist/services/mcp-client.service.d.ts +0 -26
  193. package/dist/services/mcp-client.service.js +0 -81
  194. package/dist/services/mcp-client.service.js.map +0 -1
  195. package/dist/services/parallel-processing.service.d.ts +0 -108
  196. package/dist/services/parallel-processing.service.js +0 -333
  197. package/dist/services/parallel-processing.service.js.map +0 -1
  198. package/dist/services/provider-bridge.service.d.ts +0 -35
  199. package/dist/services/provider-bridge.service.js +0 -224
  200. package/dist/services/provider-bridge.service.js.map +0 -1
  201. package/dist/services/remote-agent.service.d.ts +0 -50
  202. package/dist/services/remote-agent.service.js +0 -171
  203. package/dist/services/remote-agent.service.js.map +0 -1
  204. package/dist/services/result-formatter.service.d.ts +0 -27
  205. package/dist/services/result-formatter.service.js +0 -126
  206. package/dist/services/result-formatter.service.js.map +0 -1
  207. package/dist/services/skill-loader.service.d.ts +0 -15
  208. package/dist/services/skill-loader.service.js +0 -278
  209. package/dist/services/skill-loader.service.js.map +0 -1
  210. package/dist/services/skill.service.d.ts +0 -69
  211. package/dist/services/skill.service.js +0 -779
  212. package/dist/services/skill.service.js.map +0 -1
  213. package/dist/services/skill.service.spec.d.ts +0 -1
  214. package/dist/services/skill.service.spec.js +0 -168
  215. package/dist/services/skill.service.spec.js.map +0 -1
  216. package/dist/services/task-management.service.d.ts +0 -71
  217. package/dist/services/task-management.service.js +0 -324
  218. package/dist/services/task-management.service.js.map +0 -1
  219. package/dist/services/template.service.d.ts +0 -61
  220. package/dist/services/template.service.js +0 -416
  221. package/dist/services/template.service.js.map +0 -1
  222. package/dist/services/tool-call.service.d.ts +0 -16
  223. package/dist/services/tool-call.service.js +0 -302
  224. package/dist/services/tool-call.service.js.map +0 -1
  225. package/dist/services/tracing.service.d.ts +0 -197
  226. package/dist/services/tracing.service.js +0 -1267
  227. package/dist/services/tracing.service.js.map +0 -1
  228. package/dist/slack/formatters/message.formatter.d.ts +0 -43
  229. package/dist/slack/formatters/message.formatter.js +0 -505
  230. package/dist/slack/formatters/message.formatter.js.map +0 -1
  231. package/dist/slack/services/slack-file-download.service.d.ts +0 -58
  232. package/dist/slack/services/slack-file-download.service.js +0 -558
  233. package/dist/slack/services/slack-file-download.service.js.map +0 -1
  234. package/dist/slack/slack-bot.d.ts +0 -33
  235. package/dist/slack/slack-bot.js +0 -568
  236. package/dist/slack/slack-bot.js.map +0 -1
  237. package/dist/stderr.logger.d.ts +0 -8
  238. package/dist/stderr.logger.js +0 -26
  239. package/dist/stderr.logger.js.map +0 -1
  240. package/dist/types/usage.types.d.ts +0 -107
  241. package/dist/types/usage.types.js +0 -3
  242. package/dist/types/usage.types.js.map +0 -1
  243. package/dist/utils/config-utils.d.ts +0 -15
  244. package/dist/utils/config-utils.js +0 -69
  245. package/dist/utils/config-utils.js.map +0 -1
  246. package/dist/utils/extract-text.d.ts +0 -1
  247. package/dist/utils/extract-text.js +0 -15
  248. package/dist/utils/extract-text.js.map +0 -1
  249. package/dist/utils/mcp-installer.d.ts +0 -20
  250. package/dist/utils/mcp-installer.js +0 -199
  251. package/dist/utils/mcp-installer.js.map +0 -1
  252. package/dist/utils/project-hash.d.ts +0 -6
  253. package/dist/utils/project-hash.js +0 -70
  254. package/dist/utils/project-hash.js.map +0 -1
  255. package/dist/utils/simple-security.d.ts +0 -3
  256. package/dist/utils/simple-security.js +0 -20
  257. package/dist/utils/simple-security.js.map +0 -1
  258. package/dist/utils/stdin-utils.d.ts +0 -6
  259. package/dist/utils/stdin-utils.js +0 -109
  260. package/dist/utils/stdin-utils.js.map +0 -1
  261. package/dist/utils/template-processor.d.ts +0 -27
  262. package/dist/utils/template-processor.js +0 -395
  263. package/dist/utils/template-processor.js.map +0 -1
  264. package/dist/utils/terminal-message-formatter.d.ts +0 -23
  265. package/dist/utils/terminal-message-formatter.js +0 -136
  266. package/dist/utils/terminal-message-formatter.js.map +0 -1
  267. package/dist/version.d.ts +0 -1
  268. package/dist/version.js +0 -17
  269. package/dist/version.js.map +0 -1
  270. package/dist/workspace.service.d.ts +0 -44
  271. package/dist/workspace.service.js +0 -299
  272. package/dist/workspace.service.js.map +0 -1
  273. package/scripts/backfill-tokens.js +0 -218
  274. package/scripts/postbuild-cli.mjs +0 -88
  275. package/scripts/postinstall-cli.mjs +0 -30
  276. package/templates/agents/default.yaml +0 -490
  277. package/templates/agents/minimal.yaml +0 -16
  278. package/templates/documents/conversation-history-default.hbs +0 -17
  279. package/templates/documents/crewx-manual.md +0 -2278
  280. package/templates/documents/crewx-quick-guide.md +0 -147
  281. package/templates/versions.json +0 -19
package/README.md DELETED
@@ -1,663 +0,0 @@
1
- # SowonAI CrewX CLI
2
-
3
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
- [![npm version](https://badge.fury.io/js/crewx.svg)](https://www.npmjs.com/package/crewx)
5
-
6
- Bring Your Own AI (BYOA) team in Slack/IDE with your existing subscriptions. Transform Claude, Gemini, Codex, and Copilot into a collaborative development team.
7
-
8
- ## Overview
9
-
10
- SowonAI CrewX CLI is the full-featured command-line interface for SowonAI CrewX, providing:
11
-
12
- - **CLI Mode**: Direct terminal usage with `crewx query` and `crewx execute`
13
- - **Slack Mode**: Team collaboration with AI agents in Slack channels
14
- - **MCP Server Mode**: IDE integration (VS Code, Claude Desktop, Cursor)
15
- - **Remote Agents**: Distributed AI teams across projects
16
- - **Plugin System**: Transform any CLI tool into an AI agent
17
-
18
- ## Installation
19
-
20
- ```bash
21
- npm install -g crewx
22
- ```
23
-
24
- ## Quick Start
25
-
26
- ```bash
27
- # Initialize
28
- crewx init
29
-
30
- # Check system
31
- crewx doctor
32
-
33
- # Try it out
34
- crewx query "@claude analyze my code"
35
- crewx execute "@claude create a login component"
36
- ```
37
-
38
- ## Commands
39
-
40
- ### query
41
-
42
- Read-only analysis and information retrieval:
43
-
44
- ```bash
45
- crewx query "@claude explain this function"
46
- crewx query "@gemini search for latest news"
47
- crewx query "@claude @gemini compare approaches"
48
- ```
49
-
50
- **Options:**
51
- - `-t, --thread <id>`: Continue conversation in thread
52
- - `-m, --model <model>`: Override agent's default model
53
- - `--timeout <ms>`: Set timeout in milliseconds
54
- - `--log`: Enable debug logging
55
-
56
- ### execute
57
-
58
- Create or modify files and run operations:
59
-
60
- ```bash
61
- crewx execute "@claude implement user authentication"
62
- crewx execute "@gemini optimize performance"
63
- ```
64
-
65
- **Options:**
66
- - `-t, --thread <id>`: Continue conversation in thread
67
- - `-m, --model <model>`: Override agent's default model
68
- - `--timeout <ms>`: Set timeout in milliseconds
69
- - `--log`: Enable debug logging
70
-
71
- ### chat
72
-
73
- Interactive conversation mode:
74
-
75
- ```bash
76
- crewx chat
77
- crewx chat --thread "my-session"
78
- ```
79
-
80
- **Options:**
81
- - `-t, --thread <id>`: Thread ID for conversation
82
- - `--agent <id>`: Default agent to use
83
- - `--log`: Enable debug logging
84
-
85
- ### agent
86
-
87
- Manage agents:
88
-
89
- ```bash
90
- # List all agents (default behavior)
91
- crewx agent
92
-
93
- # List all agents (explicit)
94
- crewx agent ls
95
- crewx agent list
96
- ```
97
-
98
- ### init
99
-
100
- Initialize CrewX configuration:
101
-
102
- ```bash
103
- crewx init
104
- crewx init --template development
105
- ```
106
-
107
- Creates `crewx.yaml` with default agents.
108
-
109
- ### doctor
110
-
111
- Check system configuration:
112
-
113
- ```bash
114
- crewx doctor
115
- ```
116
-
117
- Verifies:
118
- - AI CLI tools installation
119
- - Configuration file
120
- - Agent availability
121
- - API keys setup
122
-
123
- ### log
124
-
125
- View task execution logs:
126
-
127
- ```bash
128
- # List all task logs (default behavior)
129
- crewx log
130
-
131
- # List all task logs (explicit)
132
- crewx log ls
133
-
134
- # View specific task log
135
- crewx log task_1234567890_abcdef
136
- ```
137
-
138
- Task logs include:
139
- - Execution status and duration
140
- - Provider and agent information
141
- - Full command output
142
- - Error messages (if any)
143
-
144
- ### mcp
145
-
146
- Start MCP server for IDE integration:
147
-
148
- ```bash
149
- crewx mcp
150
- crewx mcp --log
151
- ```
152
-
153
- ### slack
154
-
155
- Start Slack bot:
156
-
157
- ```bash
158
- # Read-only mode
159
- crewx slack
160
-
161
- # Allow file modifications
162
- crewx slack --mode execute
163
-
164
- # With debug logging
165
- crewx slack --log
166
- ```
167
-
168
- See [Slack Setup Guide](../../docs/slack-install.md) for configuration.
169
-
170
- ### templates
171
-
172
- Manage knowledge templates:
173
-
174
- ```bash
175
- crewx templates list
176
- crewx templates info <template-name>
177
- ```
178
-
179
- ## Configuration
180
-
181
- ### crewx.yaml
182
-
183
- Create `crewx.yaml` in your project root:
184
-
185
- ```yaml
186
- agents:
187
- - id: "frontend_dev"
188
- name: "React Expert"
189
- provider: "cli/claude"
190
- working_directory: "./src"
191
- inline:
192
- type: "agent"
193
- system_prompt: |
194
- You are a senior React developer.
195
- Provide detailed examples and best practices.
196
-
197
- - id: "backend_api"
198
- name: "API Specialist"
199
- provider: "cli/gemini"
200
- inline:
201
- type: "agent"
202
- system_prompt: |
203
- You are an expert in REST API design.
204
- ```
205
-
206
- ### Provider Configuration
207
-
208
- Built-in providers:
209
-
210
- ```yaml
211
- # Claude Code
212
- provider: "cli/claude"
213
-
214
- # Gemini CLI
215
- provider: "cli/gemini"
216
-
217
- # GitHub Copilot CLI
218
- provider: "cli/copilot"
219
-
220
- # Codex CLI
221
- provider: "cli/codex"
222
- ```
223
-
224
- Plugin providers:
225
-
226
- ```yaml
227
- providers:
228
- - id: "ollama"
229
- type: "plugin"
230
- cli_command: "ollama"
231
- default_model: "llama3"
232
- query_args: ["run", "{model}"]
233
- prompt_in_args: false
234
-
235
- agents:
236
- - id: "local_llama"
237
- provider: "plugin/ollama"
238
- ```
239
-
240
- ### Remote Agents
241
-
242
- Connect to other CrewX instances:
243
-
244
- ```yaml
245
- providers:
246
- - id: "backend_server"
247
- type: "remote"
248
- location: "http://api.example.com:3000"
249
- external_agent_id: "backend_team"
250
-
251
- agents:
252
- - id: "remote_backend"
253
- provider: "remote/backend_server"
254
- ```
255
-
256
- ## Usage Examples
257
-
258
- ### Basic Queries
259
-
260
- ```bash
261
- # Single agent
262
- crewx query "@claude what is this code doing?"
263
-
264
- # Multiple agents
265
- crewx query "@claude @gemini compare these approaches"
266
-
267
- # With model override
268
- crewx query "@claude:opus analyze in detail"
269
- ```
270
-
271
- ### Execution
272
-
273
- ```bash
274
- # Create files
275
- crewx execute "@claude create a React component"
276
-
277
- # Modify code
278
- crewx execute "@gemini optimize this function"
279
-
280
- # Multiple tasks
281
- crewx execute "@claude create tests" "@gemini write docs"
282
- ```
283
-
284
- ### Pipeline Workflows
285
-
286
- ```bash
287
- # Design then implement
288
- crewx query "@architect design API" | \
289
- crewx execute "@backend implement it"
290
-
291
- # Multi-stage processing
292
- cat requirements.txt | \
293
- crewx query "@analyst prioritize" | \
294
- crewx execute "@dev implement top 3"
295
- ```
296
-
297
- ### Thread-based Conversations
298
-
299
- ```bash
300
- # Start conversation
301
- crewx query "@claude design login" --thread "auth-feature"
302
-
303
- # Continue conversation
304
- crewx execute "@claude add password reset" --thread "auth-feature"
305
-
306
- # Review conversation
307
- crewx chat --thread "auth-feature"
308
- ```
309
-
310
- ### Parallel Execution
311
-
312
- ```bash
313
- # Multiple agents simultaneously
314
- crewx execute \
315
- "@frontend create UI" \
316
- "@backend create API" \
317
- "@devops setup CI"
318
- ```
319
-
320
- ## Environment Variables
321
-
322
- ### Slack Configuration
323
-
324
- | Variable | Default | Description |
325
- |----------|---------|-------------|
326
- | `SLACK_BOT_TOKEN` | - | Slack Bot Token (required for Slack integration) |
327
- | `SLACK_SIGNING_SECRET` | - | Slack Signing Secret (required for Slack integration) |
328
- | `SLACK_APP_TOKEN` | - | Slack App Token (required for Socket Mode) |
329
- | `SLACK_MAX_RESPONSE_LENGTH` | `400000` | Maximum total response length (characters) |
330
- | `SLACK_MAX_BLOCK_SIZE` | `2900` | Maximum characters per block (max: 3000) |
331
-
332
- ### CrewX Configuration
333
-
334
- | Variable | Default | Description |
335
- |----------|---------|-------------|
336
- | `CREWX_DEBUG` | - | Enable debug logging |
337
- | `CREWX_CONFIG` | - | Custom path to crewx.yaml configuration file |
338
- | `CREWX_PROVIDER` | - | Default AI provider |
339
- | `CREWX_SLACK_LOG_CONVERSATIONS` | `false` | Enable Slack conversation logging |
340
- | `CREWX_ENABLE_REMOTE_TEMPLATES` | `false` | Enable remote template repository |
341
- | `CREWX_TEMPLATE_REPO` | - | Remote template repository URL |
342
-
343
- ### Provider Timeout Configuration (milliseconds)
344
-
345
- | Variable | Default | Description |
346
- |----------|---------|-------------|
347
- | `CREWCODE_TIMEOUT_CLAUDE_EXECUTE` | - | Claude execute mode timeout |
348
- | `CREWCODE_TIMEOUT_CLAUDE_QUERY` | - | Claude query mode timeout |
349
- | `CREWCODE_TIMEOUT_GEMINI_EXECUTE` | - | Gemini execute mode timeout |
350
- | `CREWCODE_TIMEOUT_GEMINI_QUERY` | - | Gemini query mode timeout |
351
- | `CREWCODE_TIMEOUT_COPILOT_EXECUTE` | - | Copilot execute mode timeout |
352
- | `CREWCODE_TIMEOUT_COPILOT_QUERY` | - | Copilot query mode timeout |
353
-
354
- ### Other Configuration
355
-
356
- | Variable | Default | Description |
357
- |----------|---------|-------------|
358
- | `PORT` | `3000` | MCP server port |
359
- | `DEBUG` | - | Debug namespace (e.g., `crewx:*`) |
360
-
361
- ### Usage Examples
362
-
363
- **Slack Bot with Custom Limits:**
364
- ```bash
365
- export SLACK_BOT_TOKEN=xoxb-your-token
366
- export SLACK_SIGNING_SECRET=your-secret
367
- export SLACK_APP_TOKEN=xapp-your-app-token
368
- export SLACK_MAX_RESPONSE_LENGTH=500000
369
- export SLACK_MAX_BLOCK_SIZE=2800
370
-
371
- crewx slack --log
372
- ```
373
-
374
- **Custom Configuration Path:**
375
- ```bash
376
- export CREWX_CONFIG=/path/to/custom/crewx.yaml
377
- crewx query "@claude analyze this"
378
- ```
379
-
380
- **Provider Timeout Configuration:**
381
- ```bash
382
- # Set longer timeout for complex execute tasks
383
- export CREWCODE_TIMEOUT_CLAUDE_EXECUTE=600000 # 10 minutes
384
- export CREWCODE_TIMEOUT_CLAUDE_QUERY=180000 # 3 minutes
385
-
386
- crewx execute "@claude complex task"
387
- ```
388
-
389
- **Debug Logging:**
390
- ```bash
391
- # Enable all CrewX debug logs
392
- export DEBUG=crewx:*
393
- export CREWX_DEBUG=true
394
-
395
- crewx query "@claude test"
396
- ```
397
-
398
- **Using .env File:**
399
- Create a `.env.slack` file:
400
- ```env
401
- SLACK_BOT_TOKEN=xoxb-your-token
402
- SLACK_SIGNING_SECRET=your-secret
403
- SLACK_APP_TOKEN=xapp-your-app-token
404
- SLACK_MAX_RESPONSE_LENGTH=400000
405
- SLACK_MAX_BLOCK_SIZE=2900
406
- CREWX_SLACK_LOG_CONVERSATIONS=true
407
- ```
408
-
409
- Then load it:
410
- ```bash
411
- source .env.slack
412
- npm run start:slack
413
- ```
414
-
415
- ## Architecture
416
-
417
- The CLI is built on top of [@crewx/sdk](../sdk/README.md):
418
-
419
- ```
420
- packages/cli/
421
- ├── src/
422
- │ ├── cli/ # Command handlers
423
- │ │ ├── query.handler.ts
424
- │ │ ├── execute.handler.ts
425
- │ │ ├── chat.handler.ts
426
- │ │ └── ...
427
- │ ├── providers/ # CLI-specific provider utilities
428
- │ │ ├── dynamic-provider.factory.ts # Security wrapper over SDK dynamic providers
429
- │ │ └── logger.adapter.ts # Nest logger adapter for SDK providers
430
- │ ├── services/ # Business logic
431
- │ │ ├── ai.service.ts
432
- │ │ ├── ai-provider.service.ts
433
- │ │ ├── remote-agent.service.ts # Uses SDK RemoteAgentManager
434
- │ │ └── ...
435
- │ ├── slack/ # Slack integration
436
- │ │ ├── slack-bot.ts
437
- │ │ └── formatters/
438
- │ │ └── message.formatter.ts # Extends SDK BaseMessageFormatter
439
- │ ├── conversation/ # Conversation management
440
- │ ├── guards/ # Security
441
- │ └── utils/ # Utilities
442
- └── tests/ # Tests
443
- ```
444
-
445
- ### SDK Integration
446
-
447
- The CLI uses SDK components as a foundation, adding NestJS integration and platform-specific features:
448
-
449
- #### Message Formatting
450
- - **SDK**: `BaseMessageFormatter` provides core formatting logic
451
- - **CLI**: `SlackMessageFormatter` extends SDK base with Slack-specific features (emoji, blocks, markdown)
452
-
453
- #### AI Providers
454
- - **SDK**: `BaseAIProvider`, `ClaudeProvider`, `GeminiProvider`, `CopilotProvider`, `CodexProvider`
455
- - **CLI**: NestJS `@Injectable()` wrappers that:
456
- - Inject NestJS logger via `LoggerAdapter`
457
- - Integrate with `AIService` and `ConfigService`
458
- - Add platform-specific tool execution
459
-
460
- #### Remote Agents
461
- - **SDK**: `RemoteAgentManager` handles remote communication
462
- - **CLI**: `RemoteAgentService` wraps SDK manager with:
463
- - NestJS dependency injection
464
- - Agent configuration loading
465
- - Tool name mapping
466
- - MCP protocol integration
467
-
468
- #### Benefits
469
- 1. **Reusable Core**: SDK components work in any Node.js environment
470
- 2. **Clean Separation**: Platform logic (NestJS, Slack) stays in CLI
471
- 3. **Testability**: SDK tests verify core logic, CLI tests verify integration
472
- 4. **Extensibility**: Custom integrations can use SDK directly
473
-
474
- ## Development
475
-
476
- ### Setup
477
-
478
- ```bash
479
- # Install dependencies
480
- npm install
481
-
482
- # Build
483
- npm run build
484
-
485
- # Run CLI locally
486
- npm run start
487
- ```
488
-
489
- ### Testing
490
-
491
- ```bash
492
- # Run tests
493
- npm test
494
-
495
- # Watch mode
496
- npm run test:watch
497
-
498
- # With coverage
499
- npm run test:coverage
500
- ```
501
-
502
- ### Debugging
503
-
504
- ```bash
505
- # Debug mode
506
- npm run debug
507
-
508
- # With environment variables
509
- dotenv -e .env.test -- npm run dev
510
- ```
511
-
512
- ## API Integration
513
-
514
- The CLI can be used as a library:
515
-
516
- ```typescript
517
- import { AIService, ConfigService } from 'crewx';
518
-
519
- // Use in your Node.js application
520
- const aiService = new AIService(/* ... */);
521
- const result = await aiService.queryAI('prompt', 'cli/claude');
522
- ```
523
-
524
- ## Plugins
525
-
526
- ### Creating a Plugin Provider
527
-
528
- Add to `crewx.yaml`:
529
-
530
- ```yaml
531
- providers:
532
- - id: "my_tool"
533
- type: "plugin"
534
- cli_command: "my-cli"
535
- default_model: "default"
536
- query_args: ["query"]
537
- execute_args: ["execute"]
538
- prompt_in_args: true
539
- stdin: true
540
-
541
- agents:
542
- - id: "my_agent"
543
- provider: "plugin/my_tool"
544
- ```
545
-
546
- ### Plugin Options
547
-
548
- - `cli_command`: Command to execute
549
- - `default_model`: Default model name
550
- - `query_args`: Arguments for query mode
551
- - `execute_args`: Arguments for execute mode
552
- - `prompt_in_args`: Pass prompt as argument
553
- - `stdin`: Pass prompt via stdin
554
-
555
- ## Slack Integration
556
-
557
- Full Slack integration with:
558
- - Thread-based conversations
559
- - Agent mentions (@claude, @gemini, etc.)
560
- - Team collaboration
561
- - Read-only or execute mode
562
-
563
- See [Slack Setup Guide](../../docs/slack-install.md) for details.
564
-
565
- ## MCP Server
566
-
567
- CrewX can run as an MCP server for IDE integration:
568
-
569
- ```bash
570
- crewx mcp
571
- ```
572
-
573
- Add to your IDE's MCP configuration:
574
-
575
- ```json
576
- {
577
- "mcpServers": {
578
- "crewx": {
579
- "command": "crewx",
580
- "args": ["mcp"]
581
- }
582
- }
583
- }
584
- ```
585
-
586
- ## Troubleshooting
587
-
588
- ### Common Issues
589
-
590
- **Command not found**
591
- ```bash
592
- npm install -g crewx
593
- ```
594
-
595
- **Configuration file not found**
596
- ```bash
597
- crewx init
598
- ```
599
-
600
- **Provider not available**
601
- ```bash
602
- crewx doctor
603
- ```
604
-
605
- See [Troubleshooting Guide](../../docs/troubleshooting.md) for more.
606
-
607
- ## Performance
608
-
609
- The CLI is optimized for:
610
- - Parallel agent execution
611
- - Efficient context management
612
- - Minimal memory footprint
613
- - Fast startup time
614
-
615
- ## Security
616
-
617
- - Bearer token authentication for remote agents
618
- - Sandbox mode for plugin providers
619
- - Security levels (low, medium, high)
620
- - Execution mode guards
621
-
622
- ## Documentation
623
-
624
- - [CLI Guide](../../docs/cli-guide.md) - Complete reference
625
- - [Agent Configuration](../../docs/agent-configuration.md) - Configuration details
626
- - [Remote Agents](../../docs/remote-agents.md) - Distributed setup
627
- - [Template System](../../docs/templates.md) - Knowledge management
628
- - [Template Variables](../../docs/template-variables.md) - Dynamic variables and TemplateContext usage
629
- - [Context Integration Standard](../../packages/docs/context-integration-standard.md) - TemplateContext pipeline and layout responsibilities
630
- - [Context Migration Guide](../../packages/docs/context-integration-migration.md) - Upgrade steps for custom agents
631
- - [Layout DSL Reference](../../packages/docs/layout-dsl-field-reference.md) - Layout fields, props, and helpers
632
- - [MCP Integration](../../docs/mcp-integration.md) - IDE setup
633
-
634
- ## Contributing
635
-
636
- Contributions are welcome! Please follow these steps:
637
-
638
- 1. Fork the repository
639
- 2. Create a feature branch
640
- 3. Make your changes
641
- 4. Add tests
642
- 5. Run `npm test` and `npm run build`
643
- 6. Submit a pull request
644
-
645
- See [Contributing Guide](../../CONTRIBUTING.md) for details.
646
-
647
- ## License
648
-
649
- MIT License - See [LICENSE](../../LICENSE) for details.
650
-
651
- ## Support
652
-
653
- - [GitHub Issues](https://github.com/sowonlabs/crewx/issues)
654
- - [Documentation](../../docs/)
655
- - [Main README](../../README.md)
656
-
657
- ## Related Packages
658
-
659
- - [`@crewx/sdk`](../sdk/README.md) - Core SDK for building custom integrations
660
-
661
- ---
662
-
663
- Built by [SowonLabs](https://github.com/sowonlabs)
@@ -1,36 +0,0 @@
1
- import { OnModuleInit } from '@nestjs/common';
2
- import { AIProvider, AIQueryOptions, AIResponse, type PluginProviderConfig, type RemoteProviderConfig } from '@crewx/sdk';
3
- import { DynamicProviderFactory } from './providers/dynamic-provider.factory';
4
- import { ConfigService } from './services/config.service';
5
- import { ToolCallService } from './services/tool-call.service';
6
- import { TracingService } from './services/tracing.service';
7
- import { TaskManagementService } from './services/task-management.service';
8
- export declare class AIProviderService implements OnModuleInit {
9
- private readonly toolCallService;
10
- private readonly dynamicProviderFactory;
11
- private readonly configService;
12
- private readonly tracingService?;
13
- private readonly taskManagementService?;
14
- private readonly logger;
15
- private readonly providers;
16
- private availableProviders;
17
- private readonly builtInProviderNames;
18
- constructor(toolCallService: ToolCallService, dynamicProviderFactory: DynamicProviderFactory, configService: ConfigService, tracingService?: TracingService | undefined, taskManagementService?: TaskManagementService | undefined);
19
- onModuleInit(): Promise<void>;
20
- private createBuiltInProviders;
21
- private loadPluginProviders;
22
- private loadAPIProviders;
23
- reloadPluginProviders(): Promise<void>;
24
- private registerProvider;
25
- initializeProviders(): Promise<void>;
26
- queryAI(prompt: string, providerName?: string, options?: AIQueryOptions): Promise<AIResponse>;
27
- executeAI(prompt: string, providerName: string, options?: AIQueryOptions): Promise<AIResponse>;
28
- getAvailableProviders(): string[];
29
- checkAvailableProviders(): Promise<string[]>;
30
- getProvider(name: string): AIProvider | undefined;
31
- validateCLIInstallation(): Promise<{
32
- [key: string]: boolean;
33
- }>;
34
- getPluginProviders(): PluginProviderConfig[];
35
- getRemoteProviders(): RemoteProviderConfig[];
36
- }