What is @tsoa/cli?
@tsoa/cli is a command-line interface for the TSOA framework, which is used to generate TypeScript-based REST APIs with OpenAPI documentation. It helps in creating controllers, models, and routes, and also generates OpenAPI specifications from TypeScript code.
What are @tsoa/cli's main functionalities?
Generate OpenAPI Specification
This command generates the OpenAPI specification (swagger.json) from your TypeScript code. It scans your controllers and models to create a comprehensive API documentation.
tsoa spec
Generate Routes
This command generates the routes for your API based on the controllers defined in your TypeScript code. It creates a routes file that can be used to set up your API endpoints.
tsoa routes
Watch Mode
This command runs both the 'spec' and 'routes' commands in watch mode. It automatically regenerates the OpenAPI specification and routes whenever there are changes in your TypeScript files.
tsoa spec-and-routes --watch
Other packages similar to @tsoa/cli
swagger-jsdoc
swagger-jsdoc is a package that allows you to integrate JSDoc comments in your JavaScript code to generate OpenAPI (Swagger) documentation. Unlike @tsoa/cli, which is TypeScript-focused, swagger-jsdoc is more suited for JavaScript projects.
express-openapi
express-openapi is a package that helps you build APIs with OpenAPI documentation in an Express.js environment. It provides a way to define your API using OpenAPI definitions and automatically generates routes. It is similar to @tsoa/cli but is more focused on Express.js and JavaScript.