CLI options
The create-nestforge CLI scaffolds a project from the command line. You can run it interactively or pass flags to automate the process.
npx create-nestforge@latestInteractive prompts
Section titled “Interactive prompts”When run without flags, the CLI asks for:
- Project name — lowercase letters, numbers, and dashes only.
- Variant —
Express + RESTorGraphQL (Apollo). - OAuth providers — select which providers to include (currently Google).
| Flag | Description | Example |
|---|---|---|
--help |
Show help message and exit | --help |
--version |
Print version and exit | --version |
--project-name |
Project name and target directory | --project-name my-app |
--oauth-providers |
Comma-separated OAuth providers: google,github |
--oauth-providers google |
--variant |
Template variant: rest or graphql |
--variant graphql |
--target-dir |
Override the output directory | --target-dir ./output/my-app |
--git |
Initialize a git repository (default) | --git |
--no-git |
Skip git initialization | --no-git |
Automation example
Section titled “Automation example”npx create-nestforge@latest --project-name my-app --variant graphql --oauth-providers googleThis creates my-app in the current working directory, copies the base template, and layers the GraphQL overlay on top.
What the CLI does
Section titled “What the CLI does”- Copies
templates/baseinto the target directory. - If the variant is
graphql, copies the GraphQL overlay, overwriting the shared files. - Merges the GraphQL
dependenciesintopackage.json. - Sets the
package.jsonnameto the project name. - Creates a
.envfile from.env.example.
After scaffolding
Section titled “After scaffolding”The CLI prints the next steps:
cd my-apppnpm installcp .env.example .envpnpm start:devMake sure Redis is running before starting the app. The easiest way is to use Docker Compose:
docker compose up redisSkipping ignored files
Section titled “Skipping ignored files”The CLI ignores node_modules, dist, .git, coverage, .env, and pnpm-lock.yaml when copying templates. Install dependencies fresh in the generated project.