@voltx/cli 0.2.0 → 0.3.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 (45) hide show
  1. package/README.md +65 -0
  2. package/dist/build.d.mts +19 -0
  3. package/dist/build.d.ts +19 -0
  4. package/dist/build.js +145 -0
  5. package/dist/build.mjs +7 -0
  6. package/dist/chunk-AONHLE42.mjs +141 -0
  7. package/dist/chunk-BIE3F5AW.mjs +261 -0
  8. package/dist/chunk-BLBAHJXR.mjs +239 -0
  9. package/dist/chunk-IGBR4TFT.mjs +351 -0
  10. package/dist/chunk-IV352HZA.mjs +107 -0
  11. package/dist/chunk-KFHPTRKZ.mjs +405 -0
  12. package/dist/chunk-L3247M3A.mjs +81 -0
  13. package/dist/chunk-RN7BUALR.mjs +120 -0
  14. package/dist/chunk-SGL7RBD5.mjs +355 -0
  15. package/dist/chunk-TUZ3MHD4.mjs +355 -0
  16. package/dist/chunk-Y6FXYEAI.mjs +10 -0
  17. package/dist/chunk-ZA7EJWJI.mjs +221 -0
  18. package/dist/chunk-ZB2F3WTS.mjs +121 -0
  19. package/dist/chunk-ZLIPYI22.mjs +350 -0
  20. package/dist/cli.js +945 -59
  21. package/dist/cli.mjs +123 -23
  22. package/dist/create.d.mts +1 -0
  23. package/dist/create.d.ts +1 -0
  24. package/dist/create.js +308 -36
  25. package/dist/create.mjs +3 -2
  26. package/dist/dev.d.mts +19 -0
  27. package/dist/dev.d.ts +19 -0
  28. package/dist/dev.js +144 -0
  29. package/dist/dev.mjs +7 -0
  30. package/dist/generate.d.mts +13 -0
  31. package/dist/generate.d.ts +13 -0
  32. package/dist/generate.js +165 -0
  33. package/dist/generate.mjs +7 -0
  34. package/dist/index.d.mts +5 -1
  35. package/dist/index.d.ts +5 -1
  36. package/dist/index.js +770 -39
  37. package/dist/index.mjs +21 -4
  38. package/dist/start.d.mts +16 -0
  39. package/dist/start.d.ts +16 -0
  40. package/dist/start.js +105 -0
  41. package/dist/start.mjs +7 -0
  42. package/dist/welcome.js +1 -1
  43. package/dist/welcome.mjs +2 -1
  44. package/package.json +24 -22
  45. package/LICENSE +0 -21
@@ -0,0 +1,120 @@
1
+ // src/dev.ts
2
+ import { spawn } from "child_process";
3
+ import { resolve, join } from "path";
4
+ import { existsSync } from "fs";
5
+ async function runDev(options = {}) {
6
+ const cwd = process.cwd();
7
+ const {
8
+ port,
9
+ entry = findEntryPoint(cwd),
10
+ clearScreen = true
11
+ } = options;
12
+ if (!entry) {
13
+ console.error("[voltx] Could not find entry point. Expected src/index.ts or src/index.js");
14
+ process.exit(1);
15
+ }
16
+ const entryPath = resolve(cwd, entry);
17
+ if (!existsSync(entryPath)) {
18
+ console.error(`[voltx] Entry file not found: ${entry}`);
19
+ process.exit(1);
20
+ }
21
+ const envFile = resolve(cwd, ".env");
22
+ const env = {
23
+ ...process.env,
24
+ NODE_ENV: "development"
25
+ };
26
+ if (port) {
27
+ env.PORT = String(port);
28
+ }
29
+ printDevBanner(entry, port);
30
+ const tsxArgs = ["watch"];
31
+ if (clearScreen) {
32
+ tsxArgs.push("--clear-screen=false");
33
+ }
34
+ const watchDirs = [
35
+ "src/routes",
36
+ "src/agents",
37
+ "src/tools",
38
+ "src/jobs",
39
+ "src/lib",
40
+ "voltx.config.ts",
41
+ ...options.watch ?? []
42
+ ];
43
+ tsxArgs.push("--ignore=node_modules", "--ignore=dist", "--ignore=.turbo");
44
+ tsxArgs.push(entry);
45
+ const tsxBin = findTsxBin(cwd);
46
+ let child;
47
+ if (tsxBin) {
48
+ child = spawn(tsxBin, tsxArgs, {
49
+ cwd,
50
+ env,
51
+ stdio: "inherit"
52
+ });
53
+ } else {
54
+ child = spawn("npx", ["tsx", ...tsxArgs], {
55
+ cwd,
56
+ env,
57
+ stdio: "inherit"
58
+ });
59
+ }
60
+ const signals = ["SIGINT", "SIGTERM"];
61
+ for (const signal of signals) {
62
+ process.on(signal, () => {
63
+ child.kill(signal);
64
+ });
65
+ }
66
+ child.on("error", (err) => {
67
+ if (err.code === "ENOENT") {
68
+ console.error("[voltx] tsx not found. Install it with: npm install -D tsx");
69
+ console.error("[voltx] Or run your app directly: npx tsx watch src/index.ts");
70
+ } else {
71
+ console.error("[voltx] Dev server error:", err.message);
72
+ }
73
+ process.exit(1);
74
+ });
75
+ child.on("exit", (code) => {
76
+ process.exit(code ?? 0);
77
+ });
78
+ }
79
+ function findEntryPoint(cwd) {
80
+ const candidates = [
81
+ "src/index.ts",
82
+ "src/index.js",
83
+ "src/index.mts",
84
+ "src/main.ts",
85
+ "src/main.js",
86
+ "index.ts",
87
+ "index.js"
88
+ ];
89
+ for (const candidate of candidates) {
90
+ if (existsSync(join(cwd, candidate))) {
91
+ return candidate;
92
+ }
93
+ }
94
+ return null;
95
+ }
96
+ function findTsxBin(cwd) {
97
+ const localBin = join(cwd, "node_modules", ".bin", "tsx");
98
+ if (existsSync(localBin)) return localBin;
99
+ const parentBin = join(cwd, "..", "node_modules", ".bin", "tsx");
100
+ if (existsSync(parentBin)) return parentBin;
101
+ const rootBin = join(cwd, "..", "..", "node_modules", ".bin", "tsx");
102
+ if (existsSync(rootBin)) return rootBin;
103
+ return null;
104
+ }
105
+ function printDevBanner(entry, port) {
106
+ console.log("");
107
+ console.log(" \u26A1 VoltX Dev Server");
108
+ console.log(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
109
+ console.log(` Entry: ${entry}`);
110
+ if (port) {
111
+ console.log(` Port: ${port}`);
112
+ }
113
+ console.log(` Mode: development (hot reload)`);
114
+ console.log(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
115
+ console.log("");
116
+ }
117
+
118
+ export {
119
+ runDev
120
+ };
@@ -0,0 +1,355 @@
1
+ import {
2
+ printWelcomeBanner
3
+ } from "./chunk-IV352HZA.mjs";
4
+ import {
5
+ __require
6
+ } from "./chunk-Y6FXYEAI.mjs";
7
+
8
+ // src/create.ts
9
+ import * as fs from "fs";
10
+ import * as path from "path";
11
+ async function createProject(options) {
12
+ const { name, template = "blank", auth = "none" } = options;
13
+ const targetDir = path.resolve(process.cwd(), name);
14
+ if (fs.existsSync(targetDir)) {
15
+ console.error(`[voltx] Directory "${name}" already exists.`);
16
+ process.exit(1);
17
+ }
18
+ fs.mkdirSync(targetDir, { recursive: true });
19
+ const templateDeps = {
20
+ blank: {
21
+ "@voltx/core": "^0.3.0",
22
+ "@voltx/server": "^0.3.0"
23
+ },
24
+ chatbot: {
25
+ "@voltx/core": "^0.3.0",
26
+ "@voltx/ai": "^0.3.0",
27
+ "@voltx/server": "^0.3.0",
28
+ "@voltx/memory": "^0.3.0"
29
+ },
30
+ "rag-app": {
31
+ "@voltx/core": "^0.3.0",
32
+ "@voltx/ai": "^0.3.0",
33
+ "@voltx/server": "^0.3.0",
34
+ "@voltx/rag": "^0.3.0",
35
+ "@voltx/db": "^0.3.0"
36
+ },
37
+ "agent-app": {
38
+ "@voltx/core": "^0.3.0",
39
+ "@voltx/ai": "^0.3.0",
40
+ "@voltx/server": "^0.3.0",
41
+ "@voltx/agents": "^0.3.0",
42
+ "@voltx/memory": "^0.3.0"
43
+ }
44
+ };
45
+ const packageJson = {
46
+ name,
47
+ version: "0.1.0",
48
+ private: true,
49
+ scripts: {
50
+ dev: "voltx dev",
51
+ build: "voltx build",
52
+ start: "voltx start"
53
+ },
54
+ dependencies: {
55
+ ...templateDeps[template] ?? templateDeps["blank"],
56
+ "@voltx/cli": "^0.3.0",
57
+ ...auth === "better-auth" ? { "@voltx/auth": "^0.3.0", "better-auth": "^1.5.0" } : {},
58
+ ...auth === "jwt" ? { "@voltx/auth": "^0.3.0", "jose": "^6.0.0" } : {}
59
+ },
60
+ devDependencies: {
61
+ typescript: "^5.7.0",
62
+ tsx: "^4.21.0",
63
+ tsup: "^8.0.0",
64
+ "@types/node": "^22.0.0"
65
+ }
66
+ };
67
+ fs.writeFileSync(
68
+ path.join(targetDir, "package.json"),
69
+ JSON.stringify(packageJson, null, 2)
70
+ );
71
+ const hasDb = template === "rag-app" || template === "agent-app" || auth === "better-auth";
72
+ const provider = template === "rag-app" ? "openai" : "cerebras";
73
+ const model = template === "rag-app" ? "gpt-4o" : "llama-4-scout-17b-16e";
74
+ let configContent = `import { defineConfig } from "@voltx/core";
75
+
76
+ export default defineConfig({
77
+ name: "${name}",
78
+ port: 3000,
79
+ ai: {
80
+ provider: "${provider}",
81
+ model: "${model}",
82
+ },`;
83
+ if (hasDb) {
84
+ configContent += `
85
+ db: {
86
+ url: process.env.DATABASE_URL,
87
+ },`;
88
+ }
89
+ if (auth !== "none") {
90
+ configContent += `
91
+ auth: {
92
+ provider: "${auth}",
93
+ },`;
94
+ }
95
+ configContent += `
96
+ server: {
97
+ routesDir: "src/routes",
98
+ staticDir: "public",
99
+ cors: true,
100
+ },
101
+ });
102
+ `;
103
+ fs.writeFileSync(path.join(targetDir, "voltx.config.ts"), configContent);
104
+ fs.mkdirSync(path.join(targetDir, "src", "routes", "api"), { recursive: true });
105
+ fs.mkdirSync(path.join(targetDir, "public"), { recursive: true });
106
+ fs.writeFileSync(
107
+ path.join(targetDir, "src", "index.ts"),
108
+ `import { createApp } from "@voltx/core";
109
+ import config from "../voltx.config";
110
+
111
+ const app = createApp(config);
112
+ app.start();
113
+ `
114
+ );
115
+ fs.writeFileSync(
116
+ path.join(targetDir, "src", "routes", "index.ts"),
117
+ `// GET / \u2014 Health check
118
+ import type { Context } from "@voltx/server";
119
+
120
+ export function GET(c: Context) {
121
+ return c.json({ name: "${name}", status: "ok" });
122
+ }
123
+ `
124
+ );
125
+ if (template === "chatbot" || template === "agent-app") {
126
+ fs.writeFileSync(
127
+ path.join(targetDir, "src", "routes", "api", "chat.ts"),
128
+ `// POST /api/chat \u2014 Streaming chat with conversation memory
129
+ import type { Context } from "@voltx/server";
130
+ import { streamText } from "@voltx/ai";
131
+ import { createMemory } from "@voltx/memory";
132
+
133
+ // In-memory for dev; swap to createMemory("postgres", { url }) for production
134
+ const memory = createMemory({ maxMessages: 50 });
135
+
136
+ export async function POST(c: Context) {
137
+ const { messages, conversationId = "default" } = await c.req.json();
138
+
139
+ // Store the latest user message
140
+ const lastMessage = messages[messages.length - 1];
141
+ if (lastMessage?.role === "user") {
142
+ await memory.add(conversationId, { role: "user", content: lastMessage.content });
143
+ }
144
+
145
+ // Get conversation history from memory
146
+ const history = await memory.get(conversationId);
147
+
148
+ const result = await streamText({
149
+ model: "cerebras:llama-4-scout-17b-16e",
150
+ system: "You are a helpful AI assistant.",
151
+ messages: history.map((m) => ({ role: m.role, content: m.content })),
152
+ });
153
+
154
+ // Store assistant response after stream completes
155
+ result.text.then(async (text) => {
156
+ await memory.add(conversationId, { role: "assistant", content: text });
157
+ });
158
+
159
+ return result.toSSEResponse();
160
+ }
161
+ `
162
+ );
163
+ }
164
+ if (template === "rag-app") {
165
+ fs.mkdirSync(path.join(targetDir, "src", "routes", "api", "rag"), { recursive: true });
166
+ fs.writeFileSync(
167
+ path.join(targetDir, "src", "routes", "api", "rag", "query.ts"),
168
+ `// POST /api/rag/query \u2014 Query documents with RAG
169
+ import type { Context } from "@voltx/server";
170
+ import { streamText } from "@voltx/ai";
171
+ import { createRAGPipeline, createEmbedder } from "@voltx/rag";
172
+ import { createVectorStore } from "@voltx/db";
173
+
174
+ const vectorStore = createVectorStore(); // swap to "pinecone" or "pgvector" for production
175
+ const embedder = createEmbedder({ model: "openai:text-embedding-3-small" });
176
+ const rag = createRAGPipeline({ embedder, vectorStore });
177
+
178
+ export async function POST(c: Context) {
179
+ const { question } = await c.req.json();
180
+
181
+ const context = await rag.getContext(question, { topK: 5 });
182
+
183
+ const result = await streamText({
184
+ model: "openai:gpt-4o",
185
+ system: \`Answer the user's question based on the following context. If the context doesn't contain relevant information, say so.\\n\\nContext:\\n\${context}\`,
186
+ messages: [{ role: "user", content: question }],
187
+ });
188
+
189
+ return result.toSSEResponse();
190
+ }
191
+ `
192
+ );
193
+ fs.writeFileSync(
194
+ path.join(targetDir, "src", "routes", "api", "rag", "ingest.ts"),
195
+ `// POST /api/rag/ingest \u2014 Ingest documents into the vector store
196
+ import type { Context } from "@voltx/server";
197
+ import { createRAGPipeline, createEmbedder } from "@voltx/rag";
198
+ import { createVectorStore } from "@voltx/db";
199
+
200
+ const vectorStore = createVectorStore();
201
+ const embedder = createEmbedder({ model: "openai:text-embedding-3-small" });
202
+ const rag = createRAGPipeline({ embedder, vectorStore });
203
+
204
+ export async function POST(c: Context) {
205
+ const { text, idPrefix } = await c.req.json();
206
+
207
+ if (!text || typeof text !== "string") {
208
+ return c.json({ error: "Missing 'text' field" }, 400);
209
+ }
210
+
211
+ const result = await rag.ingest(text, idPrefix ?? "doc");
212
+ return c.json({ status: "ok", chunks: result.chunks, ids: result.ids });
213
+ }
214
+ `
215
+ );
216
+ }
217
+ if (auth === "better-auth") {
218
+ fs.mkdirSync(path.join(targetDir, "src", "routes", "api", "auth"), { recursive: true });
219
+ fs.writeFileSync(
220
+ path.join(targetDir, "src", "routes", "api", "auth", "[...path].ts"),
221
+ `// ALL /api/auth/* \u2014 Better Auth handler
222
+ import type { Context } from "@voltx/server";
223
+ import { auth } from "../../../lib/auth";
224
+ import { createAuthHandler } from "@voltx/auth";
225
+
226
+ const handler = createAuthHandler(auth);
227
+
228
+ export const GET = (c: Context) => handler(c);
229
+ export const POST = (c: Context) => handler(c);
230
+ `
231
+ );
232
+ fs.mkdirSync(path.join(targetDir, "src", "lib"), { recursive: true });
233
+ fs.writeFileSync(
234
+ path.join(targetDir, "src", "lib", "auth.ts"),
235
+ `// Auth configuration \u2014 Better Auth with DB-backed sessions
236
+ import { createAuth, createAuthMiddleware } from "@voltx/auth";
237
+
238
+ export const auth = createAuth("better-auth", {
239
+ database: process.env.DATABASE_URL!,
240
+ emailAndPassword: true,
241
+ });
242
+
243
+ export const authMiddleware = createAuthMiddleware({
244
+ provider: auth,
245
+ publicPaths: ["/api/auth", "/api/health", "/"],
246
+ });
247
+ `
248
+ );
249
+ } else if (auth === "jwt") {
250
+ fs.mkdirSync(path.join(targetDir, "src", "lib"), { recursive: true });
251
+ fs.writeFileSync(
252
+ path.join(targetDir, "src", "lib", "auth.ts"),
253
+ `// Auth configuration \u2014 JWT (stateless)
254
+ import { createAuth, createAuthMiddleware } from "@voltx/auth";
255
+
256
+ export const jwt = createAuth("jwt", {
257
+ secret: process.env.JWT_SECRET!,
258
+ expiresIn: "7d",
259
+ });
260
+
261
+ export const authMiddleware = createAuthMiddleware({
262
+ provider: jwt,
263
+ publicPaths: ["/api/auth", "/api/health", "/"],
264
+ });
265
+ `
266
+ );
267
+ fs.writeFileSync(
268
+ path.join(targetDir, "src", "routes", "api", "auth.ts"),
269
+ `// POST /api/auth/login \u2014 Example JWT login route
270
+ import type { Context } from "@voltx/server";
271
+ import { jwt } from "../../lib/auth";
272
+
273
+ export async function POST(c: Context) {
274
+ const { email, password } = await c.req.json();
275
+
276
+ if (!email || !password) {
277
+ return c.json({ error: "Email and password are required" }, 400);
278
+ }
279
+
280
+ const token = await jwt.sign({ sub: email, email });
281
+ return c.json({ token });
282
+ }
283
+ `
284
+ );
285
+ }
286
+ let envContent = "";
287
+ if (template === "rag-app") {
288
+ envContent += "# \u2500\u2500\u2500 LLM Provider \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nOPENAI_API_KEY=sk-...\n\n";
289
+ envContent += "# \u2500\u2500\u2500 Database (Neon Postgres) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nDATABASE_URL=postgresql://user:pass@ep-xxx.us-east-2.aws.neon.tech/dbname?sslmode=require\n\n";
290
+ envContent += "# \u2500\u2500\u2500 Vector Database (Pinecone) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nPINECONE_API_KEY=pc-...\nPINECONE_INDEX=voltx-embeddings\n\n";
291
+ } else if (template === "chatbot" || template === "agent-app") {
292
+ envContent += "# \u2500\u2500\u2500 LLM Provider \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nCEREBRAS_API_KEY=csk-...\n\n";
293
+ if (template === "agent-app") {
294
+ envContent += "# \u2500\u2500\u2500 Database (Neon Postgres \u2014 optional) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nDATABASE_URL=\n\n";
295
+ }
296
+ } else {
297
+ envContent += "# \u2500\u2500\u2500 LLM Provider (add your key) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n# OPENAI_API_KEY=sk-...\n# CEREBRAS_API_KEY=csk-...\n\n";
298
+ }
299
+ if (auth === "better-auth") {
300
+ envContent += "# \u2500\u2500\u2500 Auth (Better Auth) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nBETTER_AUTH_SECRET=your-secret-key-min-32-chars-here\nBETTER_AUTH_URL=http://localhost:3000\n";
301
+ if (template !== "rag-app" && template !== "agent-app") {
302
+ envContent += "DATABASE_URL=postgresql://user:pass@ep-xxx.us-east-2.aws.neon.tech/dbname?sslmode=require\n";
303
+ }
304
+ envContent += "# GITHUB_CLIENT_ID=\n# GITHUB_CLIENT_SECRET=\n\n";
305
+ } else if (auth === "jwt") {
306
+ envContent += "# \u2500\u2500\u2500 Auth (JWT) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nJWT_SECRET=your-jwt-secret-key\n\n";
307
+ }
308
+ envContent += "# \u2500\u2500\u2500 App \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nPORT=3000\nNODE_ENV=development\n";
309
+ fs.writeFileSync(path.join(targetDir, ".env.example"), envContent);
310
+ fs.writeFileSync(
311
+ path.join(targetDir, ".gitignore"),
312
+ "node_modules\ndist\n.env\n"
313
+ );
314
+ fs.writeFileSync(
315
+ path.join(targetDir, "tsconfig.json"),
316
+ JSON.stringify(
317
+ {
318
+ compilerOptions: {
319
+ target: "ES2022",
320
+ module: "ESNext",
321
+ moduleResolution: "bundler",
322
+ strict: true,
323
+ esModuleInterop: true,
324
+ skipLibCheck: true,
325
+ outDir: "dist",
326
+ rootDir: "src"
327
+ },
328
+ include: ["src"]
329
+ },
330
+ null,
331
+ 2
332
+ )
333
+ );
334
+ printWelcomeBanner(name);
335
+ }
336
+ var isDirectRun = typeof __require !== "undefined" && __require.main === module && process.argv[1]?.includes("create");
337
+ if (isDirectRun) {
338
+ const projectName = process.argv[2];
339
+ if (!projectName) {
340
+ console.log("Usage: create-voltx-app <project-name> [--template chatbot] [--auth jwt]");
341
+ process.exit(1);
342
+ }
343
+ const templateFlag = process.argv.indexOf("--template");
344
+ const template = templateFlag !== -1 ? process.argv[templateFlag + 1] : "blank";
345
+ const authFlag = process.argv.indexOf("--auth");
346
+ const auth = authFlag !== -1 ? process.argv[authFlag + 1] : "none";
347
+ createProject({ name: projectName, template, auth }).catch((err) => {
348
+ console.error("[voltx] Error:", err);
349
+ process.exit(1);
350
+ });
351
+ }
352
+
353
+ export {
354
+ createProject
355
+ };