An open API service indexing awesome lists of open source software.

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🐦

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)