1.0.3 โข Published 6 months ago
@aminilo/pgi v1.0.3
๐ฆ 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
dependenciesanddevDependencies) - ๐ TypeScript types included automatically (e.g.,
@types/express) - ๐ One-liner install command can be copied to clipboard
- ๐ฆข Optional Git setup and
.gitignoregeneration - ๐งช 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
typerutility (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
- Run the CLI:
npx pgi iSearch & select packages to install
Choose options:
--copyor-c: Copy the command to clipboard--gitor-g: Setup git & generate.gitignore
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. Prismanpm init -y && npx tsc --init && npm i -D prisma ts-node typescript @types/{dotenv,express,node} && npm i @prisma/client dotenv expressTip: Use
--copyto 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
--copyto copy install command. - Run with
--gitto 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!