https://github.com/claquettes/pigeon
πͺΉ CLI tool to scan NestJS projects and import them into API clientsπ¦
https://github.com/claquettes/pigeon
api-mapper api-mapping insomnia insomnia-import nestjs postman
Last synced: 4 months ago
JSON representation
πͺΉ CLI tool to scan NestJS projects and import them into API clientsπ¦
- Host: GitHub
- URL: https://github.com/claquettes/pigeon
- Owner: Claquettes
- License: mit
- Created: 2025-01-27T12:26:51.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2025-01-28T21:41:26.000Z (4 months ago)
- Last Synced: 2025-01-28T22:28:24.104Z (4 months ago)
- Topics: api-mapper, api-mapping, insomnia, insomnia-import, nestjs, postman
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/pigeon-nest-mapper
- Size: 13.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π¦ Pigeon - NestJS Route Mapper CLI
Pigeon is a **CLI tool** that scans a NestJS project and **automatically maps all API routes** into an **Insomnia or Postman**-compatible **import file**. π
π **It recursively searches for controllers, extracts all endpoints**, and organizes them neatly into **Insomnia or Postman collections**.
π¦ **Available on NPM:** [Pigeon Nest Mapper on NPM](https://www.npmjs.com/package/pigeon-nest-mapper)
π **GitHub Repository:** [Pigeon on GitHub](https://github.com/Claquettes/pigeon)---
## **β¨ Features**
- π **Scans NestJS projects** to detect all `@Controller()` routes.
- π **Groups routes by controller** inside **Insomnia or Postman**.
- π **Recursively finds controllers** in the entire project.
- π **Exports to `insomnia.json` or `postman.json`** for easy import.
- π‘ **Simple CLI usage** with just one command.
- ποΈ **New:** Now you can choose between **Insomnia** (default) and **Postman**, or exit the CLI with "Quit Pigeon".---
## **π₯ Installation**
### **From NPM (Recommended)**
```sh
npm install -g pigeon-nest-mapper
```### **From Source**
1. Clone the repo:
```sh
git clone https://github.com/claquettes/pigeon.git
cd pigeon
```
2. Install dependencies:
```sh
npm install
```
3. Build & link:
```sh
npm run build
npm link
```---
## **π Usage**
Once installed globally, run:
```sh
pigeon /path/to/nestjs-project
```### **Example:**
```sh
pigeon /home/user/my-nest-app
```This will prompt:
```
πͺΉ Scanning NestJS project at: /home/user/my-nest-app π¦
Choose the export format:
β― Insomnia
Postman
ββββββββββ
Quit Pigeon
```- If you choose **Insomnia**, the output file will be **`insomnia.json`**.
- If you choose **Postman**, the output file will be **`postman.json`**.
- If you choose **Quit Pigeon**, the CLI will exit.After selecting a format:
```
π Scan Completed! Routes Found:
π Controller: AuthController
β‘οΈ POST /auth/register
β‘οΈ POST /auth/loginπ Controller: UserController
β‘οΈ GET /user/profile
β‘οΈ POST /user/moneyπ Insomnia import file generated at: /home/user/my-nest-app/insomnia.json
```Then, **import the generated file (`insomnia.json` or `postman.json`) into your API tool to test all routes instantly!** π
---
## **π¦ Dependencies**
Pigeon relies on:
- π **[`commander`](https://www.npmjs.com/package/commander)** - CLI command parsing.
- π **[`ts-morph`](https://www.npmjs.com/package/ts-morph)** - TypeScript AST parsing.
- π **[`fs-extra`](https://www.npmjs.com/package/fs-extra)** - File system utilities.
- π¨ **[`chalk`](https://www.npmjs.com/package/chalk)** - Colored terminal output.
- ποΈ **[`inquirer`](https://www.npmjs.com/package/inquirer)** - CLI user input handling.---
## **π Contributing**
- **Fork this repository**
- Create a feature branch (`git checkout -b feature-name`)
- Make your changes and commit (`git commit -m "Added cool feature"`)
- Push the branch (`git push origin feature-name`)
- Open a **Pull Request** π---
## **π License**
MIT Β© [Claquettes](https://github.com/Claquettes)