@sowonai/crewx-cli 0.4.0-dev.1
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 +529 -0
- package/dist/ai-provider.service.d.ts +36 -0
- package/dist/ai-provider.service.js +191 -0
- package/dist/ai-provider.service.js.map +1 -0
- package/dist/ai.service.d.ts +57 -0
- package/dist/ai.service.js +628 -0
- package/dist/ai.service.js.map +1 -0
- package/dist/app.module.d.ts +5 -0
- package/dist/app.module.js +103 -0
- package/dist/app.module.js.map +1 -0
- package/dist/cli/agent.handler.d.ts +2 -0
- package/dist/cli/agent.handler.js +140 -0
- package/dist/cli/agent.handler.js.map +1 -0
- package/dist/cli/chat.handler.d.ts +19 -0
- package/dist/cli/chat.handler.js +431 -0
- package/dist/cli/chat.handler.js.map +1 -0
- package/dist/cli/cli.handler.d.ts +4 -0
- package/dist/cli/cli.handler.js +97 -0
- package/dist/cli/cli.handler.js.map +1 -0
- package/dist/cli/doctor.handler.d.ts +36 -0
- package/dist/cli/doctor.handler.js +382 -0
- package/dist/cli/doctor.handler.js.map +1 -0
- package/dist/cli/execute.handler.d.ts +2 -0
- package/dist/cli/execute.handler.js +319 -0
- package/dist/cli/execute.handler.js.map +1 -0
- package/dist/cli/help.handler.d.ts +2 -0
- package/dist/cli/help.handler.js +10 -0
- package/dist/cli/help.handler.js.map +1 -0
- package/dist/cli/init.handler.d.ts +26 -0
- package/dist/cli/init.handler.js +450 -0
- package/dist/cli/init.handler.js.map +1 -0
- package/dist/cli/mcp.handler.d.ts +3 -0
- package/dist/cli/mcp.handler.js +121 -0
- package/dist/cli/mcp.handler.js.map +1 -0
- package/dist/cli/query.handler.d.ts +2 -0
- package/dist/cli/query.handler.js +380 -0
- package/dist/cli/query.handler.js.map +1 -0
- package/dist/cli/templates.handler.d.ts +2 -0
- package/dist/cli/templates.handler.js +100 -0
- package/dist/cli/templates.handler.js.map +1 -0
- package/dist/cli-options.d.ts +29 -0
- package/dist/cli-options.js +234 -0
- package/dist/cli-options.js.map +1 -0
- package/dist/config/timeout.config.d.ts +14 -0
- package/dist/config/timeout.config.js +34 -0
- package/dist/config/timeout.config.js.map +1 -0
- package/dist/conversation/base-conversation-history.provider.d.ts +12 -0
- package/dist/conversation/base-conversation-history.provider.js +45 -0
- package/dist/conversation/base-conversation-history.provider.js.map +1 -0
- package/dist/conversation/cli-conversation-history.provider.d.ts +16 -0
- package/dist/conversation/cli-conversation-history.provider.js +111 -0
- package/dist/conversation/cli-conversation-history.provider.js.map +1 -0
- package/dist/conversation/conversation-provider.factory.d.ts +10 -0
- package/dist/conversation/conversation-provider.factory.js +50 -0
- package/dist/conversation/conversation-provider.factory.js.map +1 -0
- package/dist/conversation/index.d.ts +6 -0
- package/dist/conversation/index.js +27 -0
- package/dist/conversation/index.js.map +1 -0
- package/dist/conversation/slack-conversation-history.provider.d.ts +28 -0
- package/dist/conversation/slack-conversation-history.provider.js +278 -0
- package/dist/conversation/slack-conversation-history.provider.js.map +1 -0
- package/dist/crewx.tool.d.ts +332 -0
- package/dist/crewx.tool.js +1461 -0
- package/dist/crewx.tool.js.map +1 -0
- package/dist/guards/bearer-auth.guard.d.ts +7 -0
- package/dist/guards/bearer-auth.guard.js +44 -0
- package/dist/guards/bearer-auth.guard.js.map +1 -0
- package/dist/health.controller.d.ts +6 -0
- package/dist/health.controller.js +32 -0
- package/dist/health.controller.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +267 -0
- package/dist/main.js.map +1 -0
- package/dist/mcp.controller.d.ts +8 -0
- package/dist/mcp.controller.js +62 -0
- package/dist/mcp.controller.js.map +1 -0
- package/dist/project.service.d.ts +44 -0
- package/dist/project.service.js +299 -0
- package/dist/project.service.js.map +1 -0
- package/dist/providers/base-ai.provider.d.ts +50 -0
- package/dist/providers/base-ai.provider.js +624 -0
- package/dist/providers/base-ai.provider.js.map +1 -0
- package/dist/providers/claude.provider.d.ts +25 -0
- package/dist/providers/claude.provider.js +362 -0
- package/dist/providers/claude.provider.js.map +1 -0
- package/dist/providers/codex.provider.d.ts +17 -0
- package/dist/providers/codex.provider.js +99 -0
- package/dist/providers/codex.provider.js.map +1 -0
- package/dist/providers/copilot.provider.d.ts +25 -0
- package/dist/providers/copilot.provider.js +266 -0
- package/dist/providers/copilot.provider.js.map +1 -0
- package/dist/providers/dynamic-provider.factory.d.ts +55 -0
- package/dist/providers/dynamic-provider.factory.js +586 -0
- package/dist/providers/dynamic-provider.factory.js.map +1 -0
- package/dist/providers/gemini.provider.d.ts +22 -0
- package/dist/providers/gemini.provider.js +147 -0
- package/dist/providers/gemini.provider.js.map +1 -0
- package/dist/services/agent-loader.service.d.ts +29 -0
- package/dist/services/agent-loader.service.js +370 -0
- package/dist/services/agent-loader.service.js.map +1 -0
- package/dist/services/auth.service.d.ts +9 -0
- package/dist/services/auth.service.js +47 -0
- package/dist/services/auth.service.js.map +1 -0
- package/dist/services/config-validator.service.d.ts +28 -0
- package/dist/services/config-validator.service.js +467 -0
- package/dist/services/config-validator.service.js.map +1 -0
- package/dist/services/config.service.d.ts +45 -0
- package/dist/services/config.service.js +180 -0
- package/dist/services/config.service.js.map +1 -0
- package/dist/services/context-enhancement.service.d.ts +13 -0
- package/dist/services/context-enhancement.service.js +169 -0
- package/dist/services/context-enhancement.service.js.map +1 -0
- package/dist/services/document-loader.service.d.ts +16 -0
- package/dist/services/document-loader.service.js +137 -0
- package/dist/services/document-loader.service.js.map +1 -0
- package/dist/services/help.service.d.ts +5 -0
- package/dist/services/help.service.js +117 -0
- package/dist/services/help.service.js.map +1 -0
- package/dist/services/intelligent-compression.service.d.ts +20 -0
- package/dist/services/intelligent-compression.service.js +179 -0
- package/dist/services/intelligent-compression.service.js.map +1 -0
- package/dist/services/mcp-client.service.d.ts +26 -0
- package/dist/services/mcp-client.service.js +81 -0
- package/dist/services/mcp-client.service.js.map +1 -0
- package/dist/services/parallel-processing.service.d.ts +108 -0
- package/dist/services/parallel-processing.service.js +268 -0
- package/dist/services/parallel-processing.service.js.map +1 -0
- package/dist/services/remote-agent.service.d.ts +49 -0
- package/dist/services/remote-agent.service.js +215 -0
- package/dist/services/remote-agent.service.js.map +1 -0
- package/dist/services/result-formatter.service.d.ts +27 -0
- package/dist/services/result-formatter.service.js +126 -0
- package/dist/services/result-formatter.service.js.map +1 -0
- package/dist/services/task-management.service.d.ts +63 -0
- package/dist/services/task-management.service.js +272 -0
- package/dist/services/task-management.service.js.map +1 -0
- package/dist/services/template.service.d.ts +36 -0
- package/dist/services/template.service.js +195 -0
- package/dist/services/template.service.js.map +1 -0
- package/dist/services/tool-call.service.d.ts +53 -0
- package/dist/services/tool-call.service.js +1061 -0
- package/dist/services/tool-call.service.js.map +1 -0
- package/dist/slack/formatters/message.formatter.d.ts +25 -0
- package/dist/slack/formatters/message.formatter.js +246 -0
- package/dist/slack/formatters/message.formatter.js.map +1 -0
- package/dist/slack/slack-bot.d.ts +24 -0
- package/dist/slack/slack-bot.js +467 -0
- package/dist/slack/slack-bot.js.map +1 -0
- package/dist/stderr.logger.d.ts +8 -0
- package/dist/stderr.logger.js +26 -0
- package/dist/stderr.logger.js.map +1 -0
- package/dist/utils/config-utils.d.ts +15 -0
- package/dist/utils/config-utils.js +69 -0
- package/dist/utils/config-utils.js.map +1 -0
- package/dist/utils/mcp-installer.d.ts +20 -0
- package/dist/utils/mcp-installer.js +199 -0
- package/dist/utils/mcp-installer.js.map +1 -0
- package/dist/utils/mention-parser.d.ts +18 -0
- package/dist/utils/mention-parser.js +136 -0
- package/dist/utils/mention-parser.js.map +1 -0
- package/dist/utils/simple-security.d.ts +3 -0
- package/dist/utils/simple-security.js +20 -0
- package/dist/utils/simple-security.js.map +1 -0
- package/dist/utils/stdin-utils.d.ts +27 -0
- package/dist/utils/stdin-utils.js +130 -0
- package/dist/utils/stdin-utils.js.map +1 -0
- package/dist/utils/template-processor.d.ts +32 -0
- package/dist/utils/template-processor.js +202 -0
- package/dist/utils/template-processor.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +17 -0
- package/dist/version.js.map +1 -0
- package/package.json +122 -0
package/README.md
ADDED
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
# SowonAI CrewX CLI
|
|
2
|
+
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
[](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
|
|
91
|
+
crewx agent list
|
|
92
|
+
|
|
93
|
+
# Get agent details
|
|
94
|
+
crewx agent info <agent-id>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### init
|
|
98
|
+
|
|
99
|
+
Initialize CrewX configuration:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
crewx init
|
|
103
|
+
crewx init --template development
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Creates `crewx.yaml` with default agents.
|
|
107
|
+
|
|
108
|
+
### doctor
|
|
109
|
+
|
|
110
|
+
Check system configuration:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
crewx doctor
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Verifies:
|
|
117
|
+
- AI CLI tools installation
|
|
118
|
+
- Configuration file
|
|
119
|
+
- Agent availability
|
|
120
|
+
- API keys setup
|
|
121
|
+
|
|
122
|
+
### mcp
|
|
123
|
+
|
|
124
|
+
Start MCP server for IDE integration:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
crewx mcp
|
|
128
|
+
crewx mcp --log
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### slack
|
|
132
|
+
|
|
133
|
+
Start Slack bot:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Read-only mode
|
|
137
|
+
crewx slack
|
|
138
|
+
|
|
139
|
+
# Allow file modifications
|
|
140
|
+
crewx slack --mode execute
|
|
141
|
+
|
|
142
|
+
# With debug logging
|
|
143
|
+
crewx slack --log
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
See [Slack Setup Guide](../../SLACK_INSTALL.md) for configuration.
|
|
147
|
+
|
|
148
|
+
### templates
|
|
149
|
+
|
|
150
|
+
Manage knowledge templates:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
crewx templates list
|
|
154
|
+
crewx templates info <template-name>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Configuration
|
|
158
|
+
|
|
159
|
+
### crewx.yaml
|
|
160
|
+
|
|
161
|
+
Create `crewx.yaml` in your project root:
|
|
162
|
+
|
|
163
|
+
```yaml
|
|
164
|
+
agents:
|
|
165
|
+
- id: "frontend_dev"
|
|
166
|
+
name: "React Expert"
|
|
167
|
+
provider: "cli/claude"
|
|
168
|
+
working_directory: "./src"
|
|
169
|
+
inline:
|
|
170
|
+
type: "agent"
|
|
171
|
+
system_prompt: |
|
|
172
|
+
You are a senior React developer.
|
|
173
|
+
Provide detailed examples and best practices.
|
|
174
|
+
|
|
175
|
+
- id: "backend_api"
|
|
176
|
+
name: "API Specialist"
|
|
177
|
+
provider: "cli/gemini"
|
|
178
|
+
inline:
|
|
179
|
+
type: "agent"
|
|
180
|
+
system_prompt: |
|
|
181
|
+
You are an expert in REST API design.
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Provider Configuration
|
|
185
|
+
|
|
186
|
+
Built-in providers:
|
|
187
|
+
|
|
188
|
+
```yaml
|
|
189
|
+
# Claude Code
|
|
190
|
+
provider: "cli/claude"
|
|
191
|
+
|
|
192
|
+
# Gemini CLI
|
|
193
|
+
provider: "cli/gemini"
|
|
194
|
+
|
|
195
|
+
# GitHub Copilot CLI
|
|
196
|
+
provider: "cli/copilot"
|
|
197
|
+
|
|
198
|
+
# Codex CLI
|
|
199
|
+
provider: "cli/codex"
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Plugin providers:
|
|
203
|
+
|
|
204
|
+
```yaml
|
|
205
|
+
providers:
|
|
206
|
+
- id: "ollama"
|
|
207
|
+
type: "plugin"
|
|
208
|
+
cli_command: "ollama"
|
|
209
|
+
default_model: "llama3"
|
|
210
|
+
query_args: ["run", "{model}"]
|
|
211
|
+
prompt_in_args: false
|
|
212
|
+
|
|
213
|
+
agents:
|
|
214
|
+
- id: "local_llama"
|
|
215
|
+
provider: "plugin/ollama"
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Remote Agents
|
|
219
|
+
|
|
220
|
+
Connect to other CrewX instances:
|
|
221
|
+
|
|
222
|
+
```yaml
|
|
223
|
+
providers:
|
|
224
|
+
- id: "backend_server"
|
|
225
|
+
type: "remote"
|
|
226
|
+
location: "http://api.example.com:3000"
|
|
227
|
+
external_agent_id: "backend_team"
|
|
228
|
+
|
|
229
|
+
agents:
|
|
230
|
+
- id: "remote_backend"
|
|
231
|
+
provider: "remote/backend_server"
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Usage Examples
|
|
235
|
+
|
|
236
|
+
### Basic Queries
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
# Single agent
|
|
240
|
+
crewx query "@claude what is this code doing?"
|
|
241
|
+
|
|
242
|
+
# Multiple agents
|
|
243
|
+
crewx query "@claude @gemini compare these approaches"
|
|
244
|
+
|
|
245
|
+
# With model override
|
|
246
|
+
crewx query "@claude:opus analyze in detail"
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### Execution
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
# Create files
|
|
253
|
+
crewx execute "@claude create a React component"
|
|
254
|
+
|
|
255
|
+
# Modify code
|
|
256
|
+
crewx execute "@gemini optimize this function"
|
|
257
|
+
|
|
258
|
+
# Multiple tasks
|
|
259
|
+
crewx execute "@claude create tests" "@gemini write docs"
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Pipeline Workflows
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
# Design then implement
|
|
266
|
+
crewx query "@architect design API" | \
|
|
267
|
+
crewx execute "@backend implement it"
|
|
268
|
+
|
|
269
|
+
# Multi-stage processing
|
|
270
|
+
cat requirements.txt | \
|
|
271
|
+
crewx query "@analyst prioritize" | \
|
|
272
|
+
crewx execute "@dev implement top 3"
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Thread-based Conversations
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
# Start conversation
|
|
279
|
+
crewx query "@claude design login" --thread "auth-feature"
|
|
280
|
+
|
|
281
|
+
# Continue conversation
|
|
282
|
+
crewx execute "@claude add password reset" --thread "auth-feature"
|
|
283
|
+
|
|
284
|
+
# Review conversation
|
|
285
|
+
crewx chat --thread "auth-feature"
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### Parallel Execution
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
# Multiple agents simultaneously
|
|
292
|
+
crewx execute \
|
|
293
|
+
"@frontend create UI" \
|
|
294
|
+
"@backend create API" \
|
|
295
|
+
"@devops setup CI"
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## Environment Variables
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
# Slack configuration
|
|
302
|
+
SLACK_BOT_TOKEN=xoxb-...
|
|
303
|
+
SLACK_SIGNING_SECRET=...
|
|
304
|
+
SLACK_APP_TOKEN=xapp-...
|
|
305
|
+
|
|
306
|
+
# MCP server port
|
|
307
|
+
PORT=3000
|
|
308
|
+
|
|
309
|
+
# Debug logging
|
|
310
|
+
DEBUG=crewx:*
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
## Architecture
|
|
314
|
+
|
|
315
|
+
The CLI is built on top of [@sowonai/crewx-sdk](../sdk/README.md):
|
|
316
|
+
|
|
317
|
+
```
|
|
318
|
+
packages/cli/
|
|
319
|
+
├── src/
|
|
320
|
+
│ ├── cli/ # Command handlers
|
|
321
|
+
│ │ ├── query.handler.ts
|
|
322
|
+
│ │ ├── execute.handler.ts
|
|
323
|
+
│ │ ├── chat.handler.ts
|
|
324
|
+
│ │ └── ...
|
|
325
|
+
│ ├── providers/ # AI provider implementations
|
|
326
|
+
│ │ ├── claude.provider.ts
|
|
327
|
+
│ │ ├── gemini.provider.ts
|
|
328
|
+
│ │ ├── copilot.provider.ts
|
|
329
|
+
│ │ └── codex.provider.ts
|
|
330
|
+
│ ├── services/ # Business logic
|
|
331
|
+
│ │ ├── ai.service.ts
|
|
332
|
+
│ │ ├── ai-provider.service.ts
|
|
333
|
+
│ │ ├── config.service.ts
|
|
334
|
+
│ │ └── ...
|
|
335
|
+
│ ├── slack/ # Slack integration
|
|
336
|
+
│ │ ├── slack-bot.ts
|
|
337
|
+
│ │ └── formatters/
|
|
338
|
+
│ ├── conversation/ # Conversation management
|
|
339
|
+
│ ├── guards/ # Security
|
|
340
|
+
│ └── utils/ # Utilities
|
|
341
|
+
└── tests/ # Tests
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
## Development
|
|
345
|
+
|
|
346
|
+
### Setup
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
# Install dependencies
|
|
350
|
+
npm install
|
|
351
|
+
|
|
352
|
+
# Build
|
|
353
|
+
npm run build
|
|
354
|
+
|
|
355
|
+
# Run CLI locally
|
|
356
|
+
npm run start
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### Testing
|
|
360
|
+
|
|
361
|
+
```bash
|
|
362
|
+
# Run tests
|
|
363
|
+
npm test
|
|
364
|
+
|
|
365
|
+
# Watch mode
|
|
366
|
+
npm run test:watch
|
|
367
|
+
|
|
368
|
+
# With coverage
|
|
369
|
+
npm run test:coverage
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
### Debugging
|
|
373
|
+
|
|
374
|
+
```bash
|
|
375
|
+
# Debug mode
|
|
376
|
+
npm run debug
|
|
377
|
+
|
|
378
|
+
# With environment variables
|
|
379
|
+
dotenv -e .env.test -- npm run dev
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
## API Integration
|
|
383
|
+
|
|
384
|
+
The CLI can be used as a library:
|
|
385
|
+
|
|
386
|
+
```typescript
|
|
387
|
+
import { AIService, ConfigService } from 'crewx';
|
|
388
|
+
|
|
389
|
+
// Use in your Node.js application
|
|
390
|
+
const aiService = new AIService(/* ... */);
|
|
391
|
+
const result = await aiService.queryAI('prompt', 'cli/claude');
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
## Plugins
|
|
395
|
+
|
|
396
|
+
### Creating a Plugin Provider
|
|
397
|
+
|
|
398
|
+
Add to `crewx.yaml`:
|
|
399
|
+
|
|
400
|
+
```yaml
|
|
401
|
+
providers:
|
|
402
|
+
- id: "my_tool"
|
|
403
|
+
type: "plugin"
|
|
404
|
+
cli_command: "my-cli"
|
|
405
|
+
default_model: "default"
|
|
406
|
+
query_args: ["query"]
|
|
407
|
+
execute_args: ["execute"]
|
|
408
|
+
prompt_in_args: true
|
|
409
|
+
stdin: true
|
|
410
|
+
|
|
411
|
+
agents:
|
|
412
|
+
- id: "my_agent"
|
|
413
|
+
provider: "plugin/my_tool"
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
### Plugin Options
|
|
417
|
+
|
|
418
|
+
- `cli_command`: Command to execute
|
|
419
|
+
- `default_model`: Default model name
|
|
420
|
+
- `query_args`: Arguments for query mode
|
|
421
|
+
- `execute_args`: Arguments for execute mode
|
|
422
|
+
- `prompt_in_args`: Pass prompt as argument
|
|
423
|
+
- `stdin`: Pass prompt via stdin
|
|
424
|
+
|
|
425
|
+
## Slack Integration
|
|
426
|
+
|
|
427
|
+
Full Slack integration with:
|
|
428
|
+
- Thread-based conversations
|
|
429
|
+
- Agent mentions (@claude, @gemini, etc.)
|
|
430
|
+
- Team collaboration
|
|
431
|
+
- Read-only or execute mode
|
|
432
|
+
|
|
433
|
+
See [Slack Setup Guide](../../SLACK_INSTALL.md) for details.
|
|
434
|
+
|
|
435
|
+
## MCP Server
|
|
436
|
+
|
|
437
|
+
CrewX can run as an MCP server for IDE integration:
|
|
438
|
+
|
|
439
|
+
```bash
|
|
440
|
+
crewx mcp
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
Add to your IDE's MCP configuration:
|
|
444
|
+
|
|
445
|
+
```json
|
|
446
|
+
{
|
|
447
|
+
"mcpServers": {
|
|
448
|
+
"crewx": {
|
|
449
|
+
"command": "crewx",
|
|
450
|
+
"args": ["mcp"]
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
## Troubleshooting
|
|
457
|
+
|
|
458
|
+
### Common Issues
|
|
459
|
+
|
|
460
|
+
**Command not found**
|
|
461
|
+
```bash
|
|
462
|
+
npm install -g crewx
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
**Configuration file not found**
|
|
466
|
+
```bash
|
|
467
|
+
crewx init
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
**Provider not available**
|
|
471
|
+
```bash
|
|
472
|
+
crewx doctor
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
See [Troubleshooting Guide](../../docs/troubleshooting.md) for more.
|
|
476
|
+
|
|
477
|
+
## Performance
|
|
478
|
+
|
|
479
|
+
The CLI is optimized for:
|
|
480
|
+
- Parallel agent execution
|
|
481
|
+
- Efficient context management
|
|
482
|
+
- Minimal memory footprint
|
|
483
|
+
- Fast startup time
|
|
484
|
+
|
|
485
|
+
## Security
|
|
486
|
+
|
|
487
|
+
- Bearer token authentication for remote agents
|
|
488
|
+
- Sandbox mode for plugin providers
|
|
489
|
+
- Security levels (low, medium, high)
|
|
490
|
+
- Execution mode guards
|
|
491
|
+
|
|
492
|
+
## Documentation
|
|
493
|
+
|
|
494
|
+
- [CLI Guide](../../docs/cli-guide.md) - Complete reference
|
|
495
|
+
- [Agent Configuration](../../docs/agent-configuration.md) - Configuration details
|
|
496
|
+
- [Remote Agents](../../docs/remote-agents.md) - Distributed setup
|
|
497
|
+
- [Template System](../../docs/templates.md) - Knowledge management
|
|
498
|
+
- [MCP Integration](../../docs/mcp-integration.md) - IDE setup
|
|
499
|
+
|
|
500
|
+
## Contributing
|
|
501
|
+
|
|
502
|
+
Contributions are welcome! Please follow these steps:
|
|
503
|
+
|
|
504
|
+
1. Fork the repository
|
|
505
|
+
2. Create a feature branch
|
|
506
|
+
3. Make your changes
|
|
507
|
+
4. Add tests
|
|
508
|
+
5. Run `npm test` and `npm run build`
|
|
509
|
+
6. Submit a pull request
|
|
510
|
+
|
|
511
|
+
See [Contributing Guide](../../CONTRIBUTING.md) for details.
|
|
512
|
+
|
|
513
|
+
## License
|
|
514
|
+
|
|
515
|
+
MIT License - See [LICENSE](../../LICENSE) for details.
|
|
516
|
+
|
|
517
|
+
## Support
|
|
518
|
+
|
|
519
|
+
- [GitHub Issues](https://github.com/sowonlabs/crewx/issues)
|
|
520
|
+
- [Documentation](../../docs/)
|
|
521
|
+
- [Main README](../../README.md)
|
|
522
|
+
|
|
523
|
+
## Related Packages
|
|
524
|
+
|
|
525
|
+
- [`@sowonai/crewx-sdk`](../sdk/README.md) - Core SDK for building custom integrations
|
|
526
|
+
|
|
527
|
+
---
|
|
528
|
+
|
|
529
|
+
Built by [SowonLabs](https://github.com/sowonlabs)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { OnModuleInit } from '@nestjs/common';
|
|
2
|
+
import { AIProvider, AIQueryOptions, AIResponse } from '@sowonai/crewx-sdk';
|
|
3
|
+
import { ClaudeProvider } from './providers/claude.provider';
|
|
4
|
+
import { CopilotProvider } from './providers/copilot.provider';
|
|
5
|
+
import { GeminiProvider } from './providers/gemini.provider';
|
|
6
|
+
import { CodexProvider } from './providers/codex.provider';
|
|
7
|
+
import { DynamicProviderFactory } from './providers/dynamic-provider.factory';
|
|
8
|
+
import { RemoteProviderConfig } from './providers/dynamic-provider.factory';
|
|
9
|
+
import { ConfigService } from './services/config.service';
|
|
10
|
+
export declare class AIProviderService implements OnModuleInit {
|
|
11
|
+
private readonly claudeProvider;
|
|
12
|
+
private readonly copilotProvider;
|
|
13
|
+
private readonly geminiProvider;
|
|
14
|
+
private readonly codexProvider;
|
|
15
|
+
private readonly dynamicProviderFactory;
|
|
16
|
+
private readonly configService;
|
|
17
|
+
private readonly logger;
|
|
18
|
+
private readonly providers;
|
|
19
|
+
private availableProviders;
|
|
20
|
+
constructor(claudeProvider: ClaudeProvider, copilotProvider: CopilotProvider, geminiProvider: GeminiProvider, codexProvider: CodexProvider, dynamicProviderFactory: DynamicProviderFactory, configService: ConfigService);
|
|
21
|
+
onModuleInit(): Promise<void>;
|
|
22
|
+
private loadPluginProviders;
|
|
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(): any[];
|
|
35
|
+
getRemoteProviders(): RemoteProviderConfig[];
|
|
36
|
+
}
|