forgeloop init
Usage
forgeloop init <project-name> [flags]
forgeloop init
- With project name +
--yesor non-TTY: non-interactive; missing enum flags use defaults (TypeScript, modular, npm, no database, eslint-prettier). - Interactive: run
forgeloop initorforgeloop initwithout--yesin a TTY — you get prompts for name (if missing), language, preset, package manager, database, ORM, tooling, git, docker, CI, and post-scaffold install.
Non-interactive requires a name
Without a TTY or with --yes, init requires a project name as the first argument after init. Otherwise the CLI exits with a message like
init requires a project name in non-interactive mode.
Examples
npx forgeloop init my-bot --yes --preset advanced --language ts --git --install
npx create-forgeloop@latest my-bot -- --yes --database sqlite --orm prisma
Wizard (no args, TTY):
bash
npx forgeloop init
ForgeLoop • discord bot forgeProject wizardAnswer a few questions and ForgeLoop will shape the starter around your bot.? Project name (default: my-discord-bot)> …
Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--dir | string | <project-name> | Output directory (resolved with path.resolve). |
--language | ts | js | ts | Source language. |
--preset | basic | modular | advanced | modular | Project shape; see Concepts. |
--package-manager | npm | pnpm | yarn | npm | Lockfile/scripts style in generated package.json. |
--database | none | sqlite | postgresql | none | Database wiring; when not none, use --orm prisma. |
--orm | none | prisma | none (or prisma if database ≠ none) | Only Prisma is supported today when a database is selected. |
--tooling | eslint-prettier | biome | none | eslint-prettier | Lint/format setup. |
--git | boolean | — | Initialize a git repo and add .gitignore. |
--docker | boolean | — | Add Dockerfile and dockerignore-style rules. |
--ci | boolean | — | Add GitHub Actions workflow for validation. |
--install | boolean | — | Run package manager install after writing files (5 min timeout). |
--yes | boolean | — | Skip interactive prompts when combined with TTY; always non-interactive path when used with full args. |
Directory resolution
If --dir is omitted, ForgeLoop writes to <cwd>/<project-name>.
If --dir is provided and already ends with the project name, ForgeLoop uses it directly. Otherwise it writes to <dir>/<project-name>.
Output
Prints a banner, Project profile lines, optional git/install progress, Next steps (cd, install, .env, optional db:push, dev).
Failure modes
- Unsupported enum value → lists supported values.
npm|pnpm|yarn installfailure → non-zero exit with CLI error message.--orm nonewith--databasenotnone→ init option validation error.--database nonewith--orm prisma→ init option validation error.