@vaiftech/cli 1.9.7 → 1.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/{chunk-T7GOLIY4.js → chunk-KHEM3PLW.js} +20 -20
- package/dist/cli.cjs +199 -70
- package/dist/cli.js +157 -28
- package/dist/index.cjs +39 -39
- package/dist/index.js +1 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -234,7 +234,7 @@ vaif keys list # List all keys
|
|
|
234
234
|
Manage encrypted secrets that your VAIF Functions can access at runtime. Secret values are encrypted at rest and injected into function invocations automatically.
|
|
235
235
|
|
|
236
236
|
```bash
|
|
237
|
-
vaif secrets set API_KEY
|
|
237
|
+
vaif secrets set API_KEY YOUR_API_KEY # Create or update a secret
|
|
238
238
|
vaif secrets set CERT --from-file cert.pem # Set secret from file
|
|
239
239
|
vaif secrets list # List secret names (values hidden)
|
|
240
240
|
vaif secrets get API_KEY # Reveal a secret value
|
|
@@ -280,7 +280,9 @@ vaif claude-setup -o ./my-app # Custom output directory
|
|
|
280
280
|
**Generated files:**
|
|
281
281
|
|
|
282
282
|
- **`.mcp.json`** — Configures the `@vaiftech/mcp` server so Claude Code can query your database, manage schema, upload files, invoke functions, and more.
|
|
283
|
-
- **`CLAUDE.md`** — Gives Claude full context about your project: SDK setup with your actual API key, complete database schema with types and constraints, CRUD examples using your real table names, auth/storage/realtime/functions usage patterns, row-level security (RLS), storage policies, edge function deployment, API key management, secrets management,
|
|
283
|
+
- **`CLAUDE.md`** — Gives Claude full context about your project: SDK setup with your actual API key, complete database schema with types and constraints, CRUD examples using your real table names, auth/storage/realtime/functions usage patterns, row-level security (RLS), storage policies, edge function deployment, API key management, secrets management, filter/pagination reference, JSONB subkey filters, compound filters (AND+OR), full-text search, aggregation, FK joins, upsert, `vaif.auth` context in functions, function-to-function invocation, and database triggers.
|
|
284
|
+
|
|
285
|
+
The MCP server also includes guided prompts (`setup-backend`, `add-feature`, `generate-api-code`, `debug-query`) accessible via `/mcp` in Claude Code.
|
|
284
286
|
|
|
285
287
|
## Configuration
|
|
286
288
|
|
|
@@ -180,7 +180,7 @@ export function createVaifServer() {
|
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
`},{path:".env.local.example",content:`# VAIF Configuration
|
|
183
|
-
# Get these values from https://vaif.studio/
|
|
183
|
+
# Get these values from https://console.vaif.studio/security/api-keys \u2192 Project Settings \u2192 API Keys
|
|
184
184
|
|
|
185
185
|
NEXT_PUBLIC_VAIF_API_URL=https://api.vaif.studio
|
|
186
186
|
NEXT_PUBLIC_VAIF_PROJECT_ID=your-project-id
|
|
@@ -221,7 +221,7 @@ A full-stack Next.js application powered by [VAIF Studio](https://vaif.studio),
|
|
|
221
221
|
cp .env.local.example .env.local
|
|
222
222
|
\\\`\\\`\\\`
|
|
223
223
|
|
|
224
|
-
Get your Project ID, API Key, and Secret Key from <https://vaif.studio/
|
|
224
|
+
Get your Project ID, API Key, and Secret Key from <https://console.vaif.studio/security/api-keys> under **Project Settings > API Keys**.
|
|
225
225
|
|
|
226
226
|
3. **Install and log in to the VAIF CLI**
|
|
227
227
|
|
|
@@ -695,7 +695,7 @@ interface ImportMeta {
|
|
|
695
695
|
readonly env: ImportMetaEnv;
|
|
696
696
|
}
|
|
697
697
|
`},{path:".env.example",content:`# VAIF Configuration
|
|
698
|
-
# Get these values from https://vaif.studio/
|
|
698
|
+
# Get these values from https://console.vaif.studio/security/api-keys
|
|
699
699
|
|
|
700
700
|
VITE_VAIF_API_URL=https://api.vaif.studio
|
|
701
701
|
VITE_VAIF_PROJECT_ID=your-project-id
|
|
@@ -729,7 +729,7 @@ A single-page React application built with [Vite](https://vite.dev/) and powered
|
|
|
729
729
|
cp .env.example .env
|
|
730
730
|
\\\`\\\`\\\`
|
|
731
731
|
|
|
732
|
-
Get your Project ID and API Key from <https://vaif.studio/
|
|
732
|
+
Get your Project ID and API Key from <https://console.vaif.studio/security/api-keys> under **Project Settings > API Keys**.
|
|
733
733
|
|
|
734
734
|
3. **Install and log in to the VAIF CLI**
|
|
735
735
|
|
|
@@ -1252,7 +1252,7 @@ An iOS/macOS application powered by [VAIF Studio](https://vaif.studio), using th
|
|
|
1252
1252
|
<string>your-anon-key</string>
|
|
1253
1253
|
\\\`\\\`\\\`
|
|
1254
1254
|
|
|
1255
|
-
Get your credentials from <https://vaif.studio/
|
|
1255
|
+
Get your credentials from <https://console.vaif.studio/security/api-keys> under **Project Settings > API Keys**.
|
|
1256
1256
|
|
|
1257
1257
|
3. **Install and log in to the VAIF CLI** (for type generation)
|
|
1258
1258
|
|
|
@@ -1381,7 +1381,7 @@ export const vaif = createExpoClient({
|
|
|
1381
1381
|
realtime: { enabled: true },
|
|
1382
1382
|
});
|
|
1383
1383
|
`},{path:".env.example",content:`# VAIF Configuration
|
|
1384
|
-
# Get these values from https://vaif.studio/
|
|
1384
|
+
# Get these values from https://console.vaif.studio/security/api-keys \u2192 Project Settings \u2192 API Keys
|
|
1385
1385
|
|
|
1386
1386
|
EXPO_PUBLIC_VAIF_PROJECT_ID=your-project-id
|
|
1387
1387
|
EXPO_PUBLIC_VAIF_API_KEY=your-anon-key
|
|
@@ -1418,7 +1418,7 @@ A React Native / Expo mobile application powered by [VAIF Studio](https://vaif.s
|
|
|
1418
1418
|
cp .env.example .env
|
|
1419
1419
|
\\\`\\\`\\\`
|
|
1420
1420
|
|
|
1421
|
-
Get your Project ID and API Key from <https://vaif.studio/
|
|
1421
|
+
Get your Project ID and API Key from <https://console.vaif.studio/security/api-keys> under **Project Settings > API Keys**.
|
|
1422
1422
|
|
|
1423
1423
|
3. **Install and log in to the VAIF CLI**
|
|
1424
1424
|
|
|
@@ -1853,7 +1853,7 @@ A Flutter application powered by [VAIF Studio](https://vaif.studio), with Dart c
|
|
|
1853
1853
|
cp .env.example .env
|
|
1854
1854
|
\\\`\\\`\\\`
|
|
1855
1855
|
|
|
1856
|
-
Get your Project ID and API Key from <https://vaif.studio/
|
|
1856
|
+
Get your Project ID and API Key from <https://console.vaif.studio/security/api-keys> under **Project Settings > API Keys**.
|
|
1857
1857
|
|
|
1858
1858
|
3. **Install and log in to the VAIF CLI** (for schema and type generation)
|
|
1859
1859
|
|
|
@@ -2111,7 +2111,7 @@ fastapi>=0.110.0
|
|
|
2111
2111
|
uvicorn[standard]>=0.27.0
|
|
2112
2112
|
python-dotenv>=1.0.0
|
|
2113
2113
|
`},{path:".env.example",content:`# VAIF Configuration
|
|
2114
|
-
# Get these values from https://vaif.studio/
|
|
2114
|
+
# Get these values from https://console.vaif.studio/security/api-keys \u2192 Project Settings \u2192 API Keys
|
|
2115
2115
|
|
|
2116
2116
|
VAIF_PROJECT_ID=your-project-id
|
|
2117
2117
|
VAIF_API_KEY=your-anon-key
|
|
@@ -2153,7 +2153,7 @@ A FastAPI backend application powered by [VAIF Studio](https://vaif.studio), wit
|
|
|
2153
2153
|
cp .env.example .env
|
|
2154
2154
|
\\\`\\\`\\\`
|
|
2155
2155
|
|
|
2156
|
-
Get your Project ID, API Key, and Secret Key from <https://vaif.studio/
|
|
2156
|
+
Get your Project ID, API Key, and Secret Key from <https://console.vaif.studio/security/api-keys> under **Project Settings > API Keys**.
|
|
2157
2157
|
|
|
2158
2158
|
4. **Install and log in to the VAIF CLI**
|
|
2159
2159
|
|
|
@@ -2476,7 +2476,7 @@ A Go backend API powered by [VAIF Studio](https://vaif.studio), with HTTP handle
|
|
|
2476
2476
|
cp .env.example .env
|
|
2477
2477
|
\\\`\\\`\\\`
|
|
2478
2478
|
|
|
2479
|
-
Get your Project ID, API Key, and Secret Key from <https://vaif.studio/
|
|
2479
|
+
Get your Project ID, API Key, and Secret Key from <https://console.vaif.studio/security/api-keys> under **Project Settings > API Keys**.
|
|
2480
2480
|
|
|
2481
2481
|
3. **Install and log in to the VAIF CLI**
|
|
2482
2482
|
|
|
@@ -2751,7 +2751,7 @@ export async function deleteTodo(id: string): Promise<void> {
|
|
|
2751
2751
|
if (error) throw error;
|
|
2752
2752
|
}
|
|
2753
2753
|
`},{path:".env.example",content:`# VAIF Configuration
|
|
2754
|
-
# Get these values from https://vaif.studio/
|
|
2754
|
+
# Get these values from https://console.vaif.studio/security/api-keys
|
|
2755
2755
|
|
|
2756
2756
|
VITE_VAIF_API_URL=https://api.vaif.studio
|
|
2757
2757
|
VITE_VAIF_PROJECT_ID=your-project-id
|
|
@@ -2780,7 +2780,7 @@ A simple React todo application for learning [VAIF Studio](https://vaif.studio)
|
|
|
2780
2780
|
cp .env.example .env
|
|
2781
2781
|
\\\`\\\`\\\`
|
|
2782
2782
|
|
|
2783
|
-
Get your Project ID and API Key from <https://vaif.studio/
|
|
2783
|
+
Get your Project ID and API Key from <https://console.vaif.studio/security/api-keys> under **Project Settings > API Keys**.
|
|
2784
2784
|
|
|
2785
2785
|
3. **Install and log in to the VAIF CLI**
|
|
2786
2786
|
|
|
@@ -3031,7 +3031,7 @@ export function useRealtimeMessages({
|
|
|
3031
3031
|
return { messages, isLoading, error, refresh };
|
|
3032
3032
|
}
|
|
3033
3033
|
`},{path:".env.example",content:`# VAIF Configuration
|
|
3034
|
-
# Get these values from https://vaif.studio/
|
|
3034
|
+
# Get these values from https://console.vaif.studio/security/api-keys
|
|
3035
3035
|
|
|
3036
3036
|
VITE_VAIF_API_URL=https://api.vaif.studio
|
|
3037
3037
|
VITE_VAIF_PROJECT_ID=your-project-id
|
|
@@ -3060,7 +3060,7 @@ A React chat application with live messaging powered by [VAIF Studio](https://va
|
|
|
3060
3060
|
cp .env.example .env
|
|
3061
3061
|
\\\`\\\`\\\`
|
|
3062
3062
|
|
|
3063
|
-
Get your Project ID and API Key from <https://vaif.studio/
|
|
3063
|
+
Get your Project ID and API Key from <https://console.vaif.studio/security/api-keys> under **Project Settings > API Keys**.
|
|
3064
3064
|
|
|
3065
3065
|
3. **Install and log in to the VAIF CLI**
|
|
3066
3066
|
|
|
@@ -3347,7 +3347,7 @@ export async function requireTeamRole(
|
|
|
3347
3347
|
return member as TeamMember;
|
|
3348
3348
|
}
|
|
3349
3349
|
`},{path:".env.example",content:`# VAIF Configuration
|
|
3350
|
-
# Get these values from https://vaif.studio/
|
|
3350
|
+
# Get these values from https://console.vaif.studio/security/api-keys \u2192 Project Settings \u2192 API Keys
|
|
3351
3351
|
|
|
3352
3352
|
NEXT_PUBLIC_VAIF_API_URL=https://api.vaif.studio
|
|
3353
3353
|
NEXT_PUBLIC_VAIF_PROJECT_ID=your-project-id
|
|
@@ -3380,7 +3380,7 @@ A full SaaS starter kit powered by [VAIF Studio](https://vaif.studio) with authe
|
|
|
3380
3380
|
cp .env.example .env.local
|
|
3381
3381
|
\\\`\\\`\\\`
|
|
3382
3382
|
|
|
3383
|
-
Get your Project ID, API Key, and Secret Key from <https://vaif.studio/
|
|
3383
|
+
Get your Project ID, API Key, and Secret Key from <https://console.vaif.studio/security/api-keys> under **Project Settings > API Keys**.
|
|
3384
3384
|
|
|
3385
3385
|
3. **Install and log in to the VAIF CLI**
|
|
3386
3386
|
|
|
@@ -3625,7 +3625,7 @@ function getContentType(fileName: string): string {
|
|
|
3625
3625
|
return mimeTypes[ext ?? ""] ?? "application/octet-stream";
|
|
3626
3626
|
}
|
|
3627
3627
|
`},{path:".env.example",content:`# VAIF Configuration
|
|
3628
|
-
# Get these values from https://vaif.studio/
|
|
3628
|
+
# Get these values from https://console.vaif.studio/security/api-keys \u2192 Project Settings \u2192 API Keys
|
|
3629
3629
|
|
|
3630
3630
|
NEXT_PUBLIC_VAIF_API_URL=https://api.vaif.studio
|
|
3631
3631
|
NEXT_PUBLIC_VAIF_PROJECT_ID=your-project-id
|
|
@@ -3658,7 +3658,7 @@ An API-first e-commerce setup powered by [VAIF Studio](https://vaif.studio) with
|
|
|
3658
3658
|
cp .env.example .env.local
|
|
3659
3659
|
\\\`\\\`\\\`
|
|
3660
3660
|
|
|
3661
|
-
Get your Project ID, API Key, and Secret Key from <https://vaif.studio/
|
|
3661
|
+
Get your Project ID, API Key, and Secret Key from <https://console.vaif.studio/security/api-keys> under **Project Settings > API Keys**.
|
|
3662
3662
|
|
|
3663
3663
|
3. **Install and log in to the VAIF CLI**
|
|
3664
3664
|
|
|
@@ -3780,7 +3780,7 @@ Unknown template: ${a}`)),console.log(l.yellow(`Run 'vaif templates' to see avai
|
|
|
3780
3780
|
`)),process.exit(1));let e;t.features&&t.features.length>0?e=t.features.filter(d=>T.some(m=>m.name===d)):t.addOnly?(console.log(l.red(`
|
|
3781
3781
|
No features specified.`)),console.log(l.yellow("Usage: vaif init --template <name> --add-features <features>")),console.log(l.gray("Available features: auth, database, realtime, storage, functions")),process.exit(1)):n.featureFiles&&Object.keys(n.featureFiles).length>0?e=await Ie(n.defaultFeatures??["database","auth"]):e=n.defaultFeatures??[],t.addOnly?(console.log(""),console.log(l.bold(`Adding features to ${l.cyan(n.name)} project...`)),console.log(l.gray(` Features: ${e.join(", ")}`)),console.log("")):(console.log(""),console.log(l.bold(`Scaffolding ${l.cyan(n.name)} template...`)),e.length>0&&console.log(l.gray(` Features: ${e.join(", ")}`)),console.log(""));let r=t.addOnly?[]:[...n.files],i=new Set,c=[];if(n.featureFiles)for(let d of e){let m=n.featureFiles[d];if(m)for(let I of m)i.add(I.path),c.push(I);}let u=r.filter(d=>!i.has(d.path)).concat(c),o=0,s=0;for(let d of u){let m=k.resolve(d.path),I=k.dirname(m);if(b.existsSync(I)||b.mkdirSync(I,{recursive:true}),d.path==="package.json"&&b.existsSync(m)&&!t.force)try{let y=JSON.parse(b.readFileSync(m,"utf-8")),E=JSON.parse(d.content),S=M=>{if(!M)return {};let K={};for(let[X,w]of Object.entries(M))!w.startsWith("workspace:")&&!w.startsWith("link:")&&!w.startsWith("file:")&&(K[X]=w);return K};y.dependencies={...S(y.dependencies),...E.dependencies||{}},y.devDependencies={...S(y.devDependencies),...E.devDependencies||{}},E.scripts&&(y.scripts={...y.scripts||{},...E.scripts}),b.writeFileSync(m,JSON.stringify(y,null,2)+`
|
|
3782
3782
|
`,"utf-8"),console.log(l.green(` merge ${d.path} (added dependencies)`)),o++;continue}catch{}if(b.existsSync(m)&&!t.force){console.log(l.yellow(` skip ${d.path} (already exists)`)),s++;continue}b.writeFileSync(m,d.content,"utf-8"),console.log(l.green(` create ${d.path}`)),o++;}console.log(""),o>0&&console.log(l.green(`Created ${o} file${o!==1?"s":""}.`)),s>0&&console.log(l.yellow(`Skipped ${s} file${s!==1?"s":""} (use --force to overwrite).`));let f={auth:{"@vaiftech/auth":"^1.0.0"},database:{},realtime:{},storage:{},functions:{}},h=k.resolve("package.json");if(b.existsSync(h)&&e.length>0)try{let d=JSON.parse(b.readFileSync(h,"utf-8")),m=!1;for(let I of e){let y=f[I];if(y)for(let[E,S]of Object.entries(y))d.dependencies?.[E]||(d.dependencies=d.dependencies||{},d.dependencies[E]=S,m=!0);}m&&b.writeFileSync(h,JSON.stringify(d,null,2)+`
|
|
3783
|
-
`,"utf-8");}catch{}(n.dependencies?.length||n.devDependencies?.length)&&(console.log(""),console.log(l.bold("Install dependencies:")),n.dependencies?.length&&console.log(l.cyan(` npm install ${n.dependencies.join(" ")}`)),n.devDependencies?.length&&console.log(l.cyan(` npm install -D ${n.devDependencies.join(" ")}`))),console.log(""),console.log(l.bold.green("Project scaffolded successfully!")),console.log(""),console.log(l.bold(" Next steps:")),n.postInstructions.forEach(d=>{console.log(l.gray(` ${d}`));}),console.log(""),console.log(l.gray(" Get your project credentials at https://vaif.studio/
|
|
3783
|
+
`,"utf-8");}catch{}(n.dependencies?.length||n.devDependencies?.length)&&(console.log(""),console.log(l.bold("Install dependencies:")),n.dependencies?.length&&console.log(l.cyan(` npm install ${n.dependencies.join(" ")}`)),n.devDependencies?.length&&console.log(l.cyan(` npm install -D ${n.devDependencies.join(" ")}`))),console.log(""),console.log(l.bold.green("Project scaffolded successfully!")),console.log(""),console.log(l.bold(" Next steps:")),n.postInstructions.forEach(d=>{console.log(l.gray(` ${d}`));}),console.log(""),console.log(l.gray(" Get your project credentials at https://console.vaif.studio/security/api-keys")),console.log("");}var _e={$schema:"https://vaif.studio/schemas/config.json",projectId:"",database:{url:"${DATABASE_URL}",schema:"public"},types:{output:"./src/types/database.ts"},api:{baseUrl:"https://api.vaif.studio"}};async function ct(a){if(a.addFeatures){a.template||(console.log(l.red(`
|
|
3784
3784
|
--add-features requires --template to know which template to use.`)),console.log(l.gray("Example: vaif init --template react-spa --add-features functions,storage")),process.exit(1));let e=a.addFeatures.split(",").map(r=>r.trim());await j(a.template,{force:a.force,features:e,addOnly:true});return}let t=L("Initializing VAIF configuration...").start(),n=k.resolve("vaif.config.json");b.existsSync(n)&&!a.force&&(t.fail("vaif.config.json already exists"),console.log(l.yellow(`
|
|
3785
3785
|
Use --force to overwrite existing configuration.`)),process.exit(1));try{if(b.writeFileSync(n,JSON.stringify(_e,null,2),"utf-8"),t.succeed("Created vaif.config.json"),a.template){let e=a.features?a.features.split(",").map(r=>r.trim()):void 0;await j(a.template,{force:a.force,features:e});}else {let e=k.resolve(".env.example");if(b.existsSync(e)||(b.writeFileSync(e,`# VAIF Configuration
|
|
3786
3786
|
DATABASE_URL=postgresql://user:password@localhost:5432/database
|