@donotdev/cli 0.0.15 → 0.0.17

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 (83) hide show
  1. package/dependencies-matrix.json +67 -147
  2. package/dist/bin/commands/build.js +69 -52
  3. package/dist/bin/commands/bump.js +15 -14
  4. package/dist/bin/commands/create-app.js +258 -55
  5. package/dist/bin/commands/create-project.js +290 -161
  6. package/dist/bin/commands/deploy.js +146 -63
  7. package/dist/bin/commands/dev.js +43 -24
  8. package/dist/bin/commands/doctor.d.ts +6 -0
  9. package/dist/bin/commands/doctor.d.ts.map +1 -0
  10. package/dist/bin/commands/{lint.js → doctor.js} +1370 -146
  11. package/dist/bin/commands/doctor.js.map +1 -0
  12. package/dist/bin/commands/emu.js +295 -107
  13. package/dist/bin/commands/make-admin.js +77519 -11
  14. package/dist/bin/commands/preview.js +44 -25
  15. package/dist/bin/commands/setup.d.ts +6 -0
  16. package/dist/bin/commands/setup.d.ts.map +1 -0
  17. package/dist/bin/commands/setup.js +12123 -0
  18. package/dist/bin/commands/setup.js.map +1 -0
  19. package/dist/bin/commands/type-check.d.ts.map +1 -1
  20. package/dist/bin/commands/type-check.js +2022 -283
  21. package/dist/bin/commands/type-check.js.map +1 -1
  22. package/dist/bin/dndev.js +54 -58
  23. package/dist/bin/donotdev.js +54 -58
  24. package/dist/index.js +860 -459
  25. package/package.json +2 -2
  26. package/templates/app-expo/.env.example +2 -22
  27. package/templates/app-expo/README.md.example +1 -1
  28. package/templates/app-expo/assets/adaptive-icon.png +0 -0
  29. package/templates/app-expo/assets/favicon.png +0 -0
  30. package/templates/app-expo/assets/icon.png +0 -0
  31. package/templates/app-expo/assets/splash.png +0 -0
  32. package/templates/app-expo/src/config/app.ts.example +46 -0
  33. package/templates/app-expo/src/config/providers.ts.example +7 -0
  34. package/templates/app-next/src/config/providers.ts.example +7 -0
  35. package/templates/app-vite/src/config/providers.ts.example +7 -0
  36. package/templates/app-vite/src/pages/HomePage.tsx.example +1 -1
  37. package/templates/functions-firebase/README.md.example +1 -1
  38. package/templates/functions-firebase/functions-firebase/.env.example.example +1 -1
  39. package/templates/functions-firebase/functions-firebase/README.md.example +1 -1
  40. package/templates/functions-firebase/functions-firebase/tsconfig.json.example +1 -1
  41. package/templates/functions-firebase/functions.config.js.example +1 -1
  42. package/templates/functions-supabase/supabase/config.toml.example +59 -0
  43. package/templates/functions-supabase/supabase/functions/.env.example +13 -0
  44. package/templates/functions-supabase/supabase/functions/deno.json.example +8 -0
  45. package/templates/overlay-firebase/env.fragment.example +1 -1
  46. package/templates/overlay-firebase/env.fragment.expo.example +1 -1
  47. package/templates/overlay-firebase/env.fragment.nextjs.example +1 -1
  48. package/templates/overlay-supabase/env.fragment.example +8 -3
  49. package/templates/overlay-supabase/env.fragment.expo.example +8 -3
  50. package/templates/overlay-supabase/env.fragment.nextjs.example +8 -3
  51. package/templates/overlay-vercel/env.fragment.example +1 -1
  52. package/templates/overlay-vercel/env.fragment.nextjs.example +1 -1
  53. package/templates/root-consumer/AI.md.example +15 -0
  54. package/templates/root-consumer/guides/dndev/AGENT_START_HERE.md.example +2 -2
  55. package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +12 -12
  56. package/templates/root-consumer/guides/dndev/INDEX.md.example +3 -3
  57. package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +3 -3
  58. package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +13 -6
  59. package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +149 -988
  60. package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +72 -20
  61. package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +6 -111
  62. package/templates/root-consumer/guides/dndev/SETUP_OAUTH_PROVIDERS.md.example +60 -0
  63. package/templates/root-consumer/guides/dndev/SETUP_STRIPE.md.example +62 -0
  64. package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +124 -33
  65. package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +108 -91
  66. package/templates/root-consumer/guides/dndev/advanced/EMULATORS.md.example +2 -2
  67. package/templates/root-consumer/guides/wai-way/WAI_WAY_CLI.md.example +7 -8
  68. package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +9 -5
  69. package/dist/bin/commands/firebase-setup.d.ts +0 -6
  70. package/dist/bin/commands/firebase-setup.d.ts.map +0 -1
  71. package/dist/bin/commands/firebase-setup.js +0 -7
  72. package/dist/bin/commands/firebase-setup.js.map +0 -1
  73. package/dist/bin/commands/lint.d.ts +0 -11
  74. package/dist/bin/commands/lint.d.ts.map +0 -1
  75. package/dist/bin/commands/lint.js.map +0 -1
  76. package/dist/bin/commands/staging.d.ts +0 -11
  77. package/dist/bin/commands/staging.d.ts.map +0 -1
  78. package/dist/bin/commands/staging.js +0 -12
  79. package/dist/bin/commands/staging.js.map +0 -1
  80. package/dist/bin/commands/supabase-setup.d.ts +0 -6
  81. package/dist/bin/commands/supabase-setup.d.ts.map +0 -1
  82. package/dist/bin/commands/supabase-setup.js +0 -7
  83. package/dist/bin/commands/supabase-setup.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donotdev/cli",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "Command-line interface for DoNotDev Framework",
5
5
  "type": "module",
6
6
  "private": false,
@@ -30,7 +30,7 @@
30
30
  "build": "dndev bundle --package @donotdev/cli",
31
31
  "dev": "tsc --watch",
32
32
  "clean": "rimraf dist tsconfig.tsbuildinfo",
33
- "type-check": "tsc --noEmit"
33
+ "type-check": "bunx tsc --noEmit"
34
34
  },
35
35
  "dependencies": {
36
36
  "@clack/prompts": "^1.0.1",
@@ -28,29 +28,9 @@ EXPO_PUBLIC_DONOTDEV_LICENSE_KEY=dndev_your_key_here
28
28
  # EXPO_PUBLIC_SPOTIFY_CLIENT_ID=your_spotify_client_id
29
29
 
30
30
  # =============================================================================
31
- # Firebase Configuration
31
+ # Backend-specific vars are appended below by your backend choice
32
+ # (Firebase, Supabase, etc.) — see overlay templates
32
33
  # =============================================================================
33
- # Get these values from your Firebase project settings
34
- # Run `dndev firebase:setup` to auto-populate, or copy from Firebase Console
35
- EXPO_PUBLIC_FIREBASE_API_KEY=
36
- EXPO_PUBLIC_FIREBASE_PROJECT_ID=
37
- EXPO_PUBLIC_FIREBASE_AUTH_DOMAIN=
38
- EXPO_PUBLIC_FIREBASE_STORAGE_BUCKET=
39
- EXPO_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
40
- EXPO_PUBLIC_FIREBASE_APP_ID=
41
- EXPO_PUBLIC_FIREBASE_MEASUREMENT_ID=
42
- EXPO_PUBLIC_FIREBASE_FUNCTIONS_REGION=
43
-
44
- # =============================================================================
45
- # Firebase Emulator (Development only)
46
- # =============================================================================
47
- # Set to true to use Firebase emulators instead of production services
48
- EXPO_PUBLIC_USE_FIREBASE_EMULATOR=false
49
- EXPO_PUBLIC_FIREBASE_EMULATOR_HOST=localhost
50
- EXPO_PUBLIC_FIREBASE_EMULATOR_PORT=9099
51
- EXPO_PUBLIC_FIREBASE_AUTH_EMULATOR_HOST=http://localhost:9099
52
- EXPO_PUBLIC_FIREBASE_FIRESTORE_EMULATOR_HOST=localhost:8080
53
- EXPO_PUBLIC_FIREBASE_FUNCTIONS_EMULATOR_PORT=5001
54
34
 
55
35
  # =============================================================================
56
36
  # Stripe Configuration (if using billing)
@@ -8,7 +8,7 @@ Mobile app built with DoNotDev Framework and Expo.
8
8
 
9
9
  - Node.js 20+ and Bun 1.3+
10
10
  - Expo Go app on your phone (for development)
11
- - Firebase project (run `dndev firebase:setup`)
11
+ - Firebase project (run `dndev setup firebase`)
12
12
 
13
13
  ### Development
14
14
 
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @fileoverview Application Configuration (Expo)
3
+ *
4
+ * THIS FILE IS YOUR MAIN CONFIGURATION. Update the values below.
5
+ *
6
+ * QUICK START:
7
+ * 1. Set APP_NAME and APP_SHORT_NAME
8
+ * 2. Run `bun dev` - everything else is automatic
9
+ */
10
+
11
+ import type { AppConfig } from '@donotdev/core';
12
+
13
+ // ============================================================================
14
+ // APP IDENTITY - Update these values
15
+ // ============================================================================
16
+
17
+ export const APP_NAME = '{{appName}}';
18
+ export const APP_SHORT_NAME = '{{appShortName}}';
19
+ export const APP_DESCRIPTION = 'Built with DoNotDev Framework';
20
+
21
+ // ============================================================================
22
+ // MAIN CONFIGURATION
23
+ // ============================================================================
24
+
25
+ export const appConfig: AppConfig = {
26
+ app: {
27
+ name: APP_NAME,
28
+ shortName: APP_SHORT_NAME,
29
+ description: APP_DESCRIPTION,
30
+ },
31
+
32
+ // ==========================================================================
33
+ // FEATURES - Uncomment to enable
34
+ // ==========================================================================
35
+ features: {
36
+ // debug: true, // Enable debug tools in development
37
+ },
38
+
39
+ // ==========================================================================
40
+ // AUTH CONFIG - Uncomment to customize
41
+ // ==========================================================================
42
+ // auth: {
43
+ // authRoute: '/signin',
44
+ // profilePath: '/profile',
45
+ // },
46
+ };
@@ -0,0 +1,7 @@
1
+ // src/config/providers.ts — Provider bootstrap
2
+ // Auto-generated by DoNotDev scaffolding. Edit freely.
3
+ // When you add a backend (Firebase, Supabase), replace this file with the appropriate provider setup.
4
+ // See: guides/dndev/SETUP_PROVIDERS.md
5
+
6
+ // No backend configured — nothing to register.
7
+ // To add a backend later, run: dndev create-app (in an existing project, it merges)
@@ -0,0 +1,7 @@
1
+ // src/config/providers.ts — Provider bootstrap
2
+ // Auto-generated by DoNotDev scaffolding. Edit freely.
3
+ // When you add a backend (Firebase, Supabase), replace this file with the appropriate provider setup.
4
+ // See: guides/dndev/SETUP_PROVIDERS.md
5
+
6
+ // No backend configured — nothing to register.
7
+ // To add a backend later, run: dndev create-app (in an existing project, it merges)
@@ -0,0 +1,7 @@
1
+ // src/config/providers.ts — Provider bootstrap
2
+ // Auto-generated by DoNotDev scaffolding. Edit freely.
3
+ // When you add a backend (Firebase, Supabase), replace this file with the appropriate provider setup.
4
+ // See: guides/dndev/SETUP_PROVIDERS.md
5
+
6
+ // No backend configured — nothing to register.
7
+ // To add a backend later, run: dndev create-app (in an existing project, it merges)
@@ -53,7 +53,7 @@ export default function HomePage() {
53
53
  <Card
54
54
  title="2. Firebase Setup"
55
55
  content={[
56
- 'Run: dndev firebase:setup',
56
+ 'Run: dndev setup firebase',
57
57
  'This will:',
58
58
  ' - Create or select a Firebase project',
59
59
  ' - Create a web app if needed',
@@ -76,7 +76,7 @@ GITHUB_REPO_NAME=your-repo
76
76
 
77
77
  # Firebase Configuration
78
78
  FIREBASE_PROJECT_ID=your-project-id
79
- FIREBASE_REGION=us-central1
79
+ FIREBASE_REGION={{YOUR_REGION}}
80
80
  ```
81
81
 
82
82
  ### Setup Instructions
@@ -35,7 +35,7 @@ STRIPE_WEBHOOK_SECRET=whsec_...
35
35
  # Firebase Configuration (auto-detected, rarely needed manually)
36
36
  # =============================================================================
37
37
  FIREBASE_PROJECT_ID=your-project-id
38
- FIREBASE_REGION=us-central1
38
+ FIREBASE_REGION={{YOUR_REGION}}
39
39
 
40
40
  # =============================================================================
41
41
  # Development
@@ -49,7 +49,7 @@ GITHUB_REPO_NAME=your-repo
49
49
 
50
50
  # Firebase Configuration
51
51
  FIREBASE_PROJECT_ID=your-project-id
52
- FIREBASE_REGION=us-central1
52
+ FIREBASE_REGION={{YOUR_REGION}}
53
53
  ```
54
54
 
55
55
  ### Setup Instructions
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "../../../tsconfig.functions.json",
2
+ "extends": "../../../../tsconfig.functions.json",
3
3
  "compilerOptions": {
4
4
  "outDir": "./lib",
5
5
  "rootDir": "./src",
@@ -14,7 +14,7 @@
14
14
 
15
15
  export const functionsConfig = {
16
16
  defaults: {
17
- region: ['us-central1'],
17
+ region: ['{{YOUR_REGION}}'],
18
18
  platform: 'gcfv2',
19
19
  labels: { app: '{{APP_NAME}}' },
20
20
  },
@@ -0,0 +1,59 @@
1
+ # For detailed configuration reference documentation, visit:
2
+ # https://supabase.com/docs/guides/local-development/cli/config
3
+ project_id = "{{projectName}}"
4
+
5
+ [api]
6
+ enabled = true
7
+ port = 54321
8
+ schemas = ["public", "graphql_public"]
9
+ extra_search_path = ["public", "extensions"]
10
+ max_rows = 1000
11
+
12
+ [db]
13
+ port = 54322
14
+ shadow_port = 54320
15
+ major_version = 17
16
+
17
+ [db.pooler]
18
+ enabled = false
19
+ port = 54329
20
+ pool_mode = "transaction"
21
+ default_pool_size = 20
22
+ max_client_conn = 100
23
+
24
+ [db.migrations]
25
+ enabled = true
26
+
27
+ [db.seed]
28
+ enabled = true
29
+ sql_paths = ["./seed.sql"]
30
+
31
+ [auth]
32
+ enabled = true
33
+ site_url = "http://127.0.0.1:3000"
34
+ additional_redirect_urls = ["https://127.0.0.1:3000"]
35
+ jwt_expiry = 3600
36
+ enable_refresh_token_rotation = true
37
+ refresh_token_reuse_interval = 10
38
+ enable_signup = true
39
+ enable_anonymous_sign_ins = false
40
+ minimum_password_length = 6
41
+
42
+ [auth.email]
43
+ enable_signup = true
44
+ double_confirm_changes = true
45
+ enable_confirmations = false
46
+
47
+ [storage]
48
+ enabled = true
49
+ file_size_limit = "50MiB"
50
+
51
+ [edge_runtime]
52
+ enabled = true
53
+ policy = "per_worker"
54
+ inspector_port = 8083
55
+
56
+ [analytics]
57
+ enabled = true
58
+ port = 54327
59
+ backend = "postgres"
@@ -0,0 +1,13 @@
1
+ # =============================================================================
2
+ # Supabase Edge Functions — Secret Keys (DO NOT COMMIT)
3
+ # =============================================================================
4
+ # Get these from: https://supabase.com/dashboard > your project > Settings
5
+ #
6
+ # Secret key: Settings > API > service_role key (or "Secret key" on new projects)
7
+ # DB URL: Settings > Database > Connection string > URI
8
+ #
9
+ # These are SERVER-SIDE ONLY. Never expose in client code.
10
+ # =============================================================================
11
+
12
+ SUPABASE_SECRET_KEY=
13
+ SUPABASE_DB_URL=
@@ -0,0 +1,8 @@
1
+ {
2
+ "imports": {
3
+ "@donotdev/functions/supabase": "npm:@donotdev/functions/supabase",
4
+ "@donotdev/core/server": "npm:@donotdev/core/server",
5
+ "@supabase/supabase-js": "npm:@supabase/supabase-js",
6
+ "valibot": "npm:valibot"
7
+ }
8
+ }
@@ -3,7 +3,7 @@
3
3
  # Firebase Configuration
4
4
  # =============================================================================
5
5
  # Get these values from your Firebase project settings
6
- # Run `dndev firebase:setup` to auto-populate, or copy from Firebase Console
6
+ # Run `dndev setup firebase` to auto-populate, or copy from Firebase Console
7
7
  VITE_FIREBASE_API_KEY=
8
8
  VITE_FIREBASE_PROJECT_ID=
9
9
  # Copy from Firebase Console. Framework uses APP_URL hostname in production automatically.
@@ -3,7 +3,7 @@
3
3
  # Firebase Configuration
4
4
  # =============================================================================
5
5
  # Get these values from your Firebase project settings
6
- # Run `dndev firebase:setup` to auto-populate, or copy from Firebase Console
6
+ # Run `dndev setup firebase` to auto-populate, or copy from Firebase Console
7
7
  EXPO_PUBLIC_FIREBASE_API_KEY=
8
8
  EXPO_PUBLIC_FIREBASE_PROJECT_ID=
9
9
  # Copy from Firebase Console. Framework uses APP_URL hostname in production automatically.
@@ -3,7 +3,7 @@
3
3
  # Firebase Configuration
4
4
  # =============================================================================
5
5
  # Get these values from your Firebase project settings
6
- # Run `dndev firebase:setup` to auto-populate, or copy from Firebase Console
6
+ # Run `dndev setup firebase` to auto-populate, or copy from Firebase Console
7
7
  NEXT_PUBLIC_FIREBASE_API_KEY=
8
8
  NEXT_PUBLIC_FIREBASE_PROJECT_ID=
9
9
  # Copy from Firebase Console. Framework uses APP_URL hostname in production automatically.
@@ -1,7 +1,12 @@
1
1
 
2
2
  # =============================================================================
3
- # Supabase Configuration
3
+ # Supabase Configuration (PUBLIC — safe to commit)
4
+ # =============================================================================
5
+ # Get these from: https://supabase.com/dashboard > your project > Settings > API
6
+ # - Project URL: the https://xxx.supabase.co URL
7
+ # - Public key: "Publishable key" (sb_publishable_...) or legacy "anon key" (eyJ...)
8
+ #
9
+ # Then run: dndev setup supabase
4
10
  # =============================================================================
5
- # Get these values from your Supabase project settings > API
6
11
  VITE_SUPABASE_URL=
7
- VITE_SUPABASE_ANON_KEY=
12
+ VITE_SUPABASE_PUBLIC_KEY=
@@ -1,7 +1,12 @@
1
1
 
2
2
  # =============================================================================
3
- # Supabase Configuration
3
+ # Supabase Configuration (PUBLIC — safe to commit)
4
+ # =============================================================================
5
+ # Get these from: https://supabase.com/dashboard > your project > Settings > API
6
+ # - Project URL: the https://xxx.supabase.co URL
7
+ # - Public key: "Publishable key" (sb_publishable_...) or legacy "anon key" (eyJ...)
8
+ #
9
+ # Then run: dndev setup supabase
4
10
  # =============================================================================
5
- # Get these values from your Supabase project settings > API
6
11
  EXPO_PUBLIC_SUPABASE_URL=
7
- EXPO_PUBLIC_SUPABASE_ANON_KEY=
12
+ EXPO_PUBLIC_SUPABASE_PUBLIC_KEY=
@@ -1,7 +1,12 @@
1
1
 
2
2
  # =============================================================================
3
- # Supabase Configuration
3
+ # Supabase Configuration (PUBLIC — safe to commit)
4
+ # =============================================================================
5
+ # Get these from: https://supabase.com/dashboard > your project > Settings > API
6
+ # - Project URL: the https://xxx.supabase.co URL
7
+ # - Public key: "Publishable key" (sb_publishable_...) or legacy "anon key" (eyJ...)
8
+ #
9
+ # Then run: dndev setup supabase
4
10
  # =============================================================================
5
- # Get these values from your Supabase project settings > API
6
11
  NEXT_PUBLIC_SUPABASE_URL=
7
- NEXT_PUBLIC_SUPABASE_ANON_KEY=
12
+ NEXT_PUBLIC_SUPABASE_PUBLIC_KEY=
@@ -3,7 +3,7 @@
3
3
  # Firebase Configuration (data layer for Vercel-hosted app)
4
4
  # =============================================================================
5
5
  # Get these values from your Firebase project settings
6
- # Run `dndev firebase:setup` to auto-populate, or copy from Firebase Console
6
+ # Run `dndev setup firebase` to auto-populate, or copy from Firebase Console
7
7
  VITE_FIREBASE_API_KEY=
8
8
  VITE_FIREBASE_PROJECT_ID=
9
9
  # Copy from Firebase Console. Framework uses APP_URL hostname in production automatically.
@@ -3,7 +3,7 @@
3
3
  # Firebase Configuration (data layer for Vercel-hosted app)
4
4
  # =============================================================================
5
5
  # Get these values from your Firebase project settings
6
- # Run `dndev firebase:setup` to auto-populate, or copy from Firebase Console
6
+ # Run `dndev setup firebase` to auto-populate, or copy from Firebase Console
7
7
  NEXT_PUBLIC_FIREBASE_API_KEY=
8
8
  NEXT_PUBLIC_FIREBASE_PROJECT_ID=
9
9
  # Copy from Firebase Console. Framework uses APP_URL hostname in production automatically.
@@ -36,6 +36,21 @@ approve_phase() → phase done, move to next
36
36
 
37
37
  Without MCP: read `.d.ts` files directly from `node_modules/@donotdev/*/dist/`.
38
38
 
39
+ ## CLI Commands
40
+
41
+ `dndev` is an **installed CLI** (globally via `npm install -g @donotdev/cli`). Run it directly — **never** use `bunx dndev` or `npx dndev`.
42
+
43
+ | Command | What it does |
44
+ |---------|-------------|
45
+ | `dndev create-app` | Interactive wizard — creates a new app in the monorepo |
46
+ | `dndev dev` | Start the dev server (Vite/Next.js via Turbo) |
47
+ | `dndev emu start` | Start Firebase emulators |
48
+ | `dndev deploy` | Deploy to production |
49
+ | `dndev setup firebase` | Configure Firebase project + .env |
50
+ | `dndev setup supabase` | Configure Supabase project + .env |
51
+
52
+ `dndev create-app` is **interactive** — it prompts for builder (Vite/Next.js/Expo), backend (Firebase/Supabase/none), and features. There is no `--preset` flag.
53
+
39
54
  ## Rules
40
55
 
41
56
  - **ESM only** — never `require()`
@@ -46,7 +46,7 @@ Call `start_phase(N)` to begin each phase. It returns the blueprint, agent perso
46
46
 
47
47
  ### Phase 1: SCAFFOLD (Extractor)
48
48
  - **MCP:** `start_phase(1)`
49
- - **Goal:** Running skeleton. Use `dndev create-app` and create `*Page.tsx` stubs.
49
+ - **Goal:** Running skeleton. Run `dndev create-app` (interactive wizard, run directly — never `bunx`) and create `*Page.tsx` stubs.
50
50
 
51
51
  ### Phase 2: ENTITIES (Architect)
52
52
  - **MCP:** `start_phase(2)`
@@ -81,7 +81,7 @@ Check that the user has completed environment setup:
81
81
  2. Service account key exists? (`service-account-key.json` in app root)
82
82
  3. Emulators work? (`dndev emu start` runs without errors)
83
83
 
84
- If not, coach them: "Run `dndev firebase:setup` first, then follow the prompts." See [SETUP_FIREBASE.md](./SETUP_FIREBASE.md).
84
+ If not, coach them: "Run `dndev setup firebase` first, then follow the prompts." See [SETUP_FIREBASE.md](./SETUP_FIREBASE.md).
85
85
 
86
86
  ---
87
87
 
@@ -9,11 +9,11 @@ If you haven’t run `dndev init` yet, see [AGENT_START_HERE.md](./AGENT_START_H
9
9
  ## The Flow
10
10
 
11
11
  ```
12
- bun install -> install dependencies
13
- bun dev -> start app, read the homepage setup guide
14
- dndev firebase:setup -> configure Firebase project + .env
12
+ bun install install dependencies
13
+ dndev dev -> start app, read the homepage setup guide
14
+ dndev setup firebase -> configure Firebase project + .env
15
15
  -- or --
16
- dndev supabase:setup -> configure Supabase project + .env
16
+ dndev setup supabase -> configure Supabase project + .env
17
17
  dndev emu start -> test locally with emulators (Firebase)
18
18
  dndev deploy -> deploy to production
19
19
  ```
@@ -24,7 +24,7 @@ dndev deploy -> deploy to production
24
24
 
25
25
  ```bash
26
26
  bun install
27
- bun dev
27
+ dndev dev
28
28
  ```
29
29
 
30
30
  Open the app. The homepage shows every setup step with instructions.
@@ -52,7 +52,7 @@ git push -u origin main
52
52
  ### Firebase
53
53
 
54
54
  ```bash
55
- dndev firebase:setup
55
+ dndev setup firebase
56
56
  ```
57
57
 
58
58
  Automates: project selection/creation, web app, SDK config -> `.env`, `.firebaserc`.
@@ -66,14 +66,14 @@ See [SETUP_FIREBASE.md](./SETUP_FIREBASE.md) for full details.
66
66
  ### Supabase
67
67
 
68
68
  ```bash
69
- dndev supabase:setup
69
+ dndev setup supabase
70
70
  ```
71
71
 
72
72
  Asks for your **public** project URL and anon key (both safe to share -- shipped in client bundle).
73
73
 
74
74
  Get them from: https://supabase.com/dashboard -> your project -> Settings -> API
75
75
 
76
- See [SETUP_SUPABASE.md](./SETUP_SUPABASE.md) for full details (tables, RLS, `dn generate sql`). See [Secrets Philosophy](#secrets-philosophy) for how we handle secret keys.
76
+ See [SETUP_SUPABASE.md](./SETUP_SUPABASE.md) for full details (tables, RLS, `dndev generate sql`). See [Secrets Philosophy](#secrets-philosophy) for how we handle secret keys.
77
77
 
78
78
  ---
79
79
 
@@ -186,10 +186,10 @@ my-project/
186
186
 
187
187
  | Command | What It Does |
188
188
  |---------|-------------|
189
- | `bun dev` | Start dev server |
189
+ | `dndev dev` | Start dev server |
190
190
  | `dndev emu start` | Start Firebase emulators |
191
- | `dndev firebase:setup` | Configure Firebase project + .env |
192
- | `dndev supabase:setup` | Configure Supabase project + .env |
191
+ | `dndev setup firebase` | Configure Firebase project + .env |
192
+ | `dndev setup supabase` | Configure Supabase project + .env |
193
193
  | `dndev deploy` | **Firebase:** hosting + functions + rules. **Supabase:** deploys frontend to [Vercel](https://vercel.com) (via scaffolded vercel.json) and Edge Functions to Supabase. Set `VITE_SUPABASE_*` in Vercel project env. |
194
194
  | `dndev staging` | Deploy to staging environment |
195
195
  | `dndev sync-secrets` | Push functions/.env to runtime (Firebase/Vercel) |
@@ -215,4 +215,4 @@ my-project/
215
215
 
216
216
  ---
217
217
 
218
- **Start here: `bun install && bun dev`. The homepage tells you everything else.**
218
+ **Start here: `bun install && dndev dev`. The homepage tells you everything else.**
@@ -11,8 +11,8 @@
11
11
  - **Human flow:** P0 (Bun/Node + AI IDE) → Install CLI & `dndev init` → Run **AI.md** → Enjoy. See [AGENT_START_HERE.md](./AGENT_START_HERE.md) § Getting started (for humans).
12
12
  - [ENV_SETUP.md](./ENV_SETUP.md) — After `dndev init`: env, Firebase/Supabase, deploy
13
13
  - [GOTCHAS.md](./GOTCHAS.md) - **Common mistakes & pitfalls** (phase-tagged, read before coding)
14
- - [SETUP_FIREBASE.md](./SETUP_FIREBASE.md) - Firebase project setup (`dndev firebase:setup`)
15
- - [SETUP_SUPABASE.md](./SETUP_SUPABASE.md) - Supabase project setup (`dndev supabase:setup`, `dn generate sql`)
14
+ - [SETUP_FIREBASE.md](./SETUP_FIREBASE.md) - Firebase project setup (`dndev setup firebase`)
15
+ - [SETUP_SUPABASE.md](./SETUP_SUPABASE.md) - Supabase project setup (`dndev setup supabase`, `dndev generate sql`)
16
16
  - [SETUP_TESTING.md](./SETUP_TESTING.md) - Test generation (Phase 4)
17
17
 
18
18
  ---
@@ -36,7 +36,7 @@
36
36
  - [SETUP_BILLING.md](./SETUP_BILLING.md) - Stripe subscriptions (pre-configured)
37
37
  - [SETUP_BLOG.md](./SETUP_BLOG.md) - Convention-based markdown blog with i18n
38
38
  - [SETUP_PWA.md](./SETUP_PWA.md) - Progressive Web App setup
39
- - [SETUP_FUNCTIONS.md](./SETUP_FUNCTIONS.md) - Firebase Functions (pre-configured)
39
+ - [SETUP_FUNCTIONS.md](./SETUP_FUNCTIONS.md) - Functions overview (redirects to provider guides)
40
40
 
41
41
  ---
42
42
 
@@ -109,14 +109,14 @@ export default defineViteConfig({
109
109
 
110
110
  **Vite loads `.env` from the app directory only.** Not the repo root.
111
111
 
112
- Run `dndev firebase:setup` to auto-populate Firebase config. See [SETUP_FIREBASE.md](./SETUP_FIREBASE.md).
112
+ Run `dndev setup firebase` to auto-populate Firebase config. See [SETUP_FIREBASE.md](./SETUP_FIREBASE.md).
113
113
 
114
114
  ```bash
115
115
  # apps/<your-app>/.env — client-side variables (exposed to browser)
116
116
  VITE_APP_URL=http://localhost:5173
117
117
  VITE_DONOTDEV_LICENSE_KEY=dndev_your_key_here
118
- VITE_FIREBASE_API_KEY=... # Written by dndev firebase:setup
119
- VITE_FIREBASE_PROJECT_ID=... # Written by dndev firebase:setup
118
+ VITE_FIREBASE_API_KEY=... # Written by dndev setup firebase
119
+ VITE_FIREBASE_PROJECT_ID=... # Written by dndev setup firebase
120
120
  VITE_AUTH_PARTNERS=github,google
121
121
  VITE_STRIPE_PUBLISHABLE_KEY=pk_test_...
122
122
 
@@ -1,6 +1,6 @@
1
- # Setup: Authentication (Firebase Auth)
1
+ # Setup: Authentication
2
2
 
3
- **Most is pre-configured.** Firebase Auth for user sign-in/sign-up. Add env vars and config. Framework handles providers, callbacks, sessions.
3
+ **Most is pre-configured.** Works with Firebase Auth or Supabase Auth. Add env vars and config. Framework handles providers, callbacks, sessions.
4
4
 
5
5
  ---
6
6
 
@@ -24,7 +24,8 @@ export const appConfig: AppConfig = {
24
24
  };
25
25
  ```
26
26
 
27
- **Firebase Console:** Enable providers in Authentication > Sign-in method
27
+ **Firebase:** Enable providers in Firebase Console → Authentication Sign-in method
28
+ **Supabase:** Enable providers in Supabase Dashboard → Authentication → Providers
28
29
 
29
30
  ---
30
31
 
@@ -80,10 +81,10 @@ const signOut = useAuth('signOut');
80
81
 
81
82
  **Default:** All authenticated users are `'user'` role.
82
83
 
83
- **Setting admin/super roles:** Set Firebase Auth customClaims:
84
+ **Setting admin/super roles:**
84
85
 
86
+ **Firebase** — Set customClaims:
85
87
  ```typescript
86
- // Using Firebase Admin SDK
87
88
  import { getFirebaseAdminAuth } from '@donotdev/firebase/server';
88
89
 
89
90
  const auth = getFirebaseAdminAuth();
@@ -93,12 +94,18 @@ await auth.setCustomUserClaims(userId, {
93
94
  });
94
95
  ```
95
96
 
97
+ **Supabase** — Set user metadata:
98
+ ```sql
99
+ -- In Supabase Dashboard → SQL Editor
100
+ UPDATE auth.users SET raw_app_meta_data = raw_app_meta_data || '{"role": "admin"}' WHERE id = '<user-id>';
101
+ ```
102
+
96
103
  **Using CLI:**
97
104
  ```bash
98
105
  dndev make-admin <userId>
99
106
  ```
100
107
 
101
- **Note:** User must sign out and sign in again for role changes to take effect (customClaims are in the ID token).
108
+ **Note:** User must sign out and sign in again for role changes to take effect.
102
109
 
103
110
  **Used by:** CRUD access control, protected routes, field visibility filtering.
104
111