A CLI tool to scaffold new projects with customizable templates.
$ create-project my-app -y
Create Project
Scaffold a new project in seconds
Project configuration:
- Name: my-app
- Author: Anonymous
- License: MIT
- Template: JavaScript
✔ Project created successfully!
This CLI tool automates project scaffolding, similar to create-react-app. It demonstrates understanding of file systems, templating, and developer workflows.
- Interactive Prompts - Guided setup asking for project name, author, and license
- Dynamic Templating - Generates README.md, package.json, and source files based on your input
- TypeScript Support - Use
--typescriptflag to generate TypeScript projects - Skip Prompts - Use
-yflag to scaffold with defaults instantly - Colored Output - Clear, readable terminal output with progress indicators
- Validation - Validates project names for npm compatibility
# Clone the repository
git clone <repository-url>
cd CLI_Tool
# Install dependencies
npm install
# Link globally (optional)
npm link# Run with npx
npx create-project
# Or if linked globally
create-projectYou'll be prompted for:
- Project name
- Author name
- License type
- TypeScript preference
# Create a project with a specific name
create-project my-awesome-app
# Skip all prompts with defaults
create-project my-app -y
# Create a TypeScript project
create-project my-ts-app --typescript
# Combine flags
create-project my-app -y --typescript
# Specify author and license
create-project my-app --author "John Doe" --license MIT| Option | Alias | Description |
|---|---|---|
--yes |
-y |
Skip prompts and use default values |
--typescript |
-t |
Generate TypeScript project |
--author <name> |
-a |
Set author name |
--license <type> |
-l |
Set license (MIT, ISC, Apache-2.0, GPL-3.0) |
--version |
-V |
Display version number |
--help |
-h |
Display help information |
my-project/
├── src/
│ ├── index.js # Main entry point
│ └── styles.css # Stylesheet
├── index.html # HTML template
├── package.json # Project configuration
├── .gitignore # Git ignore rules
└── README.md # Project documentation
my-project/
├── src/
│ ├── index.ts # Main entry point
│ └── styles.css # Stylesheet
├── index.html # HTML template
├── package.json # Project configuration
├── tsconfig.json # TypeScript configuration
├── .gitignore # Git ignore rules
└── README.md # Project documentation
# Fastest way to scaffold a project
create-project my-app -y
cd my-app
npm install
npm startcreate-project my-ts-app --typescript --author "Jane Doe" --license MIT
cd my-ts-app
npm install
npm run build
npm start# Run the CLI locally
npm start
# Or directly
node src/index.js my-test-project
# Test with TypeScript flag
node src/index.js my-test-project --typescript -y- Commander.js - CLI argument parsing
- Inquirer.js - Interactive prompts
- Chalk - Terminal styling
- Ora - Elegant spinners
- fs-extra - Enhanced file system operations
Building a CLI tool demonstrates:
- Developer Experience Mindset - Understanding what makes tools pleasant to use
- File System Operations - Working with directories, files, and paths
- Template Generation - Dynamic content creation based on user input
- Argument Parsing - Professional flag and option handling
- User Interaction - Interactive prompts with validation
- Error Handling - Graceful failures with helpful messages
MIT