src.
Database Templates
resolveDbTemplate
An object containing
language (TypeScript | JavaScript) and database (Mongoose | Prisma | Drizzle | None).Returns a relative template path string like
mongoose/ts or prisma/js. Returns null when None.Configuration Merging
mergeDeps
Path to the generated project root.
Path to a
deps.json file inside the template folder.deps.json into the new project’s package.json. It reads package.json at targetDir, merges dependencies, devDependencies, and scripts from depsPath, and writes back.
appendEnv
Path to the generated project root.
Path to the environment variables block.
env.append to the project’s .env if present.
mergeDbConfigToRoot
Path to the generated project root.
Path to the selected DB template folder.
templateDir into targetDir, filtering out CLI internal files such as env.append, deps.json, template entrypoints, and Prisma schema (if present). Reference: src/dbHelper.ts
Docker Support
addDocker
Command-line options including
docker.Selected language (TypeScript | JavaScript).
Path to the generated project root.
--docker flag and, if not present, prompts the user to enable Docker support.
createDockerFile
Selected language (TypeScript | JavaScript).
Path to the generated project root.
Dockerfile and .dockerignore based on the project’s language in targetDir.
Main CLI Flow
index (CLI entry)
src/index.ts orchestrates the entire flow using commander and @clack/prompts:
- Build template path from language
- Copy template to target folder
- Resolve and copy DB template (if selected)
- Generate Docker configuration (if enabled)
- Merge deps, append env, merge DB config, and run
npm install