create-better-t-stack 3.40.0 → 3.40.2
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 +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +45 -9
- package/dist/index.mjs +2 -2
- package/dist/{src-DjuxSWWY.mjs → src-CP4utAOe.mjs} +362 -13
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -78,6 +78,7 @@ Options:
|
|
|
78
78
|
--package-manager <pm> Package manager (npm, pnpm, bun)
|
|
79
79
|
--install Install dependencies
|
|
80
80
|
--no-install Skip installing dependencies
|
|
81
|
+
--open <target> Open in an editor, IDE, or coding agent after creation
|
|
81
82
|
--db-setup <setup> Database setup (turso, d1, neon, supabase, prisma-postgres, planetscale, mongodb-atlas, docker, none)
|
|
82
83
|
--web-deploy <setup> Web deployment (cloudflare, docker, vercel, none)
|
|
83
84
|
--server-deploy <setup> Server deployment (cloudflare, docker, vercel, none)
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { i as SchemaNameSchema, l as create, m as getSchemaResult, s as add, u as createBtsCli, v as types_exports, y as getLatestCLIVersion } from "./src-CP4utAOe.mjs";
|
|
3
3
|
import z from "zod";
|
|
4
4
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
5
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
package/dist/index.d.mts
CHANGED
|
@@ -96,6 +96,41 @@ declare class DatabaseSetupError extends DatabaseSetupError_base<{
|
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
//#endregion
|
|
99
|
+
//#region src/utils/project-launcher.d.ts
|
|
100
|
+
declare const ProjectLauncherSchema: z.ZodEnum<{
|
|
101
|
+
none: "none";
|
|
102
|
+
cursor: "cursor";
|
|
103
|
+
vscode: "vscode";
|
|
104
|
+
"vscode-insiders": "vscode-insiders";
|
|
105
|
+
zed: "zed";
|
|
106
|
+
windsurf: "windsurf";
|
|
107
|
+
vscodium: "vscodium";
|
|
108
|
+
webstorm: "webstorm";
|
|
109
|
+
"intellij-idea": "intellij-idea";
|
|
110
|
+
"sublime-text": "sublime-text";
|
|
111
|
+
neovim: "neovim";
|
|
112
|
+
"codex-app": "codex-app";
|
|
113
|
+
codex: "codex";
|
|
114
|
+
"t3-code": "t3-code";
|
|
115
|
+
"claude-code": "claude-code";
|
|
116
|
+
opencode: "opencode";
|
|
117
|
+
pi: "pi";
|
|
118
|
+
"gemini-cli": "gemini-cli";
|
|
119
|
+
"github-copilot": "github-copilot";
|
|
120
|
+
"kiro-cli": "kiro-cli";
|
|
121
|
+
droid: "droid";
|
|
122
|
+
goose: "goose";
|
|
123
|
+
cline: "cline";
|
|
124
|
+
continue: "continue";
|
|
125
|
+
amp: "amp";
|
|
126
|
+
aider: "aider";
|
|
127
|
+
"qwen-code": "qwen-code";
|
|
128
|
+
crush: "crush";
|
|
129
|
+
"cursor-agent": "cursor-agent";
|
|
130
|
+
orca: "orca";
|
|
131
|
+
}>;
|
|
132
|
+
type ProjectLauncher = z.infer<typeof ProjectLauncherSchema>;
|
|
133
|
+
//#endregion
|
|
99
134
|
//#region src/helpers/core/command-handlers.d.ts
|
|
100
135
|
/**
|
|
101
136
|
* Result type for project creation
|
|
@@ -175,6 +210,7 @@ declare const router: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
175
210
|
git?: boolean | undefined;
|
|
176
211
|
packageManager?: "bun" | "npm" | "pnpm" | undefined;
|
|
177
212
|
install?: boolean | undefined;
|
|
213
|
+
open?: "none" | "cursor" | "vscode" | "vscode-insiders" | "zed" | "windsurf" | "vscodium" | "webstorm" | "intellij-idea" | "sublime-text" | "neovim" | "codex-app" | "codex" | "t3-code" | "claude-code" | "opencode" | "pi" | "gemini-cli" | "github-copilot" | "kiro-cli" | "droid" | "goose" | "cline" | "continue" | "amp" | "aider" | "qwen-code" | "crush" | "cursor-agent" | "orca" | undefined;
|
|
178
214
|
dbSetup?: "none" | "turso" | "neon" | "prisma-postgres" | "planetscale" | "mongodb-atlas" | "supabase" | "d1" | "docker" | undefined;
|
|
179
215
|
backend?: "none" | "hono" | "express" | "fastify" | "elysia" | "convex" | "self" | undefined;
|
|
180
216
|
runtime?: "none" | "bun" | "node" | "workers" | undefined;
|
|
@@ -231,11 +267,11 @@ declare const router: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
231
267
|
mcp?: {
|
|
232
268
|
scope?: "project" | "global" | undefined;
|
|
233
269
|
servers?: ("nx" | "better-auth" | "clerk" | "polar" | "neon" | "planetscale" | "supabase" | "convex" | "better-t-stack" | "context7" | "cloudflare-docs" | "shadcn" | "next-devtools" | "nuxt-docs" | "nuxt-ui-docs" | "svelte-docs" | "astro-docs" | "expo")[] | undefined;
|
|
234
|
-
agents?: ("
|
|
270
|
+
agents?: ("cursor" | "vscode" | "zed" | "windsurf" | "codex" | "claude-code" | "opencode" | "gemini-cli" | "goose" | "cline" | "antigravity" | "cline-cli" | "github-copilot-cli" | "grok-build" | "mcporter" | "claude-desktop")[] | undefined;
|
|
235
271
|
} | undefined;
|
|
236
272
|
skills?: {
|
|
237
273
|
scope?: "project" | "global" | undefined;
|
|
238
|
-
agents?: ("
|
|
274
|
+
agents?: ("cursor" | "zed" | "windsurf" | "codex" | "claude-code" | "opencode" | "pi" | "gemini-cli" | "github-copilot" | "kiro-cli" | "droid" | "goose" | "cline" | "continue" | "amp" | "qwen-code" | "crush" | "antigravity" | "universal" | "adal" | "aider-desk" | "antigravity-cli" | "astrbot" | "augment" | "autohand-code" | "bob" | "codearts-agent" | "codebuddy" | "codemaker" | "codestudio" | "command-code" | "cortex" | "deepagents" | "devin" | "dexto" | "eve" | "firebender" | "forgecode" | "grok" | "hermes-agent" | "iflow-cli" | "inference-sh" | "jazz" | "junie" | "kilo" | "kimchi" | "kimi-code-cli" | "kode" | "lingma" | "loaf" | "mcpjam" | "mistral-vibe" | "moxby" | "mux" | "neovate" | "ona" | "clawdbot" | "openclaw" | "openhands" | "pochi" | "promptscript" | "qoder" | "qoder-cn" | "reasonix" | "replit" | "roo" | "rovodev" | "tabnine-cli" | "terramind" | "tinycloud" | "trae" | "trae-cn" | "warp" | "zcode" | "zencoder" | "zenflow")[] | undefined;
|
|
239
275
|
selections?: {
|
|
240
276
|
source: "vercel-labs/agent-skills" | "vercel/ai" | "vercel/turborepo" | "yusukebe/hono-skill" | "vercel-labs/next-skills" | "nuxt/ui" | "heroui-inc/heroui" | "shadcn/ui" | "better-auth/skills" | "clerk/skills" | "neondatabase/agent-skills" | "supabase/agent-skills" | "planetscale/database-skills" | "expo/skills" | "prisma/skills" | "elysiajs/skills" | "waynesutton/convexskills" | "msmps/opentui-skill" | "haydenbleasel/ultracite" | "https://www.evlog.dev";
|
|
241
277
|
skills: string[];
|
|
@@ -243,8 +279,8 @@ declare const router: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
243
279
|
} | undefined;
|
|
244
280
|
ultracite?: {
|
|
245
281
|
linter?: "biome" | "oxlint" | undefined;
|
|
246
|
-
editors?: ("void" | "
|
|
247
|
-
agents?: ("
|
|
282
|
+
editors?: ("void" | "cursor" | "vscode" | "zed" | "windsurf" | "antigravity" | "bob" | "codebuddy" | "trae" | "kiro")[] | undefined;
|
|
283
|
+
agents?: ("codex" | "opencode" | "pi" | "droid" | "goose" | "cline" | "continue" | "amp" | "aider" | "crush" | "vercel" | "universal" | "adal" | "bob" | "deepagents" | "devin" | "firebender" | "junie" | "mcpjam" | "mistral-vibe" | "mux" | "ona" | "openclaw" | "qoder" | "replit" | "warp" | "zencoder" | "claude" | "jules" | "lovable" | "snowflake-cortex" | "kimi-cli" | "copilot" | "firebase-studio" | "open-hands" | "gemini" | "augmentcode" | "kilo-code" | "roo-code" | "qwen" | "amazon-q-cli" | "cursor-cli")[] | undefined;
|
|
248
284
|
hooks?: ("cursor" | "windsurf" | "codebuddy" | "claude" | "copilot")[] | undefined;
|
|
249
285
|
} | undefined;
|
|
250
286
|
} | undefined;
|
|
@@ -342,11 +378,11 @@ declare const router: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
342
378
|
mcp?: {
|
|
343
379
|
scope?: "project" | "global" | undefined;
|
|
344
380
|
servers?: ("nx" | "better-auth" | "clerk" | "polar" | "neon" | "planetscale" | "supabase" | "convex" | "better-t-stack" | "context7" | "cloudflare-docs" | "shadcn" | "next-devtools" | "nuxt-docs" | "nuxt-ui-docs" | "svelte-docs" | "astro-docs" | "expo")[] | undefined;
|
|
345
|
-
agents?: ("
|
|
381
|
+
agents?: ("cursor" | "vscode" | "zed" | "windsurf" | "codex" | "claude-code" | "opencode" | "gemini-cli" | "goose" | "cline" | "antigravity" | "cline-cli" | "github-copilot-cli" | "grok-build" | "mcporter" | "claude-desktop")[] | undefined;
|
|
346
382
|
} | undefined;
|
|
347
383
|
skills?: {
|
|
348
384
|
scope?: "project" | "global" | undefined;
|
|
349
|
-
agents?: ("
|
|
385
|
+
agents?: ("cursor" | "zed" | "windsurf" | "codex" | "claude-code" | "opencode" | "pi" | "gemini-cli" | "github-copilot" | "kiro-cli" | "droid" | "goose" | "cline" | "continue" | "amp" | "qwen-code" | "crush" | "antigravity" | "universal" | "adal" | "aider-desk" | "antigravity-cli" | "astrbot" | "augment" | "autohand-code" | "bob" | "codearts-agent" | "codebuddy" | "codemaker" | "codestudio" | "command-code" | "cortex" | "deepagents" | "devin" | "dexto" | "eve" | "firebender" | "forgecode" | "grok" | "hermes-agent" | "iflow-cli" | "inference-sh" | "jazz" | "junie" | "kilo" | "kimchi" | "kimi-code-cli" | "kode" | "lingma" | "loaf" | "mcpjam" | "mistral-vibe" | "moxby" | "mux" | "neovate" | "ona" | "clawdbot" | "openclaw" | "openhands" | "pochi" | "promptscript" | "qoder" | "qoder-cn" | "reasonix" | "replit" | "roo" | "rovodev" | "tabnine-cli" | "terramind" | "tinycloud" | "trae" | "trae-cn" | "warp" | "zcode" | "zencoder" | "zenflow")[] | undefined;
|
|
350
386
|
selections?: {
|
|
351
387
|
source: "vercel-labs/agent-skills" | "vercel/ai" | "vercel/turborepo" | "yusukebe/hono-skill" | "vercel-labs/next-skills" | "nuxt/ui" | "heroui-inc/heroui" | "shadcn/ui" | "better-auth/skills" | "clerk/skills" | "neondatabase/agent-skills" | "supabase/agent-skills" | "planetscale/database-skills" | "expo/skills" | "prisma/skills" | "elysiajs/skills" | "waynesutton/convexskills" | "msmps/opentui-skill" | "haydenbleasel/ultracite" | "https://www.evlog.dev";
|
|
352
388
|
skills: string[];
|
|
@@ -354,8 +390,8 @@ declare const router: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
354
390
|
} | undefined;
|
|
355
391
|
ultracite?: {
|
|
356
392
|
linter?: "biome" | "oxlint" | undefined;
|
|
357
|
-
editors?: ("void" | "
|
|
358
|
-
agents?: ("
|
|
393
|
+
editors?: ("void" | "cursor" | "vscode" | "zed" | "windsurf" | "antigravity" | "bob" | "codebuddy" | "trae" | "kiro")[] | undefined;
|
|
394
|
+
agents?: ("codex" | "opencode" | "pi" | "droid" | "goose" | "cline" | "continue" | "amp" | "aider" | "crush" | "vercel" | "universal" | "adal" | "bob" | "deepagents" | "devin" | "firebender" | "junie" | "mcpjam" | "mistral-vibe" | "mux" | "ona" | "openclaw" | "qoder" | "replit" | "warp" | "zencoder" | "claude" | "jules" | "lovable" | "snowflake-cortex" | "kimi-cli" | "copilot" | "firebase-studio" | "open-hands" | "gemini" | "augmentcode" | "kilo-code" | "roo-code" | "qwen" | "amazon-q-cli" | "cursor-cli")[] | undefined;
|
|
359
395
|
hooks?: ("cursor" | "windsurf" | "codebuddy" | "claude" | "copilot")[] | undefined;
|
|
360
396
|
} | undefined;
|
|
361
397
|
} | undefined;
|
|
@@ -478,4 +514,4 @@ type Runtime = import__better_t_stack_types.Runtime;
|
|
|
478
514
|
type ServerDeploy = import__better_t_stack_types.ServerDeploy;
|
|
479
515
|
type Template = import__better_t_stack_types.Template;
|
|
480
516
|
type WebDeploy = import__better_t_stack_types.WebDeploy;
|
|
481
|
-
export { type API, AddOptions, type AddResult, type AddonOptions, type Addons, type Auth, type Backend, type BetterTStackConfig, CLIError, CompatibilityError, CreateError, type CreateInput, type Database, type DatabaseSetup, DatabaseSetupError, type DbSetupOptions, type DirectoryConflict, DirectoryConflictError, EMBEDDED_TEMPLATES, type Examples, type Frontend, GeneratorError, type GeneratorOptions, type InitResult, type ORM, type PackageManager, type Payments, type ProjectConfig, ProjectCreationError, Result, type Runtime, SchemaName, SchemaNameSchema, type ServerDeploy, TEMPLATE_COUNT, type Template, UserCancelledError, ValidationError, type VirtualDirectory, type VirtualFile, VirtualFileSystem, type VirtualFileTree, type VirtualNode, type WebDeploy, add, builder, create, createBtsCli, createVirtual, docs, generate, getSchemaResult, router, sponsors };
|
|
517
|
+
export { type API, AddOptions, type AddResult, type AddonOptions, type Addons, type Auth, type Backend, type BetterTStackConfig, CLIError, CompatibilityError, CreateError, type CreateInput, type Database, type DatabaseSetup, DatabaseSetupError, type DbSetupOptions, type DirectoryConflict, DirectoryConflictError, EMBEDDED_TEMPLATES, type Examples, type Frontend, GeneratorError, type GeneratorOptions, type InitResult, type ORM, type PackageManager, type Payments, type ProjectConfig, ProjectCreationError, type ProjectLauncher, ProjectLauncherSchema, Result, type Runtime, SchemaName, SchemaNameSchema, type ServerDeploy, TEMPLATE_COUNT, type Template, UserCancelledError, ValidationError, type VirtualDirectory, type VirtualFile, VirtualFileSystem, type VirtualFileTree, type VirtualNode, type WebDeploy, add, builder, create, createBtsCli, createVirtual, docs, generate, getSchemaResult, router, sponsors };
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as
|
|
3
|
-
export { CLIError, CompatibilityError, DatabaseSetupError, DirectoryConflictError, EMBEDDED_TEMPLATES, GeneratorError, ProjectCreationError, Result, SchemaNameSchema, TEMPLATE_COUNT, UserCancelledError, ValidationError, VirtualFileSystem, add, builder, create, createBtsCli, createVirtual, docs, generate, getSchemaResult, router, sponsors };
|
|
2
|
+
import { C as DirectoryConflictError, E as ValidationError, S as DatabaseSetupError, T as UserCancelledError, _ as ProjectLauncherSchema, a as TEMPLATE_COUNT, b as CLIError, c as builder, d as createVirtual, f as docs, g as sponsors, h as router, i as SchemaNameSchema, l as create, m as getSchemaResult, n as GeneratorError, o as VirtualFileSystem, p as generate, r as Result, s as add, t as EMBEDDED_TEMPLATES, u as createBtsCli, w as ProjectCreationError, x as CompatibilityError } from "./src-CP4utAOe.mjs";
|
|
3
|
+
export { CLIError, CompatibilityError, DatabaseSetupError, DirectoryConflictError, EMBEDDED_TEMPLATES, GeneratorError, ProjectCreationError, ProjectLauncherSchema, Result, SchemaNameSchema, TEMPLATE_COUNT, UserCancelledError, ValidationError, VirtualFileSystem, add, builder, create, createBtsCli, createVirtual, docs, generate, getSchemaResult, router, sponsors };
|
|
@@ -6313,6 +6313,356 @@ async function findAvailableIncrementedPath(currentPathInput) {
|
|
|
6313
6313
|
}
|
|
6314
6314
|
}
|
|
6315
6315
|
//#endregion
|
|
6316
|
+
//#region src/utils/command-exists.ts
|
|
6317
|
+
async function commandExists(command) {
|
|
6318
|
+
const result = await Result.tryPromise({
|
|
6319
|
+
try: async () => {
|
|
6320
|
+
if (process.platform === "win32") return (await $({ reject: false })`where ${command}`).exitCode === 0;
|
|
6321
|
+
return (await $({ reject: false })`which ${command}`).exitCode === 0;
|
|
6322
|
+
},
|
|
6323
|
+
catch: () => false
|
|
6324
|
+
});
|
|
6325
|
+
return result.isOk() ? result.value : false;
|
|
6326
|
+
}
|
|
6327
|
+
//#endregion
|
|
6328
|
+
//#region src/utils/project-launcher.ts
|
|
6329
|
+
const ProjectLauncherSchema = z.enum([
|
|
6330
|
+
"cursor",
|
|
6331
|
+
"vscode",
|
|
6332
|
+
"vscode-insiders",
|
|
6333
|
+
"zed",
|
|
6334
|
+
"windsurf",
|
|
6335
|
+
"vscodium",
|
|
6336
|
+
"webstorm",
|
|
6337
|
+
"intellij-idea",
|
|
6338
|
+
"sublime-text",
|
|
6339
|
+
"neovim",
|
|
6340
|
+
"codex-app",
|
|
6341
|
+
"codex",
|
|
6342
|
+
"t3-code",
|
|
6343
|
+
"claude-code",
|
|
6344
|
+
"opencode",
|
|
6345
|
+
"pi",
|
|
6346
|
+
"gemini-cli",
|
|
6347
|
+
"github-copilot",
|
|
6348
|
+
"kiro-cli",
|
|
6349
|
+
"droid",
|
|
6350
|
+
"goose",
|
|
6351
|
+
"cline",
|
|
6352
|
+
"continue",
|
|
6353
|
+
"amp",
|
|
6354
|
+
"aider",
|
|
6355
|
+
"qwen-code",
|
|
6356
|
+
"crush",
|
|
6357
|
+
"cursor-agent",
|
|
6358
|
+
"orca",
|
|
6359
|
+
"none"
|
|
6360
|
+
]).describe("Editor, IDE, or coding agent to open after creating the project");
|
|
6361
|
+
const PROJECT_LAUNCHERS = [
|
|
6362
|
+
{
|
|
6363
|
+
id: "cursor",
|
|
6364
|
+
label: "Cursor",
|
|
6365
|
+
kind: "editor",
|
|
6366
|
+
commands: ["cursor"],
|
|
6367
|
+
args: (projectDir) => [projectDir]
|
|
6368
|
+
},
|
|
6369
|
+
{
|
|
6370
|
+
id: "vscode",
|
|
6371
|
+
label: "Visual Studio Code",
|
|
6372
|
+
kind: "editor",
|
|
6373
|
+
commands: ["code"],
|
|
6374
|
+
args: (projectDir) => [projectDir]
|
|
6375
|
+
},
|
|
6376
|
+
{
|
|
6377
|
+
id: "vscode-insiders",
|
|
6378
|
+
label: "Visual Studio Code Insiders",
|
|
6379
|
+
kind: "editor",
|
|
6380
|
+
commands: ["code-insiders"],
|
|
6381
|
+
args: (projectDir) => [projectDir]
|
|
6382
|
+
},
|
|
6383
|
+
{
|
|
6384
|
+
id: "zed",
|
|
6385
|
+
label: "Zed",
|
|
6386
|
+
kind: "editor",
|
|
6387
|
+
commands: ["zed", "zeditor"],
|
|
6388
|
+
args: (projectDir) => [projectDir]
|
|
6389
|
+
},
|
|
6390
|
+
{
|
|
6391
|
+
id: "windsurf",
|
|
6392
|
+
label: "Windsurf",
|
|
6393
|
+
kind: "editor",
|
|
6394
|
+
commands: ["windsurf"],
|
|
6395
|
+
args: (projectDir) => [projectDir]
|
|
6396
|
+
},
|
|
6397
|
+
{
|
|
6398
|
+
id: "vscodium",
|
|
6399
|
+
label: "VSCodium",
|
|
6400
|
+
kind: "editor",
|
|
6401
|
+
commands: ["codium"],
|
|
6402
|
+
args: (projectDir) => [projectDir]
|
|
6403
|
+
},
|
|
6404
|
+
{
|
|
6405
|
+
id: "webstorm",
|
|
6406
|
+
label: "JetBrains WebStorm",
|
|
6407
|
+
kind: "editor",
|
|
6408
|
+
commands: [
|
|
6409
|
+
"webstorm",
|
|
6410
|
+
"webstorm64.exe",
|
|
6411
|
+
"webstorm.bat",
|
|
6412
|
+
"webstorm.sh"
|
|
6413
|
+
],
|
|
6414
|
+
args: (projectDir) => [projectDir]
|
|
6415
|
+
},
|
|
6416
|
+
{
|
|
6417
|
+
id: "intellij-idea",
|
|
6418
|
+
label: "JetBrains IntelliJ IDEA",
|
|
6419
|
+
kind: "editor",
|
|
6420
|
+
commands: [
|
|
6421
|
+
"idea",
|
|
6422
|
+
"intellij-idea",
|
|
6423
|
+
"idea64.exe",
|
|
6424
|
+
"idea.bat",
|
|
6425
|
+
"idea.sh"
|
|
6426
|
+
],
|
|
6427
|
+
args: (projectDir) => [projectDir]
|
|
6428
|
+
},
|
|
6429
|
+
{
|
|
6430
|
+
id: "sublime-text",
|
|
6431
|
+
label: "Sublime Text",
|
|
6432
|
+
kind: "editor",
|
|
6433
|
+
commands: ["subl"],
|
|
6434
|
+
args: (projectDir) => [projectDir]
|
|
6435
|
+
},
|
|
6436
|
+
{
|
|
6437
|
+
id: "neovim",
|
|
6438
|
+
label: "Neovim",
|
|
6439
|
+
kind: "editor",
|
|
6440
|
+
commands: ["nvim"],
|
|
6441
|
+
args: () => ["."],
|
|
6442
|
+
cwd: (projectDir) => projectDir
|
|
6443
|
+
},
|
|
6444
|
+
{
|
|
6445
|
+
id: "codex-app",
|
|
6446
|
+
label: "Codex app",
|
|
6447
|
+
kind: "agent",
|
|
6448
|
+
commands: ["codex"],
|
|
6449
|
+
args: (projectDir) => ["app", projectDir],
|
|
6450
|
+
platforms: ["darwin"]
|
|
6451
|
+
},
|
|
6452
|
+
{
|
|
6453
|
+
id: "codex",
|
|
6454
|
+
label: "Codex CLI",
|
|
6455
|
+
kind: "agent",
|
|
6456
|
+
commands: ["codex"],
|
|
6457
|
+
cwd: (projectDir) => projectDir
|
|
6458
|
+
},
|
|
6459
|
+
{
|
|
6460
|
+
id: "t3-code",
|
|
6461
|
+
label: "T3 Code",
|
|
6462
|
+
kind: "agent",
|
|
6463
|
+
commands: ["t3"],
|
|
6464
|
+
cwd: (projectDir) => projectDir
|
|
6465
|
+
},
|
|
6466
|
+
{
|
|
6467
|
+
id: "claude-code",
|
|
6468
|
+
label: "Claude Code",
|
|
6469
|
+
kind: "agent",
|
|
6470
|
+
commands: ["claude"],
|
|
6471
|
+
cwd: (projectDir) => projectDir
|
|
6472
|
+
},
|
|
6473
|
+
{
|
|
6474
|
+
id: "opencode",
|
|
6475
|
+
label: "OpenCode",
|
|
6476
|
+
kind: "agent",
|
|
6477
|
+
commands: ["opencode"],
|
|
6478
|
+
cwd: (projectDir) => projectDir
|
|
6479
|
+
},
|
|
6480
|
+
{
|
|
6481
|
+
id: "pi",
|
|
6482
|
+
label: "Pi",
|
|
6483
|
+
kind: "agent",
|
|
6484
|
+
commands: ["pi"],
|
|
6485
|
+
cwd: (projectDir) => projectDir
|
|
6486
|
+
},
|
|
6487
|
+
{
|
|
6488
|
+
id: "gemini-cli",
|
|
6489
|
+
label: "Gemini CLI",
|
|
6490
|
+
kind: "agent",
|
|
6491
|
+
commands: ["gemini"],
|
|
6492
|
+
cwd: (projectDir) => projectDir
|
|
6493
|
+
},
|
|
6494
|
+
{
|
|
6495
|
+
id: "github-copilot",
|
|
6496
|
+
label: "GitHub Copilot CLI",
|
|
6497
|
+
kind: "agent",
|
|
6498
|
+
commands: ["copilot"],
|
|
6499
|
+
cwd: (projectDir) => projectDir
|
|
6500
|
+
},
|
|
6501
|
+
{
|
|
6502
|
+
id: "kiro-cli",
|
|
6503
|
+
label: "Kiro CLI",
|
|
6504
|
+
kind: "agent",
|
|
6505
|
+
commands: ["kiro-cli"],
|
|
6506
|
+
cwd: (projectDir) => projectDir
|
|
6507
|
+
},
|
|
6508
|
+
{
|
|
6509
|
+
id: "droid",
|
|
6510
|
+
label: "Factory Droid",
|
|
6511
|
+
kind: "agent",
|
|
6512
|
+
commands: ["droid"],
|
|
6513
|
+
cwd: (projectDir) => projectDir
|
|
6514
|
+
},
|
|
6515
|
+
{
|
|
6516
|
+
id: "goose",
|
|
6517
|
+
label: "goose",
|
|
6518
|
+
kind: "agent",
|
|
6519
|
+
commands: ["goose"],
|
|
6520
|
+
args: () => ["session"],
|
|
6521
|
+
cwd: (projectDir) => projectDir
|
|
6522
|
+
},
|
|
6523
|
+
{
|
|
6524
|
+
id: "cline",
|
|
6525
|
+
label: "Cline CLI",
|
|
6526
|
+
kind: "agent",
|
|
6527
|
+
commands: ["cline"],
|
|
6528
|
+
cwd: (projectDir) => projectDir,
|
|
6529
|
+
platforms: ["darwin", "linux"]
|
|
6530
|
+
},
|
|
6531
|
+
{
|
|
6532
|
+
id: "continue",
|
|
6533
|
+
label: "Continue CLI",
|
|
6534
|
+
kind: "agent",
|
|
6535
|
+
commands: ["cn"],
|
|
6536
|
+
cwd: (projectDir) => projectDir
|
|
6537
|
+
},
|
|
6538
|
+
{
|
|
6539
|
+
id: "amp",
|
|
6540
|
+
label: "Amp",
|
|
6541
|
+
kind: "agent",
|
|
6542
|
+
commands: ["amp"],
|
|
6543
|
+
cwd: (projectDir) => projectDir
|
|
6544
|
+
},
|
|
6545
|
+
{
|
|
6546
|
+
id: "aider",
|
|
6547
|
+
label: "Aider",
|
|
6548
|
+
kind: "agent",
|
|
6549
|
+
commands: ["aider"],
|
|
6550
|
+
cwd: (projectDir) => projectDir
|
|
6551
|
+
},
|
|
6552
|
+
{
|
|
6553
|
+
id: "qwen-code",
|
|
6554
|
+
label: "Qwen Code",
|
|
6555
|
+
kind: "agent",
|
|
6556
|
+
commands: ["qwen"],
|
|
6557
|
+
cwd: (projectDir) => projectDir
|
|
6558
|
+
},
|
|
6559
|
+
{
|
|
6560
|
+
id: "crush",
|
|
6561
|
+
label: "Crush",
|
|
6562
|
+
kind: "agent",
|
|
6563
|
+
commands: ["crush"],
|
|
6564
|
+
cwd: (projectDir) => projectDir
|
|
6565
|
+
},
|
|
6566
|
+
{
|
|
6567
|
+
id: "cursor-agent",
|
|
6568
|
+
label: "Cursor Agent",
|
|
6569
|
+
kind: "agent",
|
|
6570
|
+
commands: ["cursor-agent"],
|
|
6571
|
+
cwd: (projectDir) => projectDir
|
|
6572
|
+
},
|
|
6573
|
+
{
|
|
6574
|
+
id: "orca",
|
|
6575
|
+
label: "Orca",
|
|
6576
|
+
kind: "agent",
|
|
6577
|
+
commands: ["orca"],
|
|
6578
|
+
commandsByPlatform: { linux: ["orca-ide"] },
|
|
6579
|
+
launchSequence: (command, projectDir) => [{
|
|
6580
|
+
command,
|
|
6581
|
+
args: ["open", "--json"]
|
|
6582
|
+
}, {
|
|
6583
|
+
command,
|
|
6584
|
+
args: [
|
|
6585
|
+
"repo",
|
|
6586
|
+
"add",
|
|
6587
|
+
"--path",
|
|
6588
|
+
projectDir,
|
|
6589
|
+
"--json"
|
|
6590
|
+
]
|
|
6591
|
+
}]
|
|
6592
|
+
}
|
|
6593
|
+
];
|
|
6594
|
+
async function detectProjectLaunchers(projectDir, detectCommand = commandExists, platform = process.platform) {
|
|
6595
|
+
const supportedDefinitions = PROJECT_LAUNCHERS.filter(({ platforms }) => platforms === void 0 || platforms.includes(platform));
|
|
6596
|
+
const commandsFor = (launcher) => launcher.commandsByPlatform?.[platform] ?? launcher.commands;
|
|
6597
|
+
const commands = [...new Set(supportedDefinitions.flatMap(commandsFor))];
|
|
6598
|
+
const detectedCommands = new Map(await Promise.all(commands.map(async (command) => [command, await detectCommand(command)])));
|
|
6599
|
+
return supportedDefinitions.flatMap((launcher) => {
|
|
6600
|
+
const command = commandsFor(launcher).find((candidate) => detectedCommands.get(candidate));
|
|
6601
|
+
if (!command) return [];
|
|
6602
|
+
const availableLauncher = {
|
|
6603
|
+
id: launcher.id,
|
|
6604
|
+
label: launcher.label,
|
|
6605
|
+
kind: launcher.kind,
|
|
6606
|
+
command,
|
|
6607
|
+
args: launcher.args?.(projectDir) ?? [],
|
|
6608
|
+
cwd: launcher.cwd?.(projectDir)
|
|
6609
|
+
};
|
|
6610
|
+
if (launcher.launchSequence) availableLauncher.launchSequence = launcher.launchSequence(command, projectDir);
|
|
6611
|
+
return [availableLauncher];
|
|
6612
|
+
});
|
|
6613
|
+
}
|
|
6614
|
+
async function getProjectLauncherChoice(requestedLauncher, projectDir, options = {}) {
|
|
6615
|
+
if (requestedLauncher === "none") return Result.ok(void 0);
|
|
6616
|
+
if (!requestedLauncher && options.prompt === false) return Result.ok(void 0);
|
|
6617
|
+
const availableLaunchers = await detectProjectLaunchers(projectDir, options.detectCommand, options.platform);
|
|
6618
|
+
if (requestedLauncher) {
|
|
6619
|
+
const launcher = availableLaunchers.find(({ id }) => id === requestedLauncher);
|
|
6620
|
+
if (launcher) return Result.ok(launcher);
|
|
6621
|
+
const definition = PROJECT_LAUNCHERS.find(({ id }) => id === requestedLauncher);
|
|
6622
|
+
return Result.err(new CLIError({ message: `${definition?.label ?? requestedLauncher} is not installed or its command is not available in PATH.` }));
|
|
6623
|
+
}
|
|
6624
|
+
if (availableLaunchers.length === 0) return Result.ok(void 0);
|
|
6625
|
+
setIsFirstPrompt(true);
|
|
6626
|
+
try {
|
|
6627
|
+
const selected = await navigableSelect({
|
|
6628
|
+
message: "Open project with?",
|
|
6629
|
+
options: [...availableLaunchers.map(({ id, label, kind }) => ({
|
|
6630
|
+
value: id,
|
|
6631
|
+
label,
|
|
6632
|
+
hint: kind === "editor" ? "editor / IDE" : "coding agent"
|
|
6633
|
+
})), {
|
|
6634
|
+
value: "none",
|
|
6635
|
+
label: "Not now"
|
|
6636
|
+
}],
|
|
6637
|
+
initialValue: "none",
|
|
6638
|
+
maxItems: 12
|
|
6639
|
+
});
|
|
6640
|
+
if (isCancel$1(selected) || selected === "none") return Result.ok(void 0);
|
|
6641
|
+
return Result.ok(availableLaunchers.find(({ id }) => id === selected));
|
|
6642
|
+
} finally {
|
|
6643
|
+
setIsFirstPrompt(false);
|
|
6644
|
+
}
|
|
6645
|
+
}
|
|
6646
|
+
const runCommand = async (command, args, options) => {
|
|
6647
|
+
await execa(command, args, options);
|
|
6648
|
+
};
|
|
6649
|
+
async function launchProject(launcher, options = {}) {
|
|
6650
|
+
if (options.skipExternalCommands ?? shouldSkipExternalCommands()) return Result.ok(void 0);
|
|
6651
|
+
return Result.tryPromise({
|
|
6652
|
+
try: async () => {
|
|
6653
|
+
const commands = launcher.launchSequence ?? [launcher];
|
|
6654
|
+
for (const command of commands) await (options.runner ?? runCommand)(command.command, command.args, {
|
|
6655
|
+
cwd: command.cwd,
|
|
6656
|
+
stdio: command.cwd ? "inherit" : "ignore"
|
|
6657
|
+
});
|
|
6658
|
+
},
|
|
6659
|
+
catch: (cause) => new CLIError({
|
|
6660
|
+
message: `Could not open the project with ${launcher.label}.`,
|
|
6661
|
+
cause
|
|
6662
|
+
})
|
|
6663
|
+
});
|
|
6664
|
+
}
|
|
6665
|
+
//#endregion
|
|
6316
6666
|
//#region src/utils/project-name-validation.ts
|
|
6317
6667
|
function validateProjectName(name) {
|
|
6318
6668
|
const hardeningResult = validateAgentSafePathInput(name, "projectName");
|
|
@@ -6668,18 +7018,6 @@ function getDatabaseUrl(database, projectName) {
|
|
|
6668
7018
|
}
|
|
6669
7019
|
}
|
|
6670
7020
|
//#endregion
|
|
6671
|
-
//#region src/utils/command-exists.ts
|
|
6672
|
-
async function commandExists(command) {
|
|
6673
|
-
const result = await Result.tryPromise({
|
|
6674
|
-
try: async () => {
|
|
6675
|
-
if (process.platform === "win32") return (await $({ reject: false })`where ${command}`).exitCode === 0;
|
|
6676
|
-
return (await $({ reject: false })`which ${command}`).exitCode === 0;
|
|
6677
|
-
},
|
|
6678
|
-
catch: () => false
|
|
6679
|
-
});
|
|
6680
|
-
return result.isOk() ? result.value : false;
|
|
6681
|
-
}
|
|
6682
|
-
//#endregion
|
|
6683
7021
|
//#region src/helpers/database-providers/mongodb-atlas-setup.ts
|
|
6684
7022
|
async function checkAtlasCLI() {
|
|
6685
7023
|
const exists = await commandExists("atlas");
|
|
@@ -8629,10 +8967,20 @@ async function createProjectHandlerInternal(input, startTime, timeScaffolded) {
|
|
|
8629
8967
|
const historyCommand = getCliSubcommandCommand("history", config.packageManager);
|
|
8630
8968
|
log.message(`${pc.dim("Setup saved to history")}\n${pc.cyan(historyCommand)}`);
|
|
8631
8969
|
}
|
|
8970
|
+
let projectLauncher;
|
|
8971
|
+
if (!isSilent()) {
|
|
8972
|
+
const launcherResult = await getProjectLauncherChoice(input.open, config.projectDir, { prompt: !input.yes && process.env.CI === void 0 && process.stdin.isTTY === true && process.stdout.isTTY === true });
|
|
8973
|
+
if (launcherResult.isErr()) log.warn(pc.yellow(launcherResult.error.message));
|
|
8974
|
+
else projectLauncher = launcherResult.value;
|
|
8975
|
+
}
|
|
8632
8976
|
const elapsedTimeMs = Date.now() - startTime;
|
|
8633
8977
|
if (!isSilent()) {
|
|
8634
8978
|
const elapsedTimeInSeconds = (elapsedTimeMs / 1e3).toFixed(1);
|
|
8635
8979
|
outro(pc.magenta(`Project ready in ${pc.bold(`${elapsedTimeInSeconds}s`)}`));
|
|
8980
|
+
if (projectLauncher) {
|
|
8981
|
+
const launchResult = await launchProject(projectLauncher);
|
|
8982
|
+
if (launchResult.isErr()) log.warn(pc.yellow(launchResult.error.message));
|
|
8983
|
+
}
|
|
8636
8984
|
}
|
|
8637
8985
|
return Result.ok({
|
|
8638
8986
|
success: true,
|
|
@@ -8787,6 +9135,7 @@ const router = t.router({
|
|
|
8787
9135
|
git: z.boolean().optional(),
|
|
8788
9136
|
packageManager: types_exports.PackageManagerSchema.optional(),
|
|
8789
9137
|
install: z.boolean().optional(),
|
|
9138
|
+
open: ProjectLauncherSchema.optional(),
|
|
8790
9139
|
dbSetup: types_exports.DatabaseSetupSchema.optional(),
|
|
8791
9140
|
backend: types_exports.BackendSchema.optional(),
|
|
8792
9141
|
runtime: types_exports.RuntimeSchema.optional(),
|
|
@@ -9025,4 +9374,4 @@ async function add(options = {}) {
|
|
|
9025
9374
|
};
|
|
9026
9375
|
}
|
|
9027
9376
|
//#endregion
|
|
9028
|
-
export {
|
|
9377
|
+
export { DirectoryConflictError as C, ValidationError as E, DatabaseSetupError as S, UserCancelledError as T, ProjectLauncherSchema as _, TEMPLATE_COUNT as a, CLIError as b, builder as c, createVirtual as d, docs as f, sponsors as g, router as h, SchemaNameSchema as i, create as l, getSchemaResult as m, GeneratorError$1 as n, VirtualFileSystem$1 as o, generate$1 as p, Result$1 as r, add as s, EMBEDDED_TEMPLATES$1 as t, createBtsCli as u, types_exports as v, ProjectCreationError as w, CompatibilityError as x, getLatestCLIVersion as y };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-t-stack",
|
|
3
|
-
"version": "3.40.
|
|
3
|
+
"version": "3.40.2",
|
|
4
4
|
"description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"better-auth",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"prepublishOnly": "npm run build"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@better-t-stack/template-generator": "^3.40.
|
|
73
|
-
"@better-t-stack/types": "^3.40.
|
|
72
|
+
"@better-t-stack/template-generator": "^3.40.2",
|
|
73
|
+
"@better-t-stack/types": "^3.40.2",
|
|
74
74
|
"@clack/core": "^1.4.3",
|
|
75
75
|
"@clack/prompts": "^1.7.0",
|
|
76
76
|
"@modelcontextprotocol/sdk": "1.30.0",
|