DEV Community

Deepak Ashok Karai
Deepak Ashok Karai

Posted on

API Route Lister - The Ultimate CLI Tool for Discovering API Routes

Ever wondered how many API endpoints your application has? I built a CLI tool that scans your source code and lists all your routes - with code preview, search, and filtering!

🚀 What is API Route Lister?

API Route Lister is a command-line tool that automatically scans your codebase and discovers all API endpoints. It supports multiple frameworks including Express, Fastify, Next.js, Hapi, and Koa.

Key Features

  • 🔍 Auto-Detection - Automatically detects your framework
  • 💻 Code Preview - View endpoint code directly in CLI
  • 🎮 Interactive Mode - Browse with keyboard navigation
  • 🔎 Search & Filter - Find routes by path or HTTP method
  • 📊 Multiple Views - Table, List, or Tree format
  • 📤 Export - JSON and Markdown output

📦 Installation

npm install -g api-route-lister
Enter fullscreen mode Exit fullscreen mode

🚀 Quick Start

api-route-lister ./src
api-route-lister ./src -i
api-route-lister ./src -o tree -c
Enter fullscreen mode Exit fullscreen mode

🎮 Interactive Mode Controls

[j] Next  [k] Prev  [v] View Code  [g] Go To  [/] Search  [f] Filter  [r] Reset  [q] Quit
Enter fullscreen mode Exit fullscreen mode

Quick Commands

  • g 50 - Go to route #50
  • / users - Search for users
  • f GET - Filter GET routes only
  • v - View selected route code

📋 Options

Option Description
-f, --framework Framework (auto, express, fastify, nextjs, hapi, koa)
-o, --output Output format (table, list, tree)
-c, --code Show endpoint code
-i, --interactive Interactive TUI mode
--json Output as JSON
-m, --markdown Output as Markdown

Get It Now

npm install -g api-route-lister
Enter fullscreen mode Exit fullscreen mode

npm | GitHub


Built with ❤️ by Deepak Ashok Karai

Top comments (0)