You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--platform=<id> Target AI platform adapter (default: claude-code)
413
+
-h, --help Show this help
410
414
411
415
Examples:
412
416
npx popilot init my-project
413
417
npx popilot@latest hydrate
414
418
npx popilot@latest hydrate --force
415
419
npx popilot doctor
420
+
npx popilot deploy
421
+
npx popilot migrate
416
422
npx popilot my-project # same as: popilot init my-project
417
423
```
418
424
425
+
### Command Details
426
+
427
+
#### `init [dir]`
428
+
429
+
Scaffolds a new Popilot project, runs the interactive setup wizard, and hydrates all templates.
430
+
431
+
```bash
432
+
npx popilot init my-project
433
+
npx popilot init my-project --skip-spec-site
434
+
npx popilot init my-project --platform=codex
435
+
```
436
+
437
+
- Creates the full `.context/`, `spec-site/` (unless `--skip-spec-site`), and agent scaffold
438
+
- Runs the interactive setup wizard to collect project info, user preferences, and integrations
439
+
- Hydrates all `.hbs` template files using the collected config
440
+
441
+
#### `hydrate [dir]`
442
+
443
+
Syncs the latest scaffold templates and re-hydrates all `.hbs` files from the existing `project.yaml`. Use this after upgrading Popilot or editing `project.yaml` manually.
444
+
445
+
```bash
446
+
npx popilot@latest hydrate # safe: adds missing files only
447
+
npx popilot@latest hydrate --force # full refresh: overwrites scaffold files
448
+
```
449
+
450
+
-`hydrate` now syncs the latest scaffold before rendering.
451
+
- Use `--force` only when you intentionally want to replace existing scaffold-managed files.
452
+
453
+
#### `deploy [dir]`
454
+
455
+
Deploys the `pm-api` backend to Cloudflare Workers. Requires Tier 2 setup (pm-api present) and `wrangler` authentication.
456
+
457
+
```bash
458
+
npx popilot deploy
459
+
```
460
+
461
+
Prerequisites:
462
+
1. Run `npx wrangler login` to authenticate with Cloudflare
463
+
2. Ensure `project.yaml` is hydrated (run `popilot hydrate` first)
464
+
3.`pm-api/wrangler.toml` must exist
465
+
466
+
#### `migrate [dir]`
467
+
468
+
Runs SQL schema migrations against the Cloudflare D1 database configured in `pm-api/wrangler.toml`. Applies `schema-core.sql` plus feature-specific schemas based on `project.yaml` flags, then runs any numbered migration files (`NNN-*.sql`) in order.
5.`NNN-*.sql` numbered migrations (sorted by prefix)
480
+
481
+
Already-applied migrations are skipped automatically (duplicate column detection).
482
+
483
+
#### `doctor [dir]`
484
+
485
+
Checks the health of your Popilot installation and reports any missing or misconfigured files.
486
+
487
+
```bash
488
+
npx popilot doctor
489
+
```
490
+
491
+
Exits with code `0` if all checks pass, `1` if any checks fail.
492
+
493
+
### `--platform` Option
494
+
495
+
The `--platform` flag selects the AI coding agent adapter. Each adapter customizes the system prompt file, slash command directory, and platform-specific instructions.
496
+
497
+
| Platform ID | Target | Description |
498
+
|-------------|--------|-------------|
499
+
|`claude-code`|`CLAUDE.md` + `.claude/commands/`| Anthropic Claude Code (default) |
### `popilot init` fails with "Existing Popilot structure detected"
550
+
551
+
You're running `init` in a directory that already has Popilot files. Options:
552
+
553
+
```bash
554
+
# Overwrite existing files
555
+
npx popilot init my-project --force
556
+
557
+
# Or run in a fresh directory
558
+
npx popilot init new-project
559
+
```
560
+
561
+
### Templates not updating after editing `project.yaml`
562
+
563
+
Run `hydrate` to re-render all templates:
564
+
565
+
```bash
566
+
npx popilot@latest hydrate
567
+
```
568
+
569
+
If you want to also pull down the latest scaffold files from this version:
570
+
571
+
```bash
572
+
npx popilot@latest hydrate --force
573
+
```
574
+
575
+
### `deploy` fails: "wrangler.toml not found"
576
+
577
+
You need to hydrate first so the `.hbs` template is rendered:
578
+
579
+
```bash
580
+
npx popilot hydrate
581
+
npx popilot deploy
582
+
```
583
+
584
+
### `deploy` fails: "Not authenticated"
585
+
586
+
Log in to Cloudflare:
587
+
588
+
```bash
589
+
npx wrangler login
590
+
npx popilot deploy
591
+
```
592
+
593
+
### `migrate` fails with "duplicate column" / "already exists"
594
+
595
+
This is expected for idempotent re-runs — Popilot automatically skips migrations that have already been applied. Safe to ignore.
596
+
597
+
### MCP connection not working (`/mcp` shows no tools)
598
+
599
+
1. Ensure `mcp-pm` was built: `cd mcp-pm && npm run build` (generates `dist/index.js`)
600
+
2. Verify `.mcp.json` has the correct `PM_API_URL` and `PM_TOKEN`
601
+
3. Restart Claude Code to reload MCP servers
602
+
603
+
```bash
604
+
# Rebuild mcp-pm
605
+
cd your-project/mcp-pm
606
+
npm install
607
+
npm run build
608
+
```
609
+
610
+
### Oscar not responding / slash commands missing
611
+
612
+
Your system prompt file may not be hydrated. Run:
613
+
614
+
```bash
615
+
npx popilot@latest hydrate
616
+
```
617
+
618
+
Then re-open Claude Code — it loads `CLAUDE.md` (or `AGENTS.md` / `GEMINI.md`) on startup.
619
+
620
+
### `spec-site` fails to start
621
+
622
+
```bash
623
+
cd your-project/spec-site
624
+
npm install # install/reinstall dependencies
625
+
npm run dev # → http://localhost:5173
626
+
```
627
+
628
+
If `npm run dev` errors on a Turso/retro feature, ensure `VITE_TURSO_URL` and `VITE_TURSO_TOKEN` are set in `spec-site/.env.local` (or disable that feature in `project.yaml`).
629
+
630
+
### `doctor` reports failures
631
+
632
+
Run `popilot doctor` for a detailed health report:
633
+
634
+
```bash
635
+
npx popilot doctor
636
+
```
637
+
638
+
Fix each reported issue, then re-run to confirm all checks pass.
0 commit comments