Skip to main content
This guide will walk you through setting up Node Blueprint CLI for local development.

Prerequisites

Before you begin, ensure you have:
  • Node.js (v18 or higher recommended)
  • npm or yarn package manager
  • Git for version control

Setup Steps

1

Clone the repository

Clone the Node Blueprint repository to your local machine:
git clone https://github.com/yogendrarana/node-blueprint.git
cd node-blueprint
2

Install dependencies

Install all dependencies for the monorepo:
npm install
# or
yarn install
This will install dependencies for all workspace packages (CLI and docs site).
3

Build all packages

Build all packages in the monorepo:
npm run build
# or
yarn build
This runs:
  • build:cli - Compiles the CLI TypeScript code and copies templates
  • build:web - Builds the documentation site
For incremental development, you can watch the CLI for changes:
yarn build:cli --watch
4

Link the CLI globally

To test the CLI as if it were installed globally, create a symlink:
cd apps/create-node-blueprint
npm link
This creates a global symlink, allowing you to run the CLI from anywhere:
create-node-blueprint --version
You should see your local development version number.
5

Verify installation

Test that everything is working:
# Run the CLI in interactive mode
create-node-blueprint

# Or create a test project
create-node-blueprint --name test-app --framework express --database postgres --orm drizzle

Development Workflow

Running the CLI in Development

You have several options for testing during development: The fastest way to test changes without rebuilding:
cd apps/create-node-blueprint
yarn dev
This runs the CLI using tsx which executes TypeScript directly. Rebuild and test the compiled version:
# From the root
yarn build:cli

# Then run the linked CLI
create-node-blueprint

Option 3: Watch Mode

Automatically rebuild on changes:
yarn build:cli --watch

Running the Docs Site

To work on the documentation site locally:
# From the root
yarn dev:web

# Or from the web directory
cd apps/web
yarn dev
The docs site will be available at http://localhost:5173 (or another port if 5173 is in use).

Available Scripts

From the root of the monorepo:
ScriptDescription
yarn dev:webStart the docs site in development mode
yarn dev:cliRun the CLI in development mode with tsx
yarn build:webBuild the docs site for production
yarn build:cliBuild the CLI package
yarn buildBuild all packages

Testing Your Changes

Always test template generation with multiple combinations before submitting a PR!
Test different combinations of:
  • Frameworks: Express, Fastify
  • Databases: MySQL, PostgreSQL, MongoDB
  • ORMs: Drizzle, Prisma, Mongoose
Example test commands:
# Test Express + PostgreSQL + Drizzle
create-node-blueprint --name test1 --framework express --database postgres --orm drizzle

# Test Fastify + MongoDB + Mongoose
create-node-blueprint --name test2 --framework fastify --database mongodb --orm mongoose

# Test interactive mode
create-node-blueprint

Unlinking the CLI

When you’re done with development, you can unlink the CLI:
cd apps/create-node-blueprint
npm unlink -g create-node-blueprint

Troubleshooting

Permission Errors

If you get permission errors when linking:
sudo npm link

CLI Not Found After Linking

Make sure your npm global bin directory is in your PATH:
npm config get prefix
Add the bin directory to your PATH if needed.

Changes Not Reflecting

If your changes aren’t showing up:
  1. Make sure you rebuilt the CLI: yarn build:cli
  2. Check you’re running the linked version: which create-node-blueprint
  3. Try unlinking and relinking

Next Steps

Monorepo Structure

Understand how the codebase is organized

Adding Templates

Learn how to add new framework, database, or ORM templates

Build docs developers (and LLMs) love