popeye-cli 1.6.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/README.md +240 -32
  2. package/cheatsheet.md +407 -0
  3. package/dist/cli/commands/db.d.ts +10 -0
  4. package/dist/cli/commands/db.d.ts.map +1 -0
  5. package/dist/cli/commands/db.js +240 -0
  6. package/dist/cli/commands/db.js.map +1 -0
  7. package/dist/cli/commands/doctor.d.ts +18 -0
  8. package/dist/cli/commands/doctor.d.ts.map +1 -0
  9. package/dist/cli/commands/doctor.js +255 -0
  10. package/dist/cli/commands/doctor.js.map +1 -0
  11. package/dist/cli/commands/index.d.ts +2 -0
  12. package/dist/cli/commands/index.d.ts.map +1 -1
  13. package/dist/cli/commands/index.js +2 -0
  14. package/dist/cli/commands/index.js.map +1 -1
  15. package/dist/cli/index.d.ts.map +1 -1
  16. package/dist/cli/index.js +3 -1
  17. package/dist/cli/index.js.map +1 -1
  18. package/dist/cli/interactive.d.ts.map +1 -1
  19. package/dist/cli/interactive.js +96 -0
  20. package/dist/cli/interactive.js.map +1 -1
  21. package/dist/generators/admin-wizard.d.ts +25 -0
  22. package/dist/generators/admin-wizard.d.ts.map +1 -0
  23. package/dist/generators/admin-wizard.js +123 -0
  24. package/dist/generators/admin-wizard.js.map +1 -0
  25. package/dist/generators/all.d.ts.map +1 -1
  26. package/dist/generators/all.js +10 -3
  27. package/dist/generators/all.js.map +1 -1
  28. package/dist/generators/database.d.ts +58 -0
  29. package/dist/generators/database.d.ts.map +1 -0
  30. package/dist/generators/database.js +229 -0
  31. package/dist/generators/database.js.map +1 -0
  32. package/dist/generators/fullstack.d.ts.map +1 -1
  33. package/dist/generators/fullstack.js +23 -7
  34. package/dist/generators/fullstack.js.map +1 -1
  35. package/dist/generators/index.d.ts +2 -0
  36. package/dist/generators/index.d.ts.map +1 -1
  37. package/dist/generators/index.js +2 -0
  38. package/dist/generators/index.js.map +1 -1
  39. package/dist/generators/templates/admin-wizard-python.d.ts +32 -0
  40. package/dist/generators/templates/admin-wizard-python.d.ts.map +1 -0
  41. package/dist/generators/templates/admin-wizard-python.js +425 -0
  42. package/dist/generators/templates/admin-wizard-python.js.map +1 -0
  43. package/dist/generators/templates/admin-wizard-react.d.ts +48 -0
  44. package/dist/generators/templates/admin-wizard-react.d.ts.map +1 -0
  45. package/dist/generators/templates/admin-wizard-react.js +554 -0
  46. package/dist/generators/templates/admin-wizard-react.js.map +1 -0
  47. package/dist/generators/templates/database-docker.d.ts +23 -0
  48. package/dist/generators/templates/database-docker.d.ts.map +1 -0
  49. package/dist/generators/templates/database-docker.js +221 -0
  50. package/dist/generators/templates/database-docker.js.map +1 -0
  51. package/dist/generators/templates/database-python.d.ts +54 -0
  52. package/dist/generators/templates/database-python.d.ts.map +1 -0
  53. package/dist/generators/templates/database-python.js +723 -0
  54. package/dist/generators/templates/database-python.js.map +1 -0
  55. package/dist/generators/templates/database-typescript.d.ts +34 -0
  56. package/dist/generators/templates/database-typescript.d.ts.map +1 -0
  57. package/dist/generators/templates/database-typescript.js +232 -0
  58. package/dist/generators/templates/database-typescript.js.map +1 -0
  59. package/dist/generators/templates/fullstack.d.ts.map +1 -1
  60. package/dist/generators/templates/fullstack.js +29 -0
  61. package/dist/generators/templates/fullstack.js.map +1 -1
  62. package/dist/generators/templates/index.d.ts +5 -0
  63. package/dist/generators/templates/index.d.ts.map +1 -1
  64. package/dist/generators/templates/index.js +5 -0
  65. package/dist/generators/templates/index.js.map +1 -1
  66. package/dist/state/index.d.ts +10 -0
  67. package/dist/state/index.d.ts.map +1 -1
  68. package/dist/state/index.js +22 -0
  69. package/dist/state/index.js.map +1 -1
  70. package/dist/types/consensus.d.ts +3 -0
  71. package/dist/types/consensus.d.ts.map +1 -1
  72. package/dist/types/consensus.js +1 -0
  73. package/dist/types/consensus.js.map +1 -1
  74. package/dist/types/database-runtime.d.ts +86 -0
  75. package/dist/types/database-runtime.d.ts.map +1 -0
  76. package/dist/types/database-runtime.js +61 -0
  77. package/dist/types/database-runtime.js.map +1 -0
  78. package/dist/types/database.d.ts +85 -0
  79. package/dist/types/database.d.ts.map +1 -0
  80. package/dist/types/database.js +71 -0
  81. package/dist/types/database.js.map +1 -0
  82. package/dist/types/index.d.ts +3 -0
  83. package/dist/types/index.d.ts.map +1 -1
  84. package/dist/types/index.js +6 -0
  85. package/dist/types/index.js.map +1 -1
  86. package/dist/types/tester.d.ts +138 -0
  87. package/dist/types/tester.d.ts.map +1 -0
  88. package/dist/types/tester.js +110 -0
  89. package/dist/types/tester.js.map +1 -0
  90. package/dist/types/workflow.d.ts +166 -0
  91. package/dist/types/workflow.d.ts.map +1 -1
  92. package/dist/types/workflow.js +14 -0
  93. package/dist/types/workflow.js.map +1 -1
  94. package/dist/workflow/db-setup-runner.d.ts +63 -0
  95. package/dist/workflow/db-setup-runner.d.ts.map +1 -0
  96. package/dist/workflow/db-setup-runner.js +336 -0
  97. package/dist/workflow/db-setup-runner.js.map +1 -0
  98. package/dist/workflow/db-state-machine.d.ts +30 -0
  99. package/dist/workflow/db-state-machine.d.ts.map +1 -0
  100. package/dist/workflow/db-state-machine.js +51 -0
  101. package/dist/workflow/db-state-machine.js.map +1 -0
  102. package/dist/workflow/execution-mode.js +2 -2
  103. package/dist/workflow/execution-mode.js.map +1 -1
  104. package/dist/workflow/index.d.ts +3 -0
  105. package/dist/workflow/index.d.ts.map +1 -1
  106. package/dist/workflow/index.js +3 -0
  107. package/dist/workflow/index.js.map +1 -1
  108. package/dist/workflow/task-workflow.d.ts +5 -0
  109. package/dist/workflow/task-workflow.d.ts.map +1 -1
  110. package/dist/workflow/task-workflow.js +172 -6
  111. package/dist/workflow/task-workflow.js.map +1 -1
  112. package/dist/workflow/tester.d.ts +120 -0
  113. package/dist/workflow/tester.d.ts.map +1 -0
  114. package/dist/workflow/tester.js +589 -0
  115. package/dist/workflow/tester.js.map +1 -0
  116. package/dist/workflow/workflow-logger.d.ts +1 -1
  117. package/dist/workflow/workflow-logger.d.ts.map +1 -1
  118. package/dist/workflow/workflow-logger.js.map +1 -1
  119. package/package.json +1 -1
  120. package/src/cli/commands/db.ts +281 -0
  121. package/src/cli/commands/doctor.ts +273 -0
  122. package/src/cli/commands/index.ts +2 -0
  123. package/src/cli/index.ts +4 -0
  124. package/src/cli/interactive.ts +102 -0
  125. package/src/generators/admin-wizard.ts +146 -0
  126. package/src/generators/all.ts +10 -3
  127. package/src/generators/database.ts +286 -0
  128. package/src/generators/fullstack.ts +26 -9
  129. package/src/generators/index.ts +12 -0
  130. package/src/generators/templates/admin-wizard-python.ts +431 -0
  131. package/src/generators/templates/admin-wizard-react.ts +560 -0
  132. package/src/generators/templates/database-docker.ts +227 -0
  133. package/src/generators/templates/database-python.ts +734 -0
  134. package/src/generators/templates/database-typescript.ts +238 -0
  135. package/src/generators/templates/fullstack.ts +29 -0
  136. package/src/generators/templates/index.ts +5 -0
  137. package/src/state/index.ts +29 -0
  138. package/src/types/consensus.ts +3 -0
  139. package/src/types/database-runtime.ts +69 -0
  140. package/src/types/database.ts +84 -0
  141. package/src/types/index.ts +50 -0
  142. package/src/types/tester.ts +136 -0
  143. package/src/types/workflow.ts +31 -0
  144. package/src/workflow/db-setup-runner.ts +391 -0
  145. package/src/workflow/db-state-machine.ts +58 -0
  146. package/src/workflow/execution-mode.ts +2 -2
  147. package/src/workflow/index.ts +3 -0
  148. package/src/workflow/task-workflow.ts +227 -5
  149. package/src/workflow/tester.ts +723 -0
  150. package/src/workflow/workflow-logger.ts +2 -0
  151. package/tests/generators/admin-wizard-orchestrator.test.ts +64 -0
  152. package/tests/generators/admin-wizard-templates.test.ts +366 -0
  153. package/tests/generators/cross-phase-integration.test.ts +383 -0
  154. package/tests/generators/database.test.ts +456 -0
  155. package/tests/generators/fe-be-db-integration.test.ts +613 -0
  156. package/tests/types/database-runtime.test.ts +158 -0
  157. package/tests/types/database.test.ts +187 -0
  158. package/tests/types/tester.test.ts +174 -0
  159. package/tests/workflow/db-setup-runner.test.ts +211 -0
  160. package/tests/workflow/db-state-machine.test.ts +117 -0
  161. package/tests/workflow/tester.test.ts +401 -0
package/cheatsheet.md ADDED
@@ -0,0 +1,407 @@
1
+ # Popeye CLI Cheatsheet
2
+
3
+ Quick reference for all Popeye CLI commands, interactive mode slash commands, and configuration options.
4
+
5
+ ---
6
+
7
+ ## CLI Commands
8
+
9
+ ### `popeye-cli create <idea>`
10
+
11
+ Create a new project from a natural language description.
12
+
13
+ | Option | Description | Default |
14
+ |--------|-------------|---------|
15
+ | `-n, --name <name>` | Project name | Auto-generated |
16
+ | `-l, --language <lang>` | Output language (`python`, `typescript`, `fullstack`, `website`, `all`) | `python` |
17
+ | `-m, --model <model>` | OpenAI model for consensus | `gpt-4o` |
18
+ | `-o, --output <dir>` | Output directory | Current directory |
19
+ | `--threshold <percent>` | Consensus threshold percentage | `95` |
20
+ | `--max-iterations <n>` | Maximum consensus iterations | `5` |
21
+ | `--skip-scaffold` | Skip initial project scaffolding | `false` |
22
+
23
+ ```bash
24
+ popeye-cli create "todo app with user authentication" -l fullstack -n my-todo
25
+ ```
26
+
27
+ ---
28
+
29
+ ### `popeye-cli interactive` (alias: `i`)
30
+
31
+ Start interactive mode for guided project creation and management. This is the default when running `popeye-cli` with no arguments.
32
+
33
+ ```bash
34
+ popeye-cli interactive
35
+ popeye-cli i
36
+ ```
37
+
38
+ ---
39
+
40
+ ### `popeye-cli status [directory]`
41
+
42
+ Show current project status and progress.
43
+
44
+ | Option | Description |
45
+ |--------|-------------|
46
+ | `-v, --verbose` | Show detailed status |
47
+ | `--json` | Output as JSON |
48
+
49
+ ```bash
50
+ popeye-cli status ./my-project --verbose
51
+ ```
52
+
53
+ ---
54
+
55
+ ### `popeye-cli validate [directory]`
56
+
57
+ Validate that a project structure is complete and ready for execution.
58
+
59
+ ```bash
60
+ popeye-cli validate ./my-project
61
+ ```
62
+
63
+ ---
64
+
65
+ ### `popeye-cli summary [directory]`
66
+
67
+ Show a detailed project summary including plan, milestones, and current progress.
68
+
69
+ ```bash
70
+ popeye-cli summary ./my-project
71
+ ```
72
+
73
+ ---
74
+
75
+ ### `popeye-cli resume [directory]`
76
+
77
+ Resume an interrupted workflow from where it left off.
78
+
79
+ | Option | Description | Default |
80
+ |--------|-------------|---------|
81
+ | `--threshold <percent>` | Consensus threshold | `95` |
82
+ | `--max-iterations <n>` | Max consensus iterations | `5` |
83
+ | `--max-retries <n>` | Max task retries | `3` |
84
+
85
+ ```bash
86
+ popeye-cli resume ./my-project
87
+ ```
88
+
89
+ ---
90
+
91
+ ### `popeye-cli reset [directory]`
92
+
93
+ Reset a project to a specific phase, discarding progress beyond that point.
94
+
95
+ | Option | Description | Default |
96
+ |--------|-------------|---------|
97
+ | `-p, --phase <phase>` | Phase to reset to (`plan`, `execution`) | `plan` |
98
+ | `-f, --force` | Skip confirmation prompt | `false` |
99
+
100
+ ```bash
101
+ popeye-cli reset ./my-project --phase plan --force
102
+ ```
103
+
104
+ ---
105
+
106
+ ### `popeye-cli cancel [directory]`
107
+
108
+ Cancel and delete a project entirely.
109
+
110
+ | Option | Description |
111
+ |--------|-------------|
112
+ | `-f, --force` | Skip confirmation prompt |
113
+
114
+ ```bash
115
+ popeye-cli cancel ./my-project --force
116
+ ```
117
+
118
+ ---
119
+
120
+ ### `popeye-cli auth <subcommand>`
121
+
122
+ Manage authentication for AI provider services.
123
+
124
+ | Subcommand | Description |
125
+ |------------|-------------|
126
+ | `status` | Show authentication status for all services |
127
+ | `login [service]` | Authenticate with a service (`claude`, `openai`, `gemini`, `grok`, `all`) |
128
+ | `logout [service]` | Remove stored credentials for a service |
129
+ | `claude` | Authenticate with Claude CLI |
130
+ | `openai` | Authenticate with OpenAI API |
131
+ | `gemini` | Authenticate with Gemini API |
132
+ | `grok` | Authenticate with xAI Grok API |
133
+
134
+ The `login`, `openai`, `gemini`, and `grok` subcommands accept `--api-key <key>` to provide a key directly.
135
+
136
+ ```bash
137
+ popeye-cli auth status
138
+ popeye-cli auth login openai --api-key sk-...
139
+ popeye-cli auth logout all
140
+ ```
141
+
142
+ ---
143
+
144
+ ### `popeye-cli config <subcommand>`
145
+
146
+ Manage CLI configuration settings.
147
+
148
+ | Subcommand | Description |
149
+ |------------|-------------|
150
+ | `show` | Show current configuration (`--json` for JSON output) |
151
+ | `defaults` | Show default configuration values (`--json` for JSON output) |
152
+ | `get <key>` | Get a specific config value (e.g., `consensus.threshold`) |
153
+ | `path` | Show the configuration file path |
154
+ | `init` | Create a configuration file (`-f, --format <json\|yaml>`) |
155
+
156
+ ```bash
157
+ popeye-cli config show --json
158
+ popeye-cli config get consensus.threshold
159
+ popeye-cli config init --format yaml
160
+ ```
161
+
162
+ ---
163
+
164
+ ### `popeye-cli db <subcommand>`
165
+
166
+ Manage database configuration and setup for fullstack/all projects.
167
+
168
+ | Subcommand | Description |
169
+ |------------|-------------|
170
+ | `status [directory]` | Show database configuration and lifecycle status |
171
+ | `configure [directory]` | Configure database mode (local Docker or managed) and connection URL |
172
+ | `apply [directory]` | Run the full setup pipeline: connectivity check, extensions, migrations, seed, readiness |
173
+
174
+ The `apply` subcommand accepts `--skip-seed` to skip the seed step.
175
+
176
+ ```bash
177
+ popeye-cli db status ./my-project
178
+ popeye-cli db configure ./my-project
179
+ popeye-cli db apply ./my-project --skip-seed
180
+ ```
181
+
182
+ **Database lifecycle**: `unconfigured` -> `configured` -> `applying` -> `ready` (or `error`)
183
+
184
+ ---
185
+
186
+ ### `popeye-cli doctor [directory]`
187
+
188
+ Run comprehensive project and database readiness checks.
189
+
190
+ Checks performed:
191
+ 1. **Project State** -- Verifies `.popeye/` state directory exists
192
+ 2. **DB Layer** -- Confirms database layer was generated
193
+ 3. **Docker Compose** -- Checks PostgreSQL service is defined
194
+ 4. **DATABASE_URL** -- Validates the env var is configured
195
+ 5. **DB Reachability** -- Tests actual database connectivity
196
+ 6. **pgvector Extension** -- Checks if the vector extension is available
197
+ 7. **Migrations Applied** -- Queries `alembic_version` for migration status
198
+ 8. **Health Endpoint** -- Pings the backend `/health/db` endpoint
199
+
200
+ ```bash
201
+ popeye-cli doctor ./my-project
202
+ ```
203
+
204
+ ---
205
+
206
+ ## Interactive Mode Slash Commands
207
+
208
+ Enter these commands during an interactive session (started via `popeye-cli interactive`).
209
+
210
+ ### Help and Info
211
+
212
+ | Command | Description |
213
+ |---------|-------------|
214
+ | `/help`, `/h`, `/?` | Show all available commands |
215
+ | `/info`, `/check` | Show system info: Claude CLI status, API auth status, environment |
216
+
217
+ ### Project Creation and Management
218
+
219
+ | Command | Description |
220
+ |---------|-------------|
221
+ | `/new <idea>` | Start a new project (skips existing project check) |
222
+ | `/resume` | Resume an interrupted project with project discovery |
223
+ | `/status` | Show current project status and progress |
224
+ | `/overview [fix]` | Show full project plan and milestone review. Add `fix` to re-discover docs and auto-fix issues |
225
+
226
+ ```
227
+ /new todo app with drag and drop
228
+ /resume
229
+ /overview fix
230
+ ```
231
+
232
+ ### Authentication
233
+
234
+ | Command | Description |
235
+ |---------|-------------|
236
+ | `/auth` | Re-run the authentication flow for all AI services |
237
+
238
+ ### Configuration
239
+
240
+ | Command | Description |
241
+ |---------|-------------|
242
+ | `/config` | Show full configuration summary |
243
+ | `/config reviewer <provider>` | Set reviewer model (`openai`, `gemini`, `grok`) |
244
+ | `/config arbitrator <provider\|off>` | Set arbitrator model or disable it |
245
+ | `/config language <lang>` | Set project output language |
246
+ | `/config model <provider> [model]` | Show or set AI model for a provider |
247
+
248
+ ### Language and Model Selection
249
+
250
+ | Command | Description |
251
+ |---------|-------------|
252
+ | `/language <lang>`, `/lang`, `/l` | Set output language: `be`, `fe`, `fs`, `web`, `all` |
253
+ | `/model` | Show current models for all providers |
254
+ | `/model <provider>` | Show available models for a provider |
255
+ | `/model <provider> <model>` | Set a specific model for a provider |
256
+
257
+ ```
258
+ /lang fullstack
259
+ /model openai gpt-4o-mini
260
+ /model gemini gemini-2.0-flash
261
+ /model grok grok-3
262
+ ```
263
+
264
+ ### Project Upgrade
265
+
266
+ | Command | Description |
267
+ |---------|-------------|
268
+ | `/upgrade` | Show interactive upgrade menu |
269
+ | `/upgrade <target>` | Upgrade project to a different type (`fullstack`, `website`, `all`, etc.) |
270
+
271
+ Available upgrade paths depend on the current project type:
272
+ - `python` -> `fullstack`, `all`
273
+ - `typescript` -> `fullstack`, `all`
274
+ - `fullstack` -> `all`
275
+ - `website` -> `all`
276
+
277
+ ```
278
+ /upgrade fullstack
279
+ /upgrade all
280
+ ```
281
+
282
+ ### Database and Health
283
+
284
+ | Command | Description |
285
+ |---------|-------------|
286
+ | `/db status` | Show database lifecycle status |
287
+ | `/db configure` | Configure database (redirects to CLI) |
288
+ | `/db apply` | Apply database setup (redirects to CLI) |
289
+ | `/doctor` | Run all readiness checks inline |
290
+
291
+ ### Session Control
292
+
293
+ | Command | Description |
294
+ |---------|-------------|
295
+ | `/clear`, `/cls` | Clear screen and redraw the UI |
296
+ | `/exit`, `/quit`, `/q` | Exit Popeye CLI |
297
+
298
+ ### Default Behavior
299
+
300
+ Typing anything without a `/` prefix treats the input as a project idea for creation or refinement.
301
+
302
+ ---
303
+
304
+ ## Language Aliases
305
+
306
+ | Language | Aliases | What it generates |
307
+ |----------|---------|-------------------|
308
+ | `python` | `be`, `backend`, `py` | FastAPI backend API |
309
+ | `typescript` | `fe`, `frontend`, `ts` | React + Vite frontend |
310
+ | `fullstack` | `fs` | Monorepo: React frontend + FastAPI backend + PostgreSQL |
311
+ | `website` | `web` | Next.js marketing/landing website |
312
+ | `all` | -- | Complete stack: frontend + backend + website + shared packages |
313
+
314
+ ---
315
+
316
+ ## Available AI Models
317
+
318
+ ### OpenAI
319
+
320
+ `gpt-4o`, `gpt-4o-mini`, `gpt-4-turbo`, `o1-preview`, `o1-mini` (custom models also accepted)
321
+
322
+ ### Gemini
323
+
324
+ `gemini-2.0-flash`, `gemini-2.0-pro`, `gemini-1.5-flash`, `gemini-1.5-pro` (custom models also accepted)
325
+
326
+ ### Grok (xAI)
327
+
328
+ `grok-3`, `grok-3-mini`, `grok-2` (custom models also accepted)
329
+
330
+ ---
331
+
332
+ ## Configuration Files
333
+
334
+ Popeye looks for configuration in these files (in order):
335
+
336
+ - `.popeyerc`
337
+ - `.popeyerc.json`
338
+ - `.popeyerc.yaml`
339
+ - `popeye.config.js`
340
+
341
+ ### Config Sections
342
+
343
+ | Section | Keys | Description |
344
+ |---------|------|-------------|
345
+ | `consensus` | `threshold`, `maxIterations`, `temperature`, `maxTokens` | Consensus engine settings |
346
+ | `apis` | `openai.model`, `openai.timeout` | API provider settings |
347
+ | `project` | `defaultLanguage`, `defaultName` | Project defaults |
348
+ | `directories` | `output`, `state` | Directory paths |
349
+ | `output` | `verbose`, `colors`, `progress` | Display settings |
350
+
351
+ ---
352
+
353
+ ## Database Lifecycle States
354
+
355
+ ```
356
+ unconfigured ──> configured ──> applying ──> ready
357
+ ^ │
358
+ │ error <──────┘
359
+ │ │
360
+ └──────────────┘
361
+ ```
362
+
363
+ | State | Meaning |
364
+ |-------|---------|
365
+ | `unconfigured` | No `DATABASE_URL` set, DB layer not configured |
366
+ | `configured` | URL set and DB reachable, migrations not yet applied |
367
+ | `applying` | Setup pipeline is running (migrations, extensions, seed) |
368
+ | `ready` | All checks passed, database is operational |
369
+ | `error` | Setup failed, can retry from `configured` |
370
+
371
+ ---
372
+
373
+ ## Setup Pipeline Steps
374
+
375
+ When you run `popeye-cli db apply`, the pipeline executes these steps in order:
376
+
377
+ 1. **check_connection** -- Verify database is reachable
378
+ 2. **ensure_extensions** -- Create required PostgreSQL extensions (pgvector)
379
+ 3. **apply_migrations** -- Run `alembic upgrade head`
380
+ 4. **seed_minimal** -- Execute seed script if present
381
+ 5. **readiness_tests** -- Verify database is fully operational
382
+ 6. **mark_ready** -- Transition status to `ready`
383
+
384
+ ---
385
+
386
+ ## Quick Examples
387
+
388
+ ```bash
389
+ # Create a fullstack project
390
+ popeye-cli create "task management app" -l fullstack -n taskmaster
391
+
392
+ # Start interactive mode
393
+ popeye-cli
394
+
395
+ # Check project health
396
+ popeye-cli doctor ./taskmaster
397
+
398
+ # Set up the database
399
+ popeye-cli db configure ./taskmaster
400
+ popeye-cli db apply ./taskmaster
401
+
402
+ # Resume after interruption
403
+ popeye-cli resume ./taskmaster
404
+
405
+ # Reset and re-plan
406
+ popeye-cli reset ./taskmaster --phase plan
407
+ ```
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Database CLI command
3
+ * Provides subcommands: status, configure, apply
4
+ */
5
+ import { Command } from 'commander';
6
+ /**
7
+ * Create the db command with subcommands
8
+ */
9
+ export declare function createDbCommand(): Command;
10
+ //# sourceMappingURL=db.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/db.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2PpC;;GAEG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAqBzC"}
@@ -0,0 +1,240 @@
1
+ /**
2
+ * Database CLI command
3
+ * Provides subcommands: status, configure, apply
4
+ */
5
+ import { Command } from 'commander';
6
+ import path from 'node:path';
7
+ import { promises as fsPromises } from 'node:fs';
8
+ import { createInterface } from 'node:readline';
9
+ import { loadProject, updateState } from '../../state/index.js';
10
+ import { DEFAULT_DB_CONFIG } from '../../types/database.js';
11
+ import { transitionDbStatus } from '../../workflow/db-state-machine.js';
12
+ import { runDbSetupPipeline, resolveBackendDir, } from '../../workflow/db-setup-runner.js';
13
+ import { printHeader, printSection, printSuccess, printError, printWarning, printInfo, printKeyValue, startSpinner, succeedSpinner, failSpinner, } from '../output.js';
14
+ /**
15
+ * Prompt the user for a line of input
16
+ */
17
+ function promptLine(question) {
18
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
19
+ return new Promise((resolve) => {
20
+ rl.question(question, (answer) => {
21
+ rl.close();
22
+ resolve(answer.trim());
23
+ });
24
+ });
25
+ }
26
+ /**
27
+ * Display DB status from project state
28
+ */
29
+ async function handleDbStatus(directory) {
30
+ const projectDir = path.resolve(directory);
31
+ try {
32
+ const state = await loadProject(projectDir);
33
+ const dbConfig = state.dbConfig || { ...DEFAULT_DB_CONFIG, designed: false };
34
+ printHeader('Database Status');
35
+ printKeyValue('Designed', dbConfig.designed ? 'Yes' : 'No');
36
+ printKeyValue('Status', dbConfig.status);
37
+ printKeyValue('Mode', dbConfig.mode || 'not set');
38
+ printKeyValue('Vector Required', dbConfig.vectorRequired ? 'Yes' : 'No');
39
+ printKeyValue('Migrations Applied', String(dbConfig.migrationsApplied));
40
+ if (dbConfig.lastError) {
41
+ printSection('Last Error');
42
+ printError(dbConfig.lastError);
43
+ }
44
+ if (dbConfig.readinessCheckedAt) {
45
+ printKeyValue('Last Readiness Check', dbConfig.readinessCheckedAt);
46
+ }
47
+ // Show next steps based on status
48
+ console.log();
49
+ switch (dbConfig.status) {
50
+ case 'unconfigured':
51
+ printInfo('Run "popeye db configure" to set up database connection.');
52
+ break;
53
+ case 'configured':
54
+ printInfo('Run "popeye db apply" to apply migrations and finalize setup.');
55
+ break;
56
+ case 'error':
57
+ printWarning('Database setup failed. Run "popeye db apply" to retry.');
58
+ break;
59
+ case 'ready':
60
+ printSuccess('Database is ready.');
61
+ break;
62
+ case 'applying':
63
+ printInfo('Database setup is in progress...');
64
+ break;
65
+ }
66
+ }
67
+ catch (error) {
68
+ printError(error instanceof Error ? error.message : 'Failed to load project');
69
+ process.exit(1);
70
+ }
71
+ }
72
+ /**
73
+ * Configure database mode and connection URL
74
+ */
75
+ async function handleDbConfigure(directory) {
76
+ const projectDir = path.resolve(directory);
77
+ try {
78
+ const state = await loadProject(projectDir);
79
+ const dbConfig = state.dbConfig || { ...DEFAULT_DB_CONFIG };
80
+ printHeader('Database Configuration');
81
+ // Prompt for mode
82
+ console.log();
83
+ console.log(' Choose database mode:');
84
+ console.log(' 1. local_docker - PostgreSQL via Docker Compose (recommended for dev)');
85
+ console.log(' 2. managed - External managed database (Neon, Supabase, etc.)');
86
+ console.log();
87
+ const modeChoice = await promptLine(' Enter choice [1-2]: ');
88
+ let mode;
89
+ if (modeChoice === '2' || modeChoice === 'managed') {
90
+ mode = 'managed';
91
+ }
92
+ else {
93
+ mode = 'local_docker';
94
+ }
95
+ printKeyValue('Mode', mode);
96
+ // For managed mode, prompt for DATABASE_URL
97
+ if (mode === 'managed') {
98
+ const dbUrl = await promptLine(' Enter DATABASE_URL: ');
99
+ if (!dbUrl) {
100
+ printError('DATABASE_URL is required for managed mode.');
101
+ process.exit(1);
102
+ }
103
+ // Write DATABASE_URL to apps/backend/.env
104
+ const backendDir = resolveBackendDir(projectDir);
105
+ const envPath = path.join(backendDir, '.env');
106
+ let envContent = '';
107
+ try {
108
+ envContent = await fsPromises.readFile(envPath, 'utf-8');
109
+ }
110
+ catch {
111
+ // File doesn't exist yet
112
+ }
113
+ // Replace or add DATABASE_URL
114
+ if (envContent.includes('DATABASE_URL=')) {
115
+ envContent = envContent.replace(/DATABASE_URL=.*/, `DATABASE_URL=${dbUrl}`);
116
+ }
117
+ else {
118
+ envContent += `\nDATABASE_URL=${dbUrl}\n`;
119
+ }
120
+ await fsPromises.writeFile(envPath, envContent, 'utf-8');
121
+ printSuccess(`DATABASE_URL written to ${envPath}`);
122
+ }
123
+ else {
124
+ printInfo('Local Docker mode: PostgreSQL starts with "docker-compose up".');
125
+ printInfo('DATABASE_URL is set automatically in docker-compose.yml.');
126
+ }
127
+ // Update state: transition to configured
128
+ const newStatus = transitionDbStatus(dbConfig.status, 'configured');
129
+ await updateState(projectDir, {
130
+ dbConfig: {
131
+ ...dbConfig,
132
+ mode,
133
+ status: newStatus,
134
+ },
135
+ });
136
+ printSuccess('Database configured successfully.');
137
+ printInfo('Run "popeye db apply" to apply migrations.');
138
+ }
139
+ catch (error) {
140
+ printError(error instanceof Error ? error.message : 'Configuration failed');
141
+ process.exit(1);
142
+ }
143
+ }
144
+ /**
145
+ * Apply database setup (migrations, extensions, readiness)
146
+ */
147
+ async function handleDbApply(directory, options) {
148
+ const projectDir = path.resolve(directory);
149
+ try {
150
+ const state = await loadProject(projectDir);
151
+ const dbConfig = state.dbConfig || { ...DEFAULT_DB_CONFIG };
152
+ printHeader('Database Setup');
153
+ // Transition to applying
154
+ let currentStatus = dbConfig.status;
155
+ if (currentStatus === 'unconfigured') {
156
+ printError('Database not configured. Run "popeye db configure" first.');
157
+ process.exit(1);
158
+ }
159
+ startSpinner('Running database setup pipeline...');
160
+ const result = await runDbSetupPipeline(projectDir, {
161
+ skipSeed: options.skipSeed,
162
+ onStep: (step, status, message) => {
163
+ if (status === 'start') {
164
+ startSpinner(`[${step}] ${message}`);
165
+ }
166
+ else if (status === 'success') {
167
+ succeedSpinner(`[${step}] ${message}`);
168
+ }
169
+ else {
170
+ failSpinner(`[${step}] ${message}`);
171
+ }
172
+ },
173
+ });
174
+ // Print summary
175
+ console.log();
176
+ printSection('Setup Summary');
177
+ for (const step of result.steps) {
178
+ const icon = step.success ? ' [PASS]' : ' [FAIL]';
179
+ const duration = `(${step.durationMs}ms)`;
180
+ if (step.success) {
181
+ printSuccess(`${icon} ${step.step} ${duration}`);
182
+ }
183
+ else {
184
+ printError(`${icon} ${step.step} ${duration}`);
185
+ if (step.error) {
186
+ printError(` ${step.error}`);
187
+ }
188
+ }
189
+ }
190
+ printKeyValue('Total Duration', `${result.totalDurationMs}ms`);
191
+ // Update state with result
192
+ const newStatus = result.success ? 'ready' : 'error';
193
+ const now = new Date().toISOString();
194
+ await updateState(projectDir, {
195
+ dbConfig: {
196
+ ...dbConfig,
197
+ status: newStatus,
198
+ lastError: result.error,
199
+ readinessCheckedAt: result.success ? now : dbConfig.readinessCheckedAt,
200
+ },
201
+ });
202
+ if (result.success) {
203
+ console.log();
204
+ printSuccess('Database setup complete. Status: READY');
205
+ }
206
+ else {
207
+ console.log();
208
+ printError(`Database setup failed: ${result.error}`);
209
+ printInfo('Fix the issue and run "popeye db apply" to retry.');
210
+ process.exit(1);
211
+ }
212
+ }
213
+ catch (error) {
214
+ failSpinner('Setup failed');
215
+ printError(error instanceof Error ? error.message : 'Unknown error');
216
+ process.exit(1);
217
+ }
218
+ }
219
+ /**
220
+ * Create the db command with subcommands
221
+ */
222
+ export function createDbCommand() {
223
+ const db = new Command('db')
224
+ .description('Database management commands');
225
+ db.command('status')
226
+ .description('Show database configuration status')
227
+ .argument('[directory]', 'Project directory', '.')
228
+ .action(handleDbStatus);
229
+ db.command('configure')
230
+ .description('Configure database mode and connection')
231
+ .argument('[directory]', 'Project directory', '.')
232
+ .action(handleDbConfigure);
233
+ db.command('apply')
234
+ .description('Apply database setup (migrations, extensions, readiness)')
235
+ .argument('[directory]', 'Project directory', '.')
236
+ .option('--skip-seed', 'Skip seed step')
237
+ .action(handleDbApply);
238
+ return db;
239
+ }
240
+ //# sourceMappingURL=db.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"db.js","sourceRoot":"","sources":["../../../src/cli/commands/db.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,SAAS,EACT,aAAa,EACb,YAAY,EACZ,cAAc,EACd,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB;;GAEG;AACH,SAAS,UAAU,CAAC,QAAgB;IAClC,MAAM,EAAE,GAAG,eAAe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,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe;IAC7B,MAAM,EAAE,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;SACzB,WAAW,CAAC,8BAA8B,CAAC,CAAC;IAE/C,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,oCAAoC,CAAC;SACjD,QAAQ,CAAC,aAAa,EAAE,mBAAmB,EAAE,GAAG,CAAC;SACjD,MAAM,CAAC,cAAc,CAAC,CAAC;IAE1B,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC;SACpB,WAAW,CAAC,wCAAwC,CAAC;SACrD,QAAQ,CAAC,aAAa,EAAE,mBAAmB,EAAE,GAAG,CAAC;SACjD,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAE7B,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,0DAA0D,CAAC;SACvE,QAAQ,CAAC,aAAa,EAAE,mBAAmB,EAAE,GAAG,CAAC;SACjD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC;SACvC,MAAM,CAAC,aAAa,CAAC,CAAC;IAEzB,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Doctor command
3
+ * Runs comprehensive readiness checks on database and project health
4
+ */
5
+ import { Command } from 'commander';
6
+ import type { ReadinessResult } from '../../types/database-runtime.js';
7
+ /**
8
+ * Run all readiness checks and return structured results
9
+ *
10
+ * @param projectDir - Project root directory
11
+ * @returns ReadinessResult with all check outcomes
12
+ */
13
+ export declare function runDoctorChecks(projectDir: string): Promise<ReadinessResult>;
14
+ /**
15
+ * Create the doctor command
16
+ */
17
+ export declare function createDoctorCommand(): Command;
18
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/doctor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAavF;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CA0MlF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAoC7C"}