Skip to main content

Overview

Interactive mode provides a user-friendly, step-by-step wizard for creating your Node.js project. Instead of remembering command-line flags, you’ll be guided through a series of prompts.

Entering Interactive Mode

Interactive mode is triggered when:
  1. You run the CLI without any arguments:
    npx create-node-blueprint
    
  2. You omit any required arguments:
    # Missing --orm and --database
    create-node-blueprint --name my-app --framework express
    

Interactive Prompts Flow

The CLI will guide you through the following prompts in order:

1. Project Name

? What would you like to name your project?
  node-blueprint-starter
Project Name
text input
Default: node-blueprint-starterValidation: Must contain only lowercase letters, numbers, and hyphensError example: “Project name can only contain lowercase letters, numbers, and hyphens”
Type your project name and press Enter. Invalid names will show an error message and prompt you again.

2. Framework Selection

? Which Node.js framework would you like to use?
 Express
Framework
select
Options:
  • Express
Default: Express
Use arrow keys to select (currently only Express is available) and press Enter.

3. Database Selection

? Which database would you like to use?
 PostgreSQL
    MySQL
    MongoDB
Database
select
Options:
  • PostgreSQL
  • MySQL
  • MongoDB
Default: PostgreSQL
Use arrow keys to navigate and press Enter to select.

4. ORM/ODM Selection

? Which ORM/ODM would you like to use?
 Drizzle
    Prisma
ORM
select
Options (for MySQL/PostgreSQL):
  • Drizzle (default)
  • Prisma
Options (for MongoDB):
  • Mongoose (only option)
The ORM options change based on your database selection. MongoDB automatically shows only Mongoose.

5. Authentication

? Would you like to include one of the following authentication?
 Basic JWT authentication
    None
Authentication
select
Options:
  • Basic JWT authentication
  • None
Select whether to include JWT authentication endpoints in your project.

6. Additional Features

? What additional features would you like to include? (Optional - press space to select, enter to continue)
 Include Docker setup
Features
multiselect
Options:
  • Include Docker setup
Default: None selectedControls:
  • Space: Toggle selection
  • Enter: Continue with selected features
This is a multi-select prompt. Use Space to toggle selections and Enter when done.

7. Git Initialization

? Would you like to initialize a git repository?
 Yes, please do
    No, I'll do it myself
Git
select
Options:
  • Yes, please do
  • No, I’ll do it myself

8. Dependency Installation

? Would you like to install dependencies now? (Recommended)
 Yes, install dependencies
    No, I'll install them later
Install Dependencies
select
Options:
  • Yes, install dependencies (recommended)
  • No, I’ll install them later
Default: Yes

Interactive Mode Example Session

Here’s a complete example of an interactive session:
$ npx create-node-blueprint

? What would you like to name your project?
  my-awesome-api

? Which Node.js framework would you like to use?
 Express

? Which database would you like to use?
 PostgreSQL
    MySQL
    MongoDB

? Which ORM/ODM would you like to use?
    Drizzle
 Prisma

? Would you like to include one of the following authentication?
 Basic JWT authentication
    None

? What additional features would you like to include?
 Include Docker setup

? Would you like to initialize a git repository?
 Yes, please do
    No, I'll do it myself

? Would you like to install dependencies now?
  ❯ Yes, install dependencies
    No, I'll install them later

 Creating project...
 Installing dependencies...
 Initializing git repository...

Project created successfully!

Arrow Keys

Navigate between options in select prompts

Space

Toggle selections in multi-select prompts

Enter

Confirm selection and proceed to next prompt

Ctrl+C

Cancel and exit the CLI

Cancelling Interactive Mode

Press Ctrl+C at any time to cancel the interactive session:
? What would you like to name your project?
^C
Prompt cancelled. Goodbye!
The CLI will exit gracefully without creating any files.

Error Handling

Validation Errors

If you enter invalid input, you’ll see an error message and be prompted again:
? What would you like to name your project?
  My-API
 Project name can only contain lowercase letters, numbers, and hyphens

? What would you like to name your project?
  my-api

Prompt Cancellation

If you cancel the prompt (Ctrl+C), the CLI exits cleanly:
Prompt cancelled. Goodbye!
Exit code: 0

General Errors

If an unexpected error occurs during prompts:
An error occurred: [error message]
Exit code: 1

Interactive vs Non-Interactive Mode

When to Use Interactive Mode

Good for:
  • First-time users learning the CLI
  • Exploring available options
  • One-off project creation
  • When you don’t remember all the option names

When to Use Non-Interactive Mode

Good for:
  • Automation and scripts
  • CI/CD pipelines
  • Repeating the same configuration
  • When you know exactly what you want
Example non-interactive equivalent:
create-node-blueprint \
  --name my-awesome-api \
  --framework express \
  --database postgres \
  --orm prisma \
  --auth jwt-auth \
  --features docker \
  --git \
  --install

Tips for Interactive Mode

Default values: Most prompts have sensible defaults. Press Enter to accept the default value shown.
Multi-select prompts: Read the prompt message carefully - it tells you to use Space to select and Enter to continue.
Database compatibility: Pay attention to the ORM options after selecting a database. MongoDB only supports Mongoose.
Project name validation: Use lowercase letters, numbers, and hyphens only. The validator runs in real-time as you type.

Prompt Library

The interactive mode is powered by @clack/prompts, providing a polished and user-friendly CLI experience.

Accessibility

The interactive prompts support:
  • Keyboard navigation
  • Screen reader compatibility (via @clack/prompts)
  • Clear visual feedback for selections
  • Helpful inline instructions

Build docs developers (and LLMs) love