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:-
You run the CLI without any arguments:
-
You omit any required arguments:
Interactive Prompts Flow
The CLI will guide you through the following prompts in order:1. Project Name
Default:
node-blueprint-starterValidation: Must contain only lowercase letters, numbers, and hyphensError example: “Project name can only contain lowercase letters, numbers, and hyphens”2. Framework Selection
Options:
- Express
3. Database Selection
Options:
- PostgreSQL
- MySQL
- MongoDB
4. ORM/ODM Selection
Options (for MySQL/PostgreSQL):
- Drizzle (default)
- Prisma
- Mongoose (only option)
The ORM options change based on your database selection. MongoDB automatically shows only Mongoose.
5. Authentication
Options:
- Basic JWT authentication
- None
6. Additional Features
Options:
- Include Docker setup
- Space: Toggle selection
- Enter: Continue with selected features
7. Git Initialization
Options:
- Yes, please do
- No, I’ll do it myself
8. Dependency Installation
Options:
- Yes, install dependencies (recommended)
- No, I’ll install them later
Interactive Mode Example Session
Here’s a complete example of an interactive session:Navigation Controls
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
PressCtrl+C at any time to cancel the interactive session:
Error Handling
Validation Errors
If you enter invalid input, you’ll see an error message and be prompted again:Prompt Cancellation
If you cancel the prompt (Ctrl+C), the CLI exits cleanly:0
General Errors
If an unexpected error occurs during prompts: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
Tips for Interactive Mode
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