1.1.1 โ€ข Published 6 months ago

pigeon-nest-mapper v1.1.1

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

๐Ÿฆ 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 ๐Ÿ” GitHub Repository: Pigeon on GitHub


โœจ 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)

npm install -g pigeon-nest-mapper

From Source

  1. Clone the repo:
    git clone https://github.com/claquettes/pigeon.git
    cd pigeon
  2. Install dependencies:
    npm install
  3. Build & link:
    npm run build
    npm link

๐Ÿš€ Usage

Once installed globally, run:

pigeon /path/to/nestjs-project

Example:

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 - CLI command parsing.
  • ๐Ÿ— ts-morph - TypeScript AST parsing.
  • ๐Ÿ—‚ fs-extra - File system utilities.
  • ๐ŸŽจ chalk - Colored terminal output.
  • ๐ŸŽ›๏ธ 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

1.1.1

6 months ago

1.1.0

6 months ago

1.0.2

6 months ago

1.0.0

6 months ago