forgestack-os-cli 0.3.5 → 0.3.6

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 (34) hide show
  1. package/README.md +338 -312
  2. package/dist/commands/doctor.d.ts +12 -0
  3. package/dist/commands/doctor.js +214 -0
  4. package/dist/commands/doctor.js.map +1 -0
  5. package/dist/index.js +16 -0
  6. package/dist/index.js.map +1 -1
  7. package/dist/utils/doctor/check-database.d.ts +8 -0
  8. package/dist/utils/doctor/check-database.js +271 -0
  9. package/dist/utils/doctor/check-database.js.map +1 -0
  10. package/dist/utils/doctor/check-docker.d.ts +8 -0
  11. package/dist/utils/doctor/check-docker.js +212 -0
  12. package/dist/utils/doctor/check-docker.js.map +1 -0
  13. package/dist/utils/doctor/check-env.d.ts +12 -0
  14. package/dist/utils/doctor/check-env.js +207 -0
  15. package/dist/utils/doctor/check-env.js.map +1 -0
  16. package/dist/utils/doctor/check-lint.d.ts +8 -0
  17. package/dist/utils/doctor/check-lint.js +225 -0
  18. package/dist/utils/doctor/check-lint.js.map +1 -0
  19. package/dist/utils/doctor/check-node.d.ts +20 -0
  20. package/dist/utils/doctor/check-node.js +172 -0
  21. package/dist/utils/doctor/check-node.js.map +1 -0
  22. package/dist/utils/doctor/check-ports.d.ts +15 -0
  23. package/dist/utils/doctor/check-ports.js +166 -0
  24. package/dist/utils/doctor/check-ports.js.map +1 -0
  25. package/dist/utils/doctor/check-prisma.d.ts +8 -0
  26. package/dist/utils/doctor/check-prisma.js +202 -0
  27. package/dist/utils/doctor/check-prisma.js.map +1 -0
  28. package/dist/utils/doctor/index.d.ts +14 -0
  29. package/dist/utils/doctor/index.js +15 -0
  30. package/dist/utils/doctor/index.js.map +1 -0
  31. package/dist/utils/doctor/types.d.ts +50 -0
  32. package/dist/utils/doctor/types.js +5 -0
  33. package/dist/utils/doctor/types.js.map +1 -0
  34. package/package.json +1 -1
package/README.md CHANGED
@@ -1,441 +1,424 @@
1
- # ForgeStack OS CLI
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/halloffame12/forgestack-os/main/docs/assets/logo.svg" alt="ForgeStack OS Logo" width="80" height="80" />
3
+ </p>
4
+
5
+ <h1 align="center">ForgeStack OS CLI</h1>
6
+
7
+ <p align="center">
8
+ <strong>Generate production-ready full-stack SaaS projects with one command.</strong>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/forgestack-os-cli"><img src="https://img.shields.io/npm/v/forgestack-os-cli?style=flat-square&color=0891b2&label=npm" alt="npm version" /></a>
13
+ <a href="https://www.npmjs.com/package/forgestack-os-cli"><img src="https://img.shields.io/npm/dm/forgestack-os-cli?style=flat-square&color=0891b2" alt="npm downloads" /></a>
14
+ <img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="License" />
15
+ <img src="https://img.shields.io/badge/Node.js-18+-339933?style=flat-square&logo=node.js&logoColor=white" alt="Node.js" />
16
+ <img src="https://img.shields.io/badge/TypeScript-5.7-3178c6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript" />
17
+ </p>
18
+
19
+ <p align="center">
20
+ <a href="#-installation">Installation</a> •
21
+ <a href="#-quick-start">Quick Start</a> •
22
+ <a href="#-commands">Commands</a> •
23
+ <a href="#-examples">Examples</a> •
24
+ <a href="#-troubleshooting">Help</a>
25
+ </p>
2
26
 
3
- Generate production-ready full-stack SaaS projects with one command.
27
+ ---
4
28
 
5
- ## Installation
29
+ ## 📦 Installation
6
30
 
7
- ### Option 1: Using npx (Recommended - No Installation Needed)
31
+ ### Using npx (Recommended No Install Required)
8
32
 
9
33
  ```bash
10
34
  npx forgestack-os-cli create my-app
11
35
  ```
12
36
 
13
- No setup required! The fastest way to get started. The CLI is downloaded and run on the fly.
14
-
15
- ### Option 2: Install Globally
37
+ ### Global Installation
16
38
 
17
39
  ```bash
18
40
  npm install -g forgestack-os-cli
41
+ forgestack-os-cli create my-app
19
42
  ```
20
43
 
21
- Then create projects using:
44
+ <details>
45
+ <summary><strong>🔧 Troubleshooting global install</strong></summary>
22
46
 
23
- ```bash
24
- forgestack-os-cli create my-app
25
- ```
47
+ If you get `command not found` after global install:
26
48
 
27
- **Note on Global Install:** After installing globally, the command `forgestack-os-cli` should be in your PATH. If you get `command not found` errors:
49
+ 1. Check your npm bin directory:
28
50
 
29
- 1. Verify your npm bin directory is in PATH:
30
51
  ```bash
31
52
  npm config get prefix
32
53
  ```
33
- 2. Add it to PATH if needed:
34
- - **Windows (PowerShell):** `[System.Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Users\YourUsername\AppData\Roaming\npm", [System.EnvironmentVariableTarget]::User)`
35
- - **macOS/Linux:** Add `export PATH="~/.npm-global/bin:$PATH"` to `~/.bash_profile` or `~/.zshrc`
54
+
55
+ 2. Add it to your PATH:
56
+ - **Windows (PowerShell)**:
57
+ ```powershell
58
+ [System.Environment]::SetEnvironmentVariable("Path", "$env:Path;$(npm config get prefix)", [System.EnvironmentVariableTarget]::User)
59
+ ```
60
+ - **macOS/Linux**:
61
+ ```bash
62
+ export PATH="$(npm config get prefix)/bin:$PATH"
63
+ ```
36
64
 
37
65
  3. Verify installation:
38
66
  ```bash
39
67
  forgestack-os-cli --version
40
68
  ```
41
69
 
42
- ## Quick Start
70
+ </details>
43
71
 
44
- **Fastest way to create a project:**
72
+ ---
73
+
74
+ ## ⚡ Quick Start
45
75
 
46
76
  ```bash
47
- # Interactive mode - we'll ask you questions
48
- npx forgestack-os-cli create my-app
77
+ # Interactive mode answer prompts to configure your stack
78
+ npx forgestack-os-cli create my-saas-app
49
79
 
50
- # With a preset - production-ready stack
51
- npx forgestack-os-cli create my-enterprise --preset next-nest-clerk-pg
80
+ # Use a preset for instant setup
81
+ npx forgestack-os-cli create my-app --preset next-nest-clerk-pg
52
82
 
53
- # With specific flags
54
- npx forgestack-os-cli create my-api --frontend nextjs --backend nestjs --auth supabase --database postgresql --docker
83
+ # Specify options directly
84
+ npx forgestack-os-cli create my-app \
85
+ --frontend nextjs \
86
+ --backend nestjs \
87
+ --auth clerk \
88
+ --database postgresql \
89
+ --docker
55
90
  ```
56
91
 
57
- ## Usage
92
+ **In 30 seconds**, you get:
58
93
 
59
- ```bash
60
- forgestack-os-cli create <project-name> [options]
61
- ```
94
+ - ✅ Full authentication system
95
+ - Database with migrations
96
+ - ✅ API documentation (Swagger)
97
+ - ✅ Docker configuration
98
+ - ✅ TypeScript everywhere
99
+
100
+ ---
62
101
 
63
- Or with npx:
102
+ ## 🧰 Commands
103
+
104
+ ### `create` — Generate a New Project
64
105
 
65
106
  ```bash
66
107
  npx forgestack-os-cli create <project-name> [options]
67
108
  ```
68
109
 
69
- ### Available Options
70
-
71
- | Option | Values | Description |
72
- | ---------------- | --------------------------------------------------------------------------------- | --------------------------------------- |
73
- | `--frontend` | `react-vite` \| `nextjs` \| `vue-vite` \| `sveltekit` | Frontend framework |
74
- | `--backend` | `express` \| `fastify` \| `nestjs` \| `bun-elysia` \| `go-fiber` | Backend framework |
75
- | `--auth` | `jwt` \| `clerk` \| `supabase` \| `authjs` \| `firebase` | Authentication provider |
76
- | `--database` | `postgresql` \| `mongodb` \| `mysql` \| `sqlite` \| `supabase-db` | Database |
77
- | `--api` | `rest` \| `graphql` \| `trpc` | API style |
78
- | `--preset` | `next-nest-clerk-pg` \| `react-express-jwt-mongo` \| `next-fastify-supabase-trpc` | Predefined stack |
79
- | `--stack` | JSON string | Full stack config as JSON |
80
- | `--docker` | - | Include Docker configuration |
81
- | `--no-docker` | - | Skip Docker configuration (default) |
82
- | `--multi-tenant` | - | Enable multi-tenancy scaffolding |
83
- | `--skip-install` | - | Skip npm install after project creation |
84
- | `--skip-git` | - | Skip git initialization |
85
-
86
- ## Examples
110
+ <table>
111
+ <tr><th>Option</th><th>Values</th><th>Description</th></tr>
112
+ <tr><td><code>--frontend</code></td><td><code>react-vite</code> | <code>nextjs</code> | <code>vue-vite</code> | <code>sveltekit</code></td><td>Frontend framework</td></tr>
113
+ <tr><td><code>--backend</code></td><td><code>express</code> | <code>fastify</code> | <code>nestjs</code> | <code>bun-elysia</code> | <code>go-fiber</code></td><td>Backend framework</td></tr>
114
+ <tr><td><code>--auth</code></td><td><code>jwt</code> | <code>clerk</code> | <code>supabase</code> | <code>authjs</code> | <code>firebase</code></td><td>Authentication</td></tr>
115
+ <tr><td><code>--database</code></td><td><code>postgresql</code> | <code>mongodb</code> | <code>mysql</code> | <code>sqlite</code></td><td>Database</td></tr>
116
+ <tr><td><code>--api</code></td><td><code>rest</code> | <code>graphql</code> | <code>trpc</code></td><td>API style</td></tr>
117
+ <tr><td><code>--preset</code></td><td><code>next-nest-clerk-pg</code> | <code>react-express-jwt-mongo</code> | <code>next-fastify-supabase-trpc</code></td><td>Preset stack</td></tr>
118
+ <tr><td><code>--docker</code></td><td>—</td><td>Include Docker config</td></tr>
119
+ <tr><td><code>--multi-tenant</code></td><td>—</td><td>Enable multi-tenancy</td></tr>
120
+ <tr><td><code>--skip-install</code></td><td>—</td><td>Skip npm install</td></tr>
121
+ <tr><td><code>--skip-git</code></td><td>—</td><td>Skip git init</td></tr>
122
+ </table>
87
123
 
88
- ### Interactive Mode (Recommended)
124
+ ---
125
+
126
+ ### `doctor` — Validate Environment ✨ NEW
127
+
128
+ Diagnose your dev environment and catch issues before they slow you down.
89
129
 
90
130
  ```bash
91
- npx forgestack-os-cli create my-saas
131
+ npx forgestack-os-cli doctor [options]
92
132
  ```
93
133
 
94
- You'll be guided through selecting your stack options with interactive prompts.
95
-
96
- ### Using Presets
134
+ <table>
135
+ <tr><th>Option</th><th>Description</th></tr>
136
+ <tr><td><code>--lint</code></td><td>Run ESLint and TypeScript checks</td></tr>
137
+ <tr><td><code>--json</code></td><td>Output as JSON for CI/CD pipelines</td></tr>
138
+ <tr><td><code>--fix</code></td><td>Generate <code>.env.missing</code> report</td></tr>
139
+ <tr><td><code>--cwd &lt;path&gt;</code></td><td>Check a specific directory</td></tr>
140
+ </table>
97
141
 
98
- **Next.js + NestJS + Clerk + PostgreSQL (Full-featured):**
142
+ **Example Output:**
99
143
 
100
- ```bash
101
- npx forgestack-os-cli create my-enterprise --preset next-nest-clerk-pg
102
144
  ```
145
+ 🩺 ForgeStack Doctor Report
103
146
 
104
- **React + Express + JWT + MongoDB (Simple SPA):**
147
+ 📋 Node.js & Package Managers
105
148
 
106
- ```bash
107
- npx forgestack-os-cli create my-app --preset react-express-jwt-mongo
108
- ```
149
+ ✅ Node.js: Node version: 20.2.0
150
+ npm: npm version: 10.2.0
151
+ ⏭️ pnpm: pnpm is not installed (optional)
109
152
 
110
- **Next.js + Fastify + Supabase + tRPC (Modern fullstack):**
153
+ 📋 Environment Variables
111
154
 
112
- ```bash
113
- npx forgestack-os-cli create my-trpc-app --preset next-fastify-supabase-trpc
114
- ```
155
+ ❌ Missing .env Variables: DATABASE_URL, JWT_SECRET
156
+ 💡 Fix: Add the missing variables to your .env file
115
157
 
116
- ### Using Flags
158
+ 📋 Database Connectivity
117
159
 
118
- **RESTful API with React + Express:**
160
+ PostgreSQL Connection: Successfully connected to PostgreSQL
119
161
 
120
- ```bash
121
- npx forgestack-os-cli create my-rest-api \
122
- --frontend react-vite \
123
- --backend express \
124
- --auth jwt \
125
- --database postgresql \
126
- --api rest
127
- ```
162
+ 📋 Prisma ORM
128
163
 
129
- **GraphQL Backend with Vue:**
164
+ Prisma Schema: Prisma schema is valid
165
+ ✅ Prisma Client: Prisma client is generated
166
+ ⚠️ Prisma Migrations: Pending migrations detected
167
+ 💡 Fix: Run: npx prisma migrate dev
130
168
 
131
- ```bash
132
- npx forgestack-os-cli create my-graphql-app \
133
- --frontend vue-vite \
134
- --backend nestjs \
135
- --auth firebase \
136
- --database mongodb \
137
- --api graphql \
138
- --docker
139
- ```
169
+ 📋 Docker
140
170
 
141
- **Minimal Setup (SQLite + No Docker):**
171
+ Docker: Docker installed: 24.0.7
172
+ ✅ Docker Daemon: Docker daemon is running
173
+ ✅ Docker Compose: Docker Compose V2: 2.23.0
142
174
 
143
- ```bash
144
- npx forgestack-os-cli create my-minimal-app \
145
- --frontend react-vite \
146
- --backend express \
147
- --auth jwt \
148
- --database sqlite \
149
- --no-docker
150
- ```
175
+ 📋 Port Availability
151
176
 
152
- ### Using JSON Stack Config
177
+ Backend (port 3000): Port 3000 is used by node (PID: 12345)
178
+ 💡 Fix: Stop the process or use a different port. Kill: taskkill /PID 12345 /F
179
+ ✅ Frontend (port 5173): Port 5173 is available
153
180
 
154
- Provide complete configuration as a JSON string:
181
+ ───────────────────────────────────────────────────────────
155
182
 
156
- ```bash
157
- npx forgestack-os-cli create my-custom-stack --stack '{
158
- "frontend": "nextjs",
159
- "backend": "fastify",
160
- "auth": "supabase",
161
- "database": "supabase-db",
162
- "apiStyle": "trpc",
163
- "docker": true,
164
- "multiTenant": true
165
- }'
166
- ```
183
+ 📊 Summary:
167
184
 
168
- **Multi-tenancy with Docker:**
185
+ Total Checks: 12
186
+ Passed: 8
187
+ Warnings: 1
188
+ Failed: 2
189
+ Skipped: 1
169
190
 
170
- ```bash
171
- npx forgestack-os-cli create my-multitenant-app \
172
- --preset next-nest-clerk-pg \
173
- --multi-tenant \
174
- --docker
191
+ ✖ Found 2 critical issue(s) that need to be fixed.
175
192
  ```
176
193
 
177
- **Skip Dependency Installation:**
194
+ **Checks Performed:**
178
195
 
179
- ```bash
180
- npx forgestack-os-cli create my-app --preset next-nest-clerk-pg --skip-install
181
- cd my-app
182
- npm install # Install later when you're ready
196
+ | Check | Description |
197
+ | -------------- | -------------------------------------------------- |
198
+ | 🟢 Node.js | Version against `.nvmrc` or `package.json` engines |
199
+ | 🟢 npm/pnpm | Package manager availability |
200
+ | 🟢 Environment | Missing variables from `.env.example` |
201
+ | 🟢 Database | PostgreSQL, MongoDB, MySQL, SQLite connectivity |
202
+ | 🟢 Prisma | Client generation, schema validation, migrations |
203
+ | 🟢 Docker | Installation, daemon status, Compose availability |
204
+ | 🟢 Ports | Backend (3000) and frontend (5173) availability |
205
+ | 🟢 ESLint | Linting issues (with `--lint`) |
206
+ | 🟢 TypeScript | Compile errors (with `--lint`) |
207
+
208
+ **CI/CD Integration:**
209
+
210
+ ```yaml
211
+ # GitHub Actions
212
+ - name: Validate Environment
213
+ run: |
214
+ npx forgestack-os-cli doctor --json > doctor-report.json
215
+ if [ $(jq '.summary.failed' doctor-report.json) -gt 0 ]; then
216
+ exit 1
217
+ fi
183
218
  ```
184
219
 
185
- ## Additional Commands
220
+ ---
186
221
 
187
- ### `organize` - File Organization Utility
222
+ ### `organize` File Organization Utility
188
223
 
189
- Organize files in a folder by type or date, with optional duplicate detection. Supports MD5-based duplicate identification and automatic system folder exclusion for performance.
224
+ Organize files by type or date with duplicate detection.
190
225
 
191
226
  ```bash
192
227
  npx forgestack-os-cli organize <folder-path> [options]
193
228
  ```
194
229
 
195
- **Options:**
196
- - `--strategy <type>` - Organization strategy: `type` (default) or `date`
197
- - `--duplicates` - Move duplicate files to a `Duplicates` folder
198
-
199
- **File Categories (when using `--strategy type`):**
200
- - **Images**: jpg, png, gif, svg, webp, bmp, ico
201
- - **Documents**: pdf, doc, docx, txt, xlsx, csv, md
202
- - **Videos**: mp4, mkv, avi, mov, wmv, flv
203
- - **Audio**: mp3, wav, flac, aac, m4a, ogg
204
- - **Code**: js, ts, py, java, cpp, go, rs, rb
205
- - **Archives**: zip, rar, 7z, tar, gz, bz2
206
- - **Data**: json, xml, yaml, sql, db, sqlite
207
- - **Executables**: exe, msi, app, deb, rpm
208
- - **Others**: All other file types
209
-
210
- **Date Format (when using `--strategy date`):**
211
- Files organized into folders using format: `YYYY-MM` (e.g., `2026-01`, `2025-12`)
212
-
213
- **Features:**
214
- - ✅ Automatically skips system folders (node_modules, .git, dist, build, .next, .env, .DS_Store, .vscode)
215
- - ✅ MD5-based duplicate detection (prevents moving the same file twice)
216
- - ✅ Graceful error handling for permission denied or inaccessible files
217
- - ✅ Summary report showing total files organized and categories
218
- - ✅ Interactive prompts if options not provided
219
-
220
- **Examples:**
230
+ <table>
231
+ <tr><th>Option</th><th>Description</th></tr>
232
+ <tr><td><code>--strategy &lt;type&gt;</code></td><td><code>type</code> (by extension) or <code>date</code> (by YYYY-MM)</td></tr>
233
+ <tr><td><code>--duplicates</code></td><td>Move duplicate files to <code>Duplicates/</code></td></tr>
234
+ </table>
235
+
236
+ **File Categories:**
237
+
238
+ - 📷 **Images**: jpg, png, gif, svg, webp, bmp, ico
239
+ - 📄 **Documents**: pdf, doc, docx, txt, xlsx, csv, md
240
+ - 🎬 **Videos**: mp4, mkv, avi, mov, wmv, flv
241
+ - 🎵 **Audio**: mp3, wav, flac, aac, m4a, ogg
242
+ - 💻 **Code**: js, ts, py, java, cpp, go, rs, rb
243
+ - 📦 **Archives**: zip, rar, 7z, tar, gz, bz2
244
+ - 📊 **Data**: json, xml, yaml, sql, db, sqlite
245
+ - ⚙️ **Executables**: exe, msi, app, deb, rpm
246
+
247
+ **Example:**
221
248
 
222
249
  ```bash
223
- # Organize by file type with duplicate detection
250
+ # Organize Downloads by file type with duplicate detection
224
251
  npx forgestack-os-cli organize ~/Downloads --strategy type --duplicates
225
252
 
226
253
  # Organize photos by month
227
254
  npx forgestack-os-cli organize ~/Pictures --strategy date
228
-
229
- # Interactive mode (prompts for folder and options)
230
- npx forgestack-os-cli organize
231
-
232
- # Organize current directory
233
- npx forgestack-os-cli organize .
234
255
  ```
235
256
 
236
- **Output Example:**
237
- ```
238
- ✓ Found and organized 1,250 files
239
- ✓ Categories:
240
- - Images: 450 files
241
- - Documents: 280 files
242
- - Videos: 320 files
243
- - Code: 145 files
244
- - Others: 55 files
245
- ✓ Found 12 set(s) of duplicate files moved to Duplicates folder
246
- ```
247
-
248
- **Edge Cases Handled:**
249
- - Empty folders: Displays "No files to organize" message
250
- - Invalid paths: Shows clear error message with validation
251
- - Permission errors: Skips files with access denied, continues processing
252
- - Unreadable files: Skips during hash calculation, no crash
253
- - Large monorepos: Excludes node_modules, .git, and build folders automatically
254
-
255
257
  ---
256
258
 
257
- ### `run-tasks` - Batch Task Runner
259
+ ### `run-tasks` Batch Task Runner
258
260
 
259
- Execute shell commands from a JSON configuration file, sequentially or in parallel. Supports task-specific working directories and comprehensive error handling.
261
+ Execute shell commands from JSON config with parallel support.
260
262
 
261
263
  ```bash
262
264
  npx forgestack-os-cli run-tasks <config-path> [options]
263
265
  ```
264
266
 
265
- **Options:**
266
- - `--parallel` - Run tasks concurrently instead of sequentially (default: false)
267
- - `--stop-on-error` - Stop execution on first task failure (default: true)
267
+ <table>
268
+ <tr><th>Option</th><th>Description</th></tr>
269
+ <tr><td><code>--parallel</code></td><td>Run tasks concurrently</td></tr>
270
+ <tr><td><code>--stop-on-error</code></td><td>Stop on first failure (default: true)</td></tr>
271
+ </table>
268
272
 
269
- **Config File Format (tasks.json):**
273
+ **Config Format (tasks.json):**
270
274
 
271
275
  ```json
272
276
  {
273
277
  "tasks": [
274
278
  {
275
- "name": "Build",
279
+ "name": "Build Frontend",
276
280
  "command": "npm run build",
277
- "cwd": "./"
281
+ "cwd": "./frontend"
278
282
  },
279
- {
280
- "name": "Test",
281
- "command": "npm test",
282
- "cwd": "./"
283
- }
283
+ { "name": "Build Backend", "command": "npm run build", "cwd": "./backend" },
284
+ { "name": "Run Tests", "command": "npm test" },
285
+ { "name": "Deploy", "command": "npm run deploy" }
284
286
  ],
285
287
  "parallel": false,
286
288
  "stopOnError": true
287
289
  }
288
290
  ```
289
291
 
290
- **Features:**
291
- - ✅ Cross-platform shell execution (Windows CMD, Unix bash)
292
- - ✅ Task-specific working directory support
293
- - ✅ Sequential or parallel execution modes
294
- - ✅ Configurable failure handling
295
- - ✅ Comprehensive error reporting
296
- - ✅ Interactive mode with default config file detection
297
- - ✅ Proper exit codes for CI/CD integration
298
-
299
- **Examples:**
292
+ **Example:**
300
293
 
301
294
  ```bash
302
- # Run tasks sequentially (stops on first error)
303
- npx forgestack-os-cli run-tasks ./tasks.json
295
+ # Run sequentially
296
+ npx forgestack-os-cli run-tasks ./build-pipeline.json
304
297
 
305
- # Run tasks in parallel
306
- npx forgestack-os-cli run-tasks ./tasks.json --parallel
298
+ # Run in parallel
299
+ npx forgestack-os-cli run-tasks ./build-pipeline.json --parallel
307
300
 
308
301
  # Continue on errors
309
302
  npx forgestack-os-cli run-tasks ./tasks.json --stop-on-error false
310
-
311
- # Interactive mode (looks for ./tasks.json automatically)
312
- npx forgestack-os-cli run-tasks
313
303
  ```
314
304
 
315
- **Task Properties:**
316
- - `name` (required) - Display name for the task (for logging)
317
- - `command` (required) - Shell command to execute
318
- - `cwd` (optional) - Working directory for command execution (must exist)
305
+ ---
319
306
 
320
- **Example: Monorepo Build Pipeline**
307
+ ## 📚 Examples
321
308
 
322
- ```json
323
- {
324
- "tasks": [
325
- {
326
- "name": "Clean Build Artifacts",
327
- "command": "rm -rf dist"
328
- },
329
- {
330
- "name": "Build Frontend",
331
- "command": "npm run build",
332
- "cwd": "./packages/frontend"
333
- },
334
- {
335
- "name": "Build Backend",
336
- "command": "npm run build",
337
- "cwd": "./packages/backend"
338
- },
339
- {
340
- "name": "Run Tests",
341
- "command": "npm test",
342
- "cwd": "./packages/backend"
343
- },
344
- {
345
- "name": "Generate Docs",
346
- "command": "npm run docs"
347
- }
348
- ],
349
- "parallel": false,
350
- "stopOnError": true
351
- }
352
- ```
309
+ ### Interactive Mode (Recommended)
353
310
 
354
- **Output Example:**
311
+ ```bash
312
+ npx forgestack-os-cli create my-saas
313
+ # Answer prompts to configure your perfect stack
355
314
  ```
356
- ⏳ Running tasks sequentially...
357
- Task 1/5: Clean Build Artifacts completed
358
- ✓ Task 2/5: Build Frontend completed
359
- ✓ Task 3/5: Build Backend completed
360
- Task 4/5: Run Tests completed
361
- Task 5/5: Generate Docs completed
362
-
363
- All 5 tasks completed successfully
315
+
316
+ ### Using Presets
317
+
318
+ ```bash
319
+ # Enterprise: Next.js + NestJS + Clerk + PostgreSQL
320
+ npx forgestack-os-cli create my-enterprise --preset next-nest-clerk-pg
321
+
322
+ # Startup: React + Express + JWT + MongoDB
323
+ npx forgestack-os-cli create my-startup --preset react-express-jwt-mongo
324
+
325
+ # Modern: Next.js + Fastify + Supabase + tRPC
326
+ npx forgestack-os-cli create my-modern --preset next-fastify-supabase-trpc
364
327
  ```
365
328
 
366
- **Error Handling:**
367
- - **Invalid config path**: Shows clear error, no crash
368
- - **Malformed JSON**: Displays JSON parsing error
369
- - **Missing command**: Validates all tasks have required fields
370
- - **Invalid working directory**: Shows warning, continues with project root
371
- - **Task execution fails**: Respects `stopOnError` flag
372
- - **Cross-platform compatibility**: Automatically handles Windows vs Unix paths
329
+ ### Using Flags
373
330
 
374
- ---
331
+ ```bash
332
+ # RESTful API with PostgreSQL
333
+ npx forgestack-os-cli create my-api \
334
+ --frontend react-vite \
335
+ --backend express \
336
+ --auth jwt \
337
+ --database postgresql \
338
+ --api rest \
339
+ --docker
375
340
 
376
- ## Features
341
+ # GraphQL with MongoDB
342
+ npx forgestack-os-cli create my-graphql \
343
+ --frontend vue-vite \
344
+ --backend nestjs \
345
+ --auth firebase \
346
+ --database mongodb \
347
+ --api graphql
377
348
 
378
- ### Project Generation
379
- - **150+ Stack Combinations** - Frontend (React, Next.js, Vue, Svelte) × Backend (Express, Fastify, NestJS, Bun, Go) × Auth × Database × API Style
380
- - **Multi-tenancy Ready** - Scaffolding support for SaaS applications
381
- - **Docker Compose** - Complete Docker setup with frontend and backend services
382
- - **Environment Templates** - Pre-configured `.env.example` files
383
- - **API Documentation** - Swagger/OpenAPI docs for REST APIs
384
- - **TypeScript First** - Full TypeScript support across all generated code
385
- - **Production Ready** - Best practices, security headers, error handling
349
+ # Multi-tenant SaaS
350
+ npx forgestack-os-cli create my-saas \
351
+ --preset next-nest-clerk-pg \
352
+ --multi-tenant \
353
+ --docker
354
+ ```
386
355
 
387
- ### Utility Commands
388
- - **File Organization** (`organize`) - Sort files by type or date, with MD5-based duplicate detection and automatic system folder exclusion
389
- - **Batch Task Runner** (`run-tasks`) - Execute complex workflows with sequential or parallel task execution, cross-platform compatibility, and comprehensive error handling
356
+ ### JSON Stack Config
390
357
 
391
- ## Generated Project Structure
358
+ ```bash
359
+ npx forgestack-os-cli create my-custom --stack '{
360
+ "frontend": "nextjs",
361
+ "backend": "fastify",
362
+ "auth": "supabase",
363
+ "database": "postgresql",
364
+ "apiStyle": "trpc",
365
+ "docker": true,
366
+ "multiTenant": true
367
+ }'
368
+ ```
369
+
370
+ ---
371
+
372
+ ## 📁 Generated Project Structure
392
373
 
393
374
  ```
394
375
  my-app/
395
- ├── frontend/ # React+Vite, Next.js, Vue, or SvelteKit
396
- │ ├── src/
397
- │ ├── public/
398
- │ ├── package.json
399
- ├── tsconfig.json
400
- │ └── vite.config.ts (or next.config.js)
376
+ ├── 📁 frontend/ # React/Next.js/Vue/Svelte
377
+ │ ├── 📁 src/
378
+ │ ├── 📄 package.json
379
+ │ ├── 📄 tsconfig.json
380
+ └── 📄 vite.config.ts
401
381
 
402
- ├── backend/ # Express, Fastify, NestJS, Bun+Elysia, or Go
403
- │ ├── src/
404
- │ ├── dist/
405
- │ ├── package.json
406
- ├── tsconfig.json
407
- └── .env.example
382
+ ├── 📁 backend/ # Express/Fastify/NestJS/Bun
383
+ │ ├── 📁 src/
384
+ ├── 📁 auth/ # Authentication module
385
+ ├── 📁 users/ # User management
386
+ │ └── 📄 main.ts
387
+ ├── 📄 package.json
388
+ │ ├── 📄 tsconfig.json
389
+ │ └── 📄 .env.example
408
390
 
409
- ├── docker/ # Optional - if --docker enabled
410
- │ ├── docker-compose.yml
411
- │ ├── frontend.Dockerfile
412
- │ └── backend.Dockerfile
391
+ ├── 📁 docker/ # If --docker enabled
392
+ │ ├── 📄 docker-compose.yml
393
+ │ ├── 📄 frontend.Dockerfile
394
+ │ └── 📄 backend.Dockerfile
413
395
 
414
- ├── .env.example # Environment variables template
415
- ├── package.json # Workspace configuration (monorepo)
416
- ├── README.md # Per-project setup guide
417
- └── .gitignore
396
+ ├── 📄 .env.example # Environment template
397
+ ├── 📄 package.json # Monorepo workspace
398
+ └── 📄 README.md # Project-specific docs
418
399
  ```
419
400
 
420
- ## Troubleshooting
401
+ ---
402
+
403
+ ## ❓ Troubleshooting
421
404
 
422
- ### "command not found: forgestack-os-cli"
405
+ <details>
406
+ <summary><strong>"command not found: forgestack-os-cli"</strong></summary>
423
407
 
424
- **Using npx?** Make sure you use the full package name:
408
+ Using npx? Use the full package name:
425
409
 
426
410
  ```bash
427
411
  npx forgestack-os-cli create my-app
428
412
  ```
429
413
 
430
- **Installed globally?** Try:
414
+ Installed globally? Check your PATH includes npm's bin directory.
431
415
 
432
- 1. Verify npm global bin is in PATH: `echo $PATH` (Unix) or `$env:Path` (Windows)
433
- 2. Reinstall: `npm install -g forgestack-os-cli@latest`
434
- 3. Check Node.js version: `node --version` (requires 18+)
416
+ </details>
435
417
 
436
- ### "404 Not Found - forgestack"
418
+ <details>
419
+ <summary><strong>"404 Not Found - forgestack"</strong></summary>
437
420
 
438
- The package name is **`forgestack-os-cli`**, not `forgestack`:
421
+ The package name is `forgestack-os-cli`, not `forgestack`:
439
422
 
440
423
  ```bash
441
424
  # ✅ Correct
@@ -445,9 +428,12 @@ npx forgestack-os-cli create my-app
445
428
  npx forgestack create my-app
446
429
  ```
447
430
 
448
- ### "Unknown command"
431
+ </details>
449
432
 
450
- Ensure you're using `create`, not `init`:
433
+ <details>
434
+ <summary><strong>"Unknown command"</strong></summary>
435
+
436
+ Use `create`, not `init`:
451
437
 
452
438
  ```bash
453
439
  # ✅ Correct
@@ -457,29 +443,69 @@ npx forgestack-os-cli create my-app
457
443
  npx forgestack-os-cli init my-app
458
444
  ```
459
445
 
460
- ### Preset not found
446
+ </details>
447
+
448
+ <details>
449
+ <summary><strong>"Preset not found"</strong></summary>
461
450
 
462
- Available presets:
451
+ Available presets (case-sensitive):
463
452
 
464
- - `next-nest-clerk-pg` - Next.js, NestJS, Clerk, PostgreSQL
465
- - `react-express-jwt-mongo` - React+Vite, Express, JWT, MongoDB
466
- - `next-fastify-supabase-trpc` - Next.js, Fastify, Supabase, tRPC
453
+ - `next-nest-clerk-pg`
454
+ - `react-express-jwt-mongo`
455
+ - `next-fastify-supabase-trpc`
467
456
 
468
- Use exact preset names (case-sensitive).
457
+ </details>
469
458
 
470
- ### Node.js version error
459
+ <details>
460
+ <summary><strong>Node.js version error</strong></summary>
471
461
 
472
- ForgeStack requires Node.js 18 or higher:
462
+ ForgeStack requires Node.js 18+:
473
463
 
474
464
  ```bash
475
- node --version # Check your version
476
- nvm install 18 # Or use nvm/fnm to upgrade
465
+ node --version # Check version
466
+ nvm install 18 # Upgrade with nvm
477
467
  ```
478
468
 
479
- ## Author
469
+ </details>
470
+
471
+ ---
472
+
473
+ ## 🔗 Links
480
474
 
481
- Built and maintained by **Sumit Chauhan** ([halloffame12](https://github.com/halloffame12)).
475
+ - 📚 [Documentation](https://github.com/halloffame12/forgestack-os#readme)
476
+ - 🐛 [Issues](https://github.com/halloffame12/forgestack-os/issues)
477
+ - 💬 [Discussions](https://github.com/halloffame12/forgestack-os/discussions)
478
+ - 📦 [npm Package](https://www.npmjs.com/package/forgestack-os-cli)
479
+
480
+ ---
481
+
482
+ ## 👨‍💻 Author
483
+
484
+ <table>
485
+ <tr>
486
+ <td>
487
+ <img src="https://github.com/halloffame12.png" width="60" style="border-radius: 50%;" alt="Sumit Chauhan" />
488
+ </td>
489
+ <td>
490
+ <strong>Sumit Chauhan</strong><br/>
491
+ <a href="https://github.com/halloffame12">GitHub</a> •
492
+ <a href="https://www.linkedin.com/in/sumit-chauhan-a4ba98325/">LinkedIn</a>
493
+ </td>
494
+ </tr>
495
+ </table>
496
+
497
+ ---
498
+
499
+ ## 📄 License
500
+
501
+ MIT License — see [LICENSE](./LICENSE) for details.
502
+
503
+ ---
482
504
 
483
- ## License
505
+ <p align="center">
506
+ <strong>⭐ Star us on GitHub if this tool helped you!</strong>
507
+ </p>
484
508
 
485
- MIT
509
+ <p align="center">
510
+ <sub>Made with ❤️ by <a href="https://github.com/halloffame12">Sumit Chauhan</a></sub>
511
+ </p>