1.0.3 โ€ข Published 6 months ago

@aminilo/pgi v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

๐Ÿ“ฆ pgi

A simple & interactive CLI tool to initialize a NodeJS project and install your favorite packages in seconds.
Built with TypeScript, Yargs, and Inquirer, it's designed to be fast, simple, and developer-friendly.


๐Ÿš€ Features

  • ๐Ÿ” Fuzzy-searchable package selection UI (powered by inquirer-search-checkbox)
  • โš™๏ธ Auto-installation of selected packages (supports dependencies and devDependencies)
  • ๐Ÿ“Œ TypeScript types included automatically (e.g., @types/express)
  • ๐Ÿ“‹ One-liner install command can be copied to clipboard
  • ๐Ÿฆข Optional Git setup and .gitignore generation
  • ๐Ÿงช Including CLI tests
  • ๐Ÿ’– Fully written in TypeScript

๐Ÿ›  Tech Stack

  • Language: TypeScript
  • CLI Engine: Yargs
  • Interactive Prompts: Inquirer + inquirer-search-checkbox
  • Clipboard Integration: clipboardy
  • Terminal Styling: chalk
  • Typing Effect: custom typer utility (simulated typing in terminal)

๐Ÿคฉ Available Packages

The following categories of packages are available to choose from:

โš™๏ธ Dev Tools

  • TypeScript (& ts-node, @types/node)
  • Nodemon, ESLint, Prettier
  • Husky, lint-staged, cross-env
  • concurrently, tsconfig-paths

๐Ÿงช Testing

  • Jest, Vitest, Supertest, Superagent

๐Ÿ”ฅ Server

  • Express, express-validator, express-rate-limit
  • CORS, Compression, Helmet, HPP, Morgan, cookie-parser

๐Ÿ” Authentication

  • Bcrypt, JSON Web Token (JWT), Passport, Passport JWT

๐Ÿ“ฆ Common Libraries

  • Yargs, dotenv, uuid, validator, zod, class-validator, dayjs

๐Ÿ“ฌ Communication

  • Nodemailer

โšก Real-time

  • Socket.IO, socket.io-client

๐Ÿ—ƒ๏ธ Database / ORM

  • MySql, PostgreSQL, Redis
  • Prisma, Mongoose, TypeORM

๐Ÿ”— Networking

  • Axios, formidable

๐Ÿงฐ Utilities

  • fs-extra, Multer, rimraf

๐Ÿ“š Documentation

  • Swagger (swagger-jsdoc + swagger-ui-express)

๐Ÿ“ฆ How it Works

  1. Run the CLI:
npx pgi i
  1. Search & select packages to install

  2. Choose options:

    • --copy or -c: Copy the command to clipboard
    • --git or -g: Setup git & generate .gitignore
  3. Let pgi handle the rest!


๐Ÿ”ข Example Output

? Select packages (type to search): (Press <space> to select, <enter> to submit.)
 โ—ฏ TypeScript
 โ—ฏ Express
 โ—ฏ dotenv
 โ—ฏ Prisma
(Move up and down to reveal more choices)
 ๐Ÿ“ฆ Installing 4 packages:
 1. TypeScript
 2. Express
 3. dotenv
 4. Prisma
npm init -y && npx tsc --init && npm i -D prisma ts-node typescript @types/{dotenv,express,node} && npm i @prisma/client dotenv express

Tip: Use --copy to copy this entire command to clipboard & run it with a single paste.


๐Ÿงช Run CLI Tests

To test the PackageFactory & CLI handler command logic:

npm test

๐Ÿ“ Project Structure

src/
โ”œโ”€โ”€ commands/
โ”‚   โ””โ”€โ”€ install.ts
โ”‚   โ””โ”€โ”€ installCommandHandler.ts
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ install.test.ts
โ”‚   โ””โ”€โ”€ PackageFactory.test.ts
โ”œโ”€โ”€ types/
โ”‚   โ””โ”€โ”€ index.d.ts
โ”‚   โ””โ”€โ”€ inquirer-search-checkbox.d.ts
โ”œโ”€โ”€ utils/
โ”‚   โ”œโ”€โ”€ PackageFactory.ts
โ”‚   โ””โ”€โ”€ typer.ts

๐Ÿš€ Usage Tips

  • Run with --copy to copy install command.
  • Run with --git to set up git + .gitignore in the same command.
  • Combine both for an instant project bootstrap command.

Made with ๐Ÿ’– by a fellow developer.

Still in early development. Feel free to suggest improvements!


1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago