openwork-agent 1.0.0 ā 1.0.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 +181 -412
- package/bin/openwork-agent.js +3 -0
- package/package.json +18 -22
- package/src/generators/ProjectGenerator.js +2 -2
- package/src/index.js +59 -103
- package/src/main.js +0 -8
package/README.md
CHANGED
|
@@ -1,436 +1,205 @@
|
|
|
1
|
-
# OpenWork Agent
|
|
2
|
-
|
|
3
1
|
<div align="center">
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-

|
|
7
|
-

|
|
8
|
-

|
|
9
|
-
|
|
10
|
-
**AI-powered backend code generator for any technology stack**
|
|
11
|
-
|
|
12
|
-
Create complete backend projects with just a few commands! š
|
|
13
|
-
|
|
14
|
-
[Install](#-installation) ⢠[Quick Start](#-quick-start) ⢠[Documentation](#-documentation) ⢠[Contributing](#-contributing)
|
|
15
|
-
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## ⨠Features
|
|
21
|
-
|
|
22
|
-
- š **Multiple Technologies**: Node.js, Python, Java, Go, Rust, PHP, and more
|
|
23
|
-
- šÆ **Popular Frameworks**: Express, FastAPI, Spring Boot, Gin, Actix, Laravel, etc.
|
|
24
|
-
- šļø **Database Support**: MongoDB, PostgreSQL, MySQL, SQLite, Redis
|
|
25
|
-
- š³ **Docker Support**: Automatic Dockerfile and docker-compose generation
|
|
26
|
-
- š **CI/CD Ready**: GitHub Actions workflow generation
|
|
27
|
-
- š¬ **Interactive Mode**: Guided project setup with prompts
|
|
28
|
-
- š **Template System**: Customizable templates for any stack
|
|
29
|
-
- š **Technology Detection**: Analyze existing projects
|
|
30
|
-
- š”ļø **Best Practices**: Security, logging, error handling, CORS
|
|
31
|
-
|
|
32
|
-
## š¦ Installation
|
|
33
|
-
|
|
34
|
-
### Global Installation (Recommended)
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
npm install -g openwork-agent
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Local Installation
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
npm install openwork-agent
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Using Yarn
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
yarn global add openwork-agent
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### Using pnpm
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
pnpm add -g openwork-agent
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## š Quick Start
|
|
3
|
+
<h1>š OpenWork Agent</h1>
|
|
59
4
|
|
|
60
|
-
|
|
5
|
+
<p>
|
|
6
|
+
<img src="https://img.shields.io/npm/v/openwork-agent" />
|
|
7
|
+
<img src="https://img.shields.io/npm/dw/openwork-agent" />
|
|
8
|
+
<img src="https://img.shields.io/npm/l/openwork-agent" />
|
|
9
|
+
</p>
|
|
61
10
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
11
|
+
<p>
|
|
12
|
+
<strong>AI-powered backend code generator for any technology stack</strong>
|
|
13
|
+
</p>
|
|
65
14
|
|
|
66
|
-
|
|
15
|
+
<p>
|
|
16
|
+
Generate <strong>production-ready backend projects in seconds</strong><br/>
|
|
17
|
+
with Docker, CI/CD, authentication, security, and best practices.
|
|
18
|
+
</p>
|
|
67
19
|
|
|
68
|
-
|
|
69
|
-
openwork-agent create my-fastapi-app --tech python --framework fastapi --database postgresql
|
|
70
|
-
```
|
|
20
|
+
<pre><code>npx openwork-agent create my-api</code></pre>
|
|
71
21
|
|
|
72
|
-
|
|
22
|
+
<p>
|
|
23
|
+
<a href="#installation">Installation</a> ā¢
|
|
24
|
+
<a href="#quick-start">Quick Start</a> ā¢
|
|
25
|
+
<a href="#supported-technologies">Technologies</a> ā¢
|
|
26
|
+
<a href="#contributing">Contributing</a>
|
|
27
|
+
</p>
|
|
73
28
|
|
|
74
|
-
|
|
75
|
-
openwork-agent create my-enterprise-app --tech node --framework express --database mongodb --docker --tests
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### 4. List Available Templates
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
openwork-agent templates
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### 5. Analyze Existing Project
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
cd existing-project
|
|
88
|
-
openwork-agent analyze
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## š Supported Technologies
|
|
29
|
+
</div>
|
|
92
30
|
|
|
93
|
-
|
|
94
|
-
- **Frameworks**: Express.js, NestJS, Fastify, Koa, Hapi
|
|
95
|
-
- **Databases**: MongoDB (Mongoose), PostgreSQL, MySQL, SQLite
|
|
96
|
-
- **Features**: TypeScript, JWT auth, validation, testing
|
|
31
|
+
<hr/>
|
|
97
32
|
|
|
98
|
-
|
|
99
|
-
- **Frameworks**: FastAPI, Django, Flask, Tornado, AioHTTP
|
|
100
|
-
- **Databases**: MongoDB (Motor), PostgreSQL (asyncpg), MySQL, SQLite
|
|
101
|
-
- **Features**: Pydantic validation, async/await, Swagger docs
|
|
33
|
+
<h2>ā What Problem Does OpenWork Agent Solve?</h2>
|
|
102
34
|
|
|
103
|
-
|
|
104
|
-
- **Frameworks**: Spring Boot, Quarkus, Micronaut, Vert.x
|
|
105
|
-
- **Databases**: MongoDB, PostgreSQL, MySQL, Oracle
|
|
106
|
-
- **Features**: Spring Data, REST controllers, JPA, testing
|
|
35
|
+
<p>Backend setup usually means:</p>
|
|
107
36
|
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
37
|
+
<ul>
|
|
38
|
+
<li>Copy-pasting boilerplate from random GitHub repositories</li>
|
|
39
|
+
<li>Manually configuring Docker, databases, and CI/CD</li>
|
|
40
|
+
<li>Forgetting security, testing, or best practices</li>
|
|
41
|
+
</ul>
|
|
112
42
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
### PHP
|
|
119
|
-
- **Frameworks**: Laravel, Symfony, Slim
|
|
120
|
-
- **Databases**: MySQL, PostgreSQL, SQLite
|
|
121
|
-
- **Features**: Eloquent ORM, middleware, routing
|
|
122
|
-
|
|
123
|
-
## š Usage Examples
|
|
124
|
-
|
|
125
|
-
### Node.js with Express and MongoDB
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
openwork-agent create blog-api --tech node --framework express --database mongodb --docker
|
|
129
|
-
```
|
|
43
|
+
<p>
|
|
44
|
+
<strong>OpenWork Agent solves this in one command.</strong><br/>
|
|
45
|
+
You get a clean, scalable, and secure backend instantly ā ready for development or production.
|
|
46
|
+
</p>
|
|
130
47
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
build: .
|
|
273
|
-
ports:
|
|
274
|
-
- "3000:3000"
|
|
275
|
-
depends_on:
|
|
276
|
-
- mongodb
|
|
277
|
-
environment:
|
|
278
|
-
- DATABASE_URL=mongodb://mongodb:27017/myapp
|
|
279
|
-
|
|
280
|
-
mongodb:
|
|
281
|
-
image: mongo:7.0
|
|
282
|
-
ports:
|
|
283
|
-
- "27017:27017"
|
|
284
|
-
volumes:
|
|
285
|
-
- mongodb_data:/data/db
|
|
286
|
-
|
|
287
|
-
volumes:
|
|
288
|
-
mongodb_data:
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
## š§Ŗ Testing
|
|
292
|
-
|
|
293
|
-
Generated projects include comprehensive test setups:
|
|
294
|
-
|
|
295
|
-
### Node.js
|
|
296
|
-
```bash
|
|
297
|
-
npm test # Run tests
|
|
298
|
-
npm run test:watch # Watch mode
|
|
299
|
-
npm run test:coverage # Coverage report
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
### Python
|
|
303
|
-
```bash
|
|
304
|
-
pytest # Run tests
|
|
305
|
-
pytest --cov # Coverage report
|
|
306
|
-
pytest -v # Verbose output
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
### Java
|
|
310
|
-
```bash
|
|
311
|
-
mvn test # Run tests
|
|
312
|
-
mvn verify # Run with integration tests
|
|
313
|
-
```
|
|
314
|
-
|
|
315
|
-
### Go
|
|
316
|
-
```bash
|
|
317
|
-
go test ./... # Run all tests
|
|
318
|
-
go test -v ./... # Verbose output
|
|
319
|
-
go test -cover ./... # Coverage report
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
### Rust
|
|
323
|
-
```bash
|
|
324
|
-
cargo test # Run tests
|
|
325
|
-
cargo test -- --nocapture # Verbose output
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
## š Security Features
|
|
329
|
-
|
|
330
|
-
- **Input Validation**: Comprehensive validation using appropriate libraries
|
|
331
|
-
- **SQL Injection Prevention**: ORM usage with parameterized queries
|
|
332
|
-
- **XSS Protection**: Content Security Policy and input sanitization
|
|
333
|
-
- **CORS Configuration**: Proper CORS setup for APIs
|
|
334
|
-
- **Security Headers**: Helmet.js (Node.js) or equivalent
|
|
335
|
-
- **JWT Authentication**: Secure token-based authentication
|
|
336
|
-
- **Rate Limiting**: Built-in rate limiting support
|
|
337
|
-
|
|
338
|
-
## š Performance Features
|
|
339
|
-
|
|
340
|
-
- **Connection Pooling**: Database connection management
|
|
341
|
-
- **Caching**: Redis integration support
|
|
342
|
-
- **Async Operations**: Full async/await support where applicable
|
|
343
|
-
- **Compression**: Gzip/Brotli compression
|
|
344
|
-
- **Error Handling**: Comprehensive error handling and logging
|
|
345
|
-
- **Health Checks**: Application health monitoring
|
|
346
|
-
|
|
347
|
-
## š Deployment
|
|
348
|
-
|
|
349
|
-
### Heroku
|
|
350
|
-
```bash
|
|
351
|
-
heroku create your-app-name
|
|
352
|
-
git push heroku main
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
### Vercel
|
|
356
|
-
```bash
|
|
357
|
-
npm i -g vercel
|
|
358
|
-
vercel --prod
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
### Railway
|
|
362
|
-
```bash
|
|
363
|
-
railway login
|
|
364
|
-
railway init
|
|
365
|
-
railway up
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
### AWS
|
|
369
|
-
```bash
|
|
370
|
-
# Using Docker
|
|
371
|
-
docker build -t my-app .
|
|
372
|
-
docker run -p 3000:3000 my-app
|
|
373
|
-
```
|
|
374
|
-
|
|
375
|
-
## š¤ Contributing
|
|
376
|
-
|
|
377
|
-
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
378
|
-
|
|
379
|
-
### Development Setup
|
|
380
|
-
|
|
381
|
-
```bash
|
|
382
|
-
git clone https://github.com/openwork-agent/openwork-agent.git
|
|
48
|
+
<hr/>
|
|
49
|
+
|
|
50
|
+
<h2>⨠Key Features</h2>
|
|
51
|
+
|
|
52
|
+
<ul>
|
|
53
|
+
<li>š Multi-language & multi-framework support</li>
|
|
54
|
+
<li>šÆ Production-ready project structure</li>
|
|
55
|
+
<li>šļø Database integration out of the box</li>
|
|
56
|
+
<li>š³ Docker & docker-compose included</li>
|
|
57
|
+
<li>š CI/CD with GitHub Actions</li>
|
|
58
|
+
<li>š Authentication, validation & security defaults</li>
|
|
59
|
+
<li>š¬ Interactive & CLI-based usage</li>
|
|
60
|
+
<li>š Customizable template system</li>
|
|
61
|
+
</ul>
|
|
62
|
+
|
|
63
|
+
<hr/>
|
|
64
|
+
|
|
65
|
+
<h2 id="installation">š¦ Installation</h2>
|
|
66
|
+
|
|
67
|
+
<h3>Quick Run (Recommended)</h3>
|
|
68
|
+
<pre><code>npx openwork-agent create my-api</code></pre>
|
|
69
|
+
|
|
70
|
+
<h3>Global Install</h3>
|
|
71
|
+
<pre><code>npm install -g openwork-agent</code></pre>
|
|
72
|
+
|
|
73
|
+
<h3>Yarn / pnpm</h3>
|
|
74
|
+
<pre><code>yarn global add openwork-agent
|
|
75
|
+
pnpm add -g openwork-agent</code></pre>
|
|
76
|
+
|
|
77
|
+
<hr/>
|
|
78
|
+
|
|
79
|
+
<h2 id="quick-start">š Quick Start</h2>
|
|
80
|
+
|
|
81
|
+
<h3>Interactive Mode</h3>
|
|
82
|
+
<pre><code>openwork-agent create my-awesome-api</code></pre>
|
|
83
|
+
|
|
84
|
+
<h3>Specific Tech Stack</h3>
|
|
85
|
+
<pre><code>openwork-agent create my-fastapi-app \
|
|
86
|
+
--tech python \
|
|
87
|
+
--framework fastapi \
|
|
88
|
+
--database postgresql
|
|
89
|
+
</code></pre>
|
|
90
|
+
|
|
91
|
+
<h3>Docker + Tests</h3>
|
|
92
|
+
<pre><code>openwork-agent create enterprise-api \
|
|
93
|
+
--tech node \
|
|
94
|
+
--framework express \
|
|
95
|
+
--database mongodb \
|
|
96
|
+
--docker \
|
|
97
|
+
--tests
|
|
98
|
+
</code></pre>
|
|
99
|
+
|
|
100
|
+
<hr/>
|
|
101
|
+
|
|
102
|
+
<h2 id="supported-technologies">š§° Supported Technologies</h2>
|
|
103
|
+
|
|
104
|
+
<h3>JavaScript / Node.js</h3>
|
|
105
|
+
<ul>
|
|
106
|
+
<li>Express, NestJS, Fastify</li>
|
|
107
|
+
<li>MongoDB, PostgreSQL, MySQL</li>
|
|
108
|
+
</ul>
|
|
109
|
+
|
|
110
|
+
<h3>Python</h3>
|
|
111
|
+
<ul>
|
|
112
|
+
<li>FastAPI, Django, Flask</li>
|
|
113
|
+
<li>PostgreSQL, MongoDB</li>
|
|
114
|
+
</ul>
|
|
115
|
+
|
|
116
|
+
<h3>Java</h3>
|
|
117
|
+
<ul>
|
|
118
|
+
<li>Spring Boot, Quarkus</li>
|
|
119
|
+
<li>MySQL, PostgreSQL</li>
|
|
120
|
+
</ul>
|
|
121
|
+
|
|
122
|
+
<h3>Go</h3>
|
|
123
|
+
<ul>
|
|
124
|
+
<li>Gin, Echo</li>
|
|
125
|
+
</ul>
|
|
126
|
+
|
|
127
|
+
<h3>Rust</h3>
|
|
128
|
+
<ul>
|
|
129
|
+
<li>Actix-web, Axum</li>
|
|
130
|
+
</ul>
|
|
131
|
+
|
|
132
|
+
<h3>PHP</h3>
|
|
133
|
+
<ul>
|
|
134
|
+
<li>Laravel, Symfony</li>
|
|
135
|
+
</ul>
|
|
136
|
+
|
|
137
|
+
<hr/>
|
|
138
|
+
|
|
139
|
+
<h2>š Why Choose OpenWork Agent?</h2>
|
|
140
|
+
|
|
141
|
+
<table>
|
|
142
|
+
<thead>
|
|
143
|
+
<tr>
|
|
144
|
+
<th>Feature</th>
|
|
145
|
+
<th>OpenWork Agent</th>
|
|
146
|
+
<th>Yeoman</th>
|
|
147
|
+
<th>Manual Setup</th>
|
|
148
|
+
</tr>
|
|
149
|
+
</thead>
|
|
150
|
+
<tbody>
|
|
151
|
+
<tr>
|
|
152
|
+
<td>Multi-language</td>
|
|
153
|
+
<td>ā
</td>
|
|
154
|
+
<td>ā</td>
|
|
155
|
+
<td>ā</td>
|
|
156
|
+
</tr>
|
|
157
|
+
<tr>
|
|
158
|
+
<td>Docker ready</td>
|
|
159
|
+
<td>ā
</td>
|
|
160
|
+
<td>ā</td>
|
|
161
|
+
<td>ā</td>
|
|
162
|
+
</tr>
|
|
163
|
+
<tr>
|
|
164
|
+
<td>CI/CD included</td>
|
|
165
|
+
<td>ā
</td>
|
|
166
|
+
<td>ā</td>
|
|
167
|
+
<td>ā</td>
|
|
168
|
+
</tr>
|
|
169
|
+
<tr>
|
|
170
|
+
<td>Security defaults</td>
|
|
171
|
+
<td>ā
</td>
|
|
172
|
+
<td>ā</td>
|
|
173
|
+
<td>ā</td>
|
|
174
|
+
</tr>
|
|
175
|
+
<tr>
|
|
176
|
+
<td>AI-assisted</td>
|
|
177
|
+
<td>ā
</td>
|
|
178
|
+
<td>ā</td>
|
|
179
|
+
<td>ā</td>
|
|
180
|
+
</tr>
|
|
181
|
+
</tbody>
|
|
182
|
+
</table>
|
|
183
|
+
|
|
184
|
+
<hr/>
|
|
185
|
+
|
|
186
|
+
<h2 id="contributing">š¤ Contributing</h2>
|
|
187
|
+
|
|
188
|
+
<pre><code>git clone https://github.com/openwork-agent/openwork-agent.git
|
|
383
189
|
cd openwork-agent
|
|
384
190
|
npm install
|
|
385
191
|
npm test
|
|
386
192
|
npm link
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
### Adding New Templates
|
|
390
|
-
|
|
391
|
-
1. Create template files in `src/templates/{technology}/`
|
|
392
|
-
2. Add framework support in `TechDetector.js`
|
|
393
|
-
3. Update configuration in generators
|
|
394
|
-
4. Add tests and documentation
|
|
395
|
-
|
|
396
|
-
## š License
|
|
193
|
+
</code></pre>
|
|
397
194
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
## š Acknowledgments
|
|
401
|
-
|
|
402
|
-
- Built with ā¤ļø for the developer community
|
|
403
|
-
- Thanks to all the amazing open-source projects
|
|
404
|
-
- Inspired by the need for rapid backend development
|
|
405
|
-
|
|
406
|
-
## š Support
|
|
407
|
-
|
|
408
|
-
- š§ Email: [manoj.sharma@example.com](mailto:manoj.sharma@example.com)
|
|
409
|
-
- š¼ LinkedIn: [Manoj Sharma](https://linkedin.com/in/manoj-sharma)
|
|
410
|
-
- š Issues: [GitHub Issues](https://github.com/manoj1234-ms/openwork-agent/issues)
|
|
411
|
-
- š Documentation: [GitHub README](https://github.com/manoj1234-ms/openwork-agent#readme)
|
|
412
|
-
|
|
413
|
-
## šŗļø Roadmap
|
|
414
|
-
|
|
415
|
-
- [ ] GraphQL template support
|
|
416
|
-
- [ ] Frontend template generation
|
|
417
|
-
- [ ] Microservice templates
|
|
418
|
-
- [ ] Real-time features (WebSocket)
|
|
419
|
-
- [ ] Advanced authentication patterns
|
|
420
|
-
- [ ] Monitoring and observability
|
|
421
|
-
- [ ] Cloud deployment templates
|
|
422
|
-
- [ ] Template marketplace
|
|
423
|
-
|
|
424
|
-
---
|
|
195
|
+
<hr/>
|
|
425
196
|
|
|
426
197
|
<div align="center">
|
|
427
198
|
|
|
428
|
-
|
|
199
|
+
<p><strong>ā Star this repo if it helped you!</strong></p>
|
|
429
200
|
|
|
430
|
-
|
|
201
|
+
<p>
|
|
202
|
+
Built with ā¤ļø by <strong>Manoj Sharma</strong>
|
|
203
|
+
</p>
|
|
431
204
|
|
|
432
|
-
|
|
433
|
-
[](https://github.com/openwork-agent/openwork-agent)
|
|
434
|
-
[](https://github.com/openwork-agent/openwork-agent/issues)
|
|
435
|
-
|
|
436
|
-
</div>
|
|
205
|
+
</div>
|
package/package.json
CHANGED
|
@@ -1,43 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openwork-agent",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "AI-powered backend code generator for any technology stack. Create complete backend projects with just a few commands!",
|
|
5
|
-
"
|
|
5
|
+
"bin": {
|
|
6
|
+
"openwork-agent": "./bin/openwork-agent.js"
|
|
7
|
+
},
|
|
6
8
|
"files": [
|
|
7
|
-
"bin/",
|
|
8
9
|
"src/",
|
|
9
10
|
"templates/",
|
|
10
11
|
"README.md",
|
|
11
12
|
"LICENSE"
|
|
12
13
|
],
|
|
13
14
|
"scripts": {
|
|
14
|
-
"start": "node src/
|
|
15
|
-
"dev": "node src/
|
|
15
|
+
"start": "node src/main.js",
|
|
16
|
+
"dev": "node src/main.js",
|
|
16
17
|
"test": "jest",
|
|
17
18
|
"lint": "eslint src/**/*.js",
|
|
18
|
-
"prepare": "echo
|
|
19
|
+
"prepare": "echo \"Package ready for publishing\""
|
|
19
20
|
},
|
|
20
21
|
"keywords": [
|
|
21
|
-
"
|
|
22
|
+
"cli",
|
|
22
23
|
"backend",
|
|
23
|
-
"
|
|
24
|
+
"code-generator",
|
|
24
25
|
"scaffold",
|
|
25
|
-
"
|
|
26
|
+
"boilerplate",
|
|
27
|
+
"starter",
|
|
28
|
+
"api",
|
|
26
29
|
"nodejs",
|
|
27
30
|
"python",
|
|
28
31
|
"java",
|
|
29
32
|
"go",
|
|
30
33
|
"rust",
|
|
31
34
|
"typescript",
|
|
32
|
-
"mern",
|
|
33
|
-
"mean",
|
|
34
35
|
"fullstack",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"template",
|
|
38
|
-
"code-generator",
|
|
39
|
-
"automation",
|
|
40
|
-
"developer-tools"
|
|
36
|
+
"developer-tools",
|
|
37
|
+
"automation"
|
|
41
38
|
],
|
|
42
39
|
"author": {
|
|
43
40
|
"name": "Manoj Sharma",
|
|
@@ -65,12 +62,11 @@
|
|
|
65
62
|
"yaml": "^2.3.1"
|
|
66
63
|
},
|
|
67
64
|
"devDependencies": {
|
|
68
|
-
"@babel/core": "^7.28.6",
|
|
69
|
-
"@babel/preset-env": "^7.28.6",
|
|
70
|
-
"babel-jest": "^30.2.0",
|
|
71
|
-
"dotenv": "^17.2.3",
|
|
72
65
|
"eslint": "^8.42.0",
|
|
73
|
-
"jest": "^29.5.0"
|
|
66
|
+
"jest": "^29.5.0",
|
|
67
|
+
"babel-jest": "^29.5.0",
|
|
68
|
+
"@babel/core": "^7.28.6",
|
|
69
|
+
"@babel/preset-env": "^7.28.6"
|
|
74
70
|
},
|
|
75
71
|
"engines": {
|
|
76
72
|
"node": ">=14.0.0"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const inquirer = require('inquirer');
|
|
1
|
+
const inquirer = require('inquirer').default;
|
|
2
2
|
const chalk = require('chalk');
|
|
3
3
|
const ora = require('ora');
|
|
4
4
|
const fs = require('fs-extra');
|
|
@@ -31,7 +31,7 @@ class ProjectGenerator {
|
|
|
31
31
|
name: `${tech.toUpperCase()} - ${recommended[tech]?.reason || 'Popular backend technology'}`,
|
|
32
32
|
value: tech
|
|
33
33
|
})),
|
|
34
|
-
|
|
34
|
+
{ name: 'āāāāāāāāāāāāāā', disabled: true }
|
|
35
35
|
]
|
|
36
36
|
});
|
|
37
37
|
}
|
package/src/index.js
CHANGED
|
@@ -1,152 +1,108 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
1
|
const { Command } = require('commander');
|
|
4
|
-
const inquirer = require('inquirer');
|
|
5
2
|
const chalk = require('chalk');
|
|
6
|
-
const fs = require('fs-extra');
|
|
7
|
-
const path = require('path');
|
|
8
3
|
|
|
9
|
-
const ProjectGenerator = require('./generators');
|
|
4
|
+
const ProjectGenerator = require('./generators/ProjectGenerator');
|
|
10
5
|
const TechDetector = require('./core/TechDetector');
|
|
11
|
-
const FileManager = require('./utils/FileManager');
|
|
12
6
|
|
|
13
7
|
const program = new Command();
|
|
14
8
|
|
|
9
|
+
/**
|
|
10
|
+
* CLI metadata
|
|
11
|
+
*/
|
|
15
12
|
program
|
|
16
13
|
.name('openwork-agent')
|
|
17
14
|
.description('AI-powered backend code generator for any technology stack')
|
|
18
15
|
.version('1.0.0');
|
|
19
16
|
|
|
17
|
+
/**
|
|
18
|
+
* CREATE COMMAND
|
|
19
|
+
*/
|
|
20
20
|
program
|
|
21
|
-
.command('create <
|
|
21
|
+
.command('create <projectName>')
|
|
22
22
|
.description('Create a new backend project')
|
|
23
|
-
.option('-t, --tech <technology>', '
|
|
24
|
-
.option('-d, --database <database>', '
|
|
25
|
-
.option('-f, --framework <framework>', '
|
|
26
|
-
.option('--template <template>', '
|
|
27
|
-
.option('--no-interactive', '
|
|
28
|
-
.option('--docker', 'Include Docker
|
|
29
|
-
.option('--tests', 'Include
|
|
23
|
+
.option('-t, --tech <technology>', 'Technology (node, python, java, etc)')
|
|
24
|
+
.option('-d, --database <database>', 'Database (postgresql, mongodb, mysql, etc)')
|
|
25
|
+
.option('-f, --framework <framework>', 'Framework (express, fastapi, nestjs, etc)')
|
|
26
|
+
.option('--template <template>', 'Project template')
|
|
27
|
+
.option('--no-interactive', 'Disable interactive mode')
|
|
28
|
+
.option('--docker', 'Include Docker setup')
|
|
29
|
+
.option('--tests', 'Include tests')
|
|
30
|
+
.option('--ci', 'Include CI/CD')
|
|
30
31
|
.action(async (projectName, options) => {
|
|
31
32
|
try {
|
|
32
|
-
console.log(chalk.blue.bold('\nš OpenWork Agent
|
|
33
|
-
console.log(chalk.gray('Creating your backend project...\n'));
|
|
33
|
+
console.log(chalk.blue.bold('\nš OpenWork Agent'));
|
|
34
34
|
|
|
35
35
|
const generator = new ProjectGenerator();
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
let config = {
|
|
38
38
|
projectName,
|
|
39
39
|
technology: options.tech,
|
|
40
40
|
database: options.database,
|
|
41
41
|
framework: options.framework,
|
|
42
42
|
template: options.template,
|
|
43
|
-
interactive: options.interactive,
|
|
44
|
-
includeDocker: options.docker,
|
|
45
|
-
includeTests: options.tests
|
|
43
|
+
interactive: options.interactive !== false,
|
|
44
|
+
includeDocker: !!options.docker,
|
|
45
|
+
includeTests: !!options.tests,
|
|
46
|
+
includeCI: !!options.ci
|
|
46
47
|
};
|
|
47
48
|
|
|
49
|
+
// Interactive prompt (only if enabled and missing values)
|
|
48
50
|
if (config.interactive && !config.technology) {
|
|
49
51
|
config = await generator.promptForConfiguration(config);
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
await generator.createProject(config);
|
|
53
|
-
|
|
55
|
+
|
|
54
56
|
console.log(chalk.green.bold('\nā
Project created successfully!'));
|
|
55
|
-
|
|
56
|
-
console.
|
|
57
|
-
|
|
58
|
-
// Show setup commands based on technology
|
|
59
|
-
const setupCommands = generator.getSetupCommands(config.technology);
|
|
60
|
-
setupCommands.forEach(cmd => {
|
|
61
|
-
console.log(chalk.white(` ${cmd}`));
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
} catch (error) {
|
|
65
|
-
console.error(chalk.red.bold('\nā Error:'), error.message);
|
|
57
|
+
} catch (err) {
|
|
58
|
+
console.error(chalk.red('\nā Error:'), err.message);
|
|
66
59
|
process.exit(1);
|
|
67
60
|
}
|
|
68
61
|
});
|
|
69
62
|
|
|
63
|
+
/**
|
|
64
|
+
* ANALYZE COMMAND
|
|
65
|
+
*/
|
|
70
66
|
program
|
|
71
67
|
.command('analyze')
|
|
72
|
-
.description('Analyze current directory and
|
|
68
|
+
.description('Analyze current directory and detect technology')
|
|
73
69
|
.action(async () => {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
console.log(chalk.blue.bold('\nš Technology Analysis'));
|
|
79
|
-
|
|
80
|
-
if (analysis.technologies.length > 0) {
|
|
81
|
-
console.log(chalk.yellow('\nDetected Technologies:'));
|
|
82
|
-
analysis.technologies.forEach(tech => {
|
|
83
|
-
const confidence = Math.round(analysis.confidence[tech] * 100);
|
|
84
|
-
console.log(chalk.white(` ${tech}: ${confidence}% confidence`));
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (analysis.frameworks.length > 0) {
|
|
89
|
-
console.log(chalk.yellow('\nDetected Frameworks:'));
|
|
90
|
-
analysis.frameworks.forEach(fw => {
|
|
91
|
-
console.log(chalk.white(` ${fw.technology}: ${fw.framework}`));
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (analysis.databases.length > 0) {
|
|
96
|
-
console.log(chalk.yellow('\nDetected Databases:'));
|
|
97
|
-
analysis.databases.forEach(db => {
|
|
98
|
-
console.log(chalk.white(` ${db}`));
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
} catch (error) {
|
|
103
|
-
console.error(chalk.red.bold('\nā Error:'), error.message);
|
|
104
|
-
process.exit(1);
|
|
105
|
-
}
|
|
70
|
+
const detector = new TechDetector();
|
|
71
|
+
const result = await detector.analyzeCurrentDirectory();
|
|
72
|
+
console.log(result);
|
|
106
73
|
});
|
|
107
74
|
|
|
75
|
+
/**
|
|
76
|
+
* LIST TECHNOLOGIES
|
|
77
|
+
*/
|
|
108
78
|
program
|
|
109
|
-
.command('
|
|
110
|
-
.description('List
|
|
79
|
+
.command('list')
|
|
80
|
+
.description('List supported technologies')
|
|
111
81
|
.action(() => {
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
{ name: 'fastapi-crud', tech: 'python', description: 'FastAPI CRUD operations with SQLAlchemy' },
|
|
115
|
-
{ name: 'spring-boot', tech: 'java', description: 'Spring Boot microservice with JPA' },
|
|
116
|
-
{ name: 'go-gin', tech: 'go', description: 'Go Gin web service with GORM' },
|
|
117
|
-
{ name: 'rust-actix', tech: 'rust', description: 'Actix-web API with Diesel ORM' },
|
|
118
|
-
{ name: 'django-api', tech: 'python', description: 'Django REST API' },
|
|
119
|
-
{ name: 'nestjs-api', tech: 'node', description: 'NestJS API with PostgreSQL' },
|
|
120
|
-
{ name: 'laravel-api', tech: 'php', description: 'Laravel REST API' }
|
|
121
|
-
];
|
|
122
|
-
|
|
123
|
-
console.log(chalk.blue.bold('\nš Available Templates'));
|
|
124
|
-
templates.forEach((template, index) => {
|
|
125
|
-
console.log(chalk.cyan(`${index + 1}. ${template.name}`));
|
|
126
|
-
console.log(chalk.gray(` Tech: ${template.tech} - ${template.description}`));
|
|
127
|
-
});
|
|
82
|
+
const detector = new TechDetector();
|
|
83
|
+
console.log(detector.getAvailableTechnologies());
|
|
128
84
|
});
|
|
129
85
|
|
|
86
|
+
/**
|
|
87
|
+
* TEMPLATES
|
|
88
|
+
*/
|
|
130
89
|
program
|
|
131
|
-
.command('
|
|
132
|
-
.description('List
|
|
90
|
+
.command('templates')
|
|
91
|
+
.description('List available templates')
|
|
133
92
|
.action(() => {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
frameworks.forEach(fw => {
|
|
142
|
-
console.log(chalk.white(` - ${fw}`));
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
console.log(chalk.green.bold('\nš¾ Supported Databases:'));
|
|
147
|
-
detector.getAvailableDatabases().forEach(db => {
|
|
148
|
-
console.log(chalk.white(` - ${db}`));
|
|
149
|
-
});
|
|
93
|
+
console.log([
|
|
94
|
+
'api',
|
|
95
|
+
'crud',
|
|
96
|
+
'microservice',
|
|
97
|
+
'graphql',
|
|
98
|
+
'minimal'
|
|
99
|
+
]);
|
|
150
100
|
});
|
|
151
101
|
|
|
152
|
-
|
|
102
|
+
/**
|
|
103
|
+
* IMPORTANT:
|
|
104
|
+
* parse() must be here and ONLY here
|
|
105
|
+
*/
|
|
106
|
+
program.parse(process.argv);
|
|
107
|
+
|
|
108
|
+
module.exports = program;
|
package/src/main.js
DELETED