Skip to main content
Generate a middleware class with its test file in the target module and register the class in the module’s middlewares array. It writes modules/<module>/src/middlewares/<Name>Middleware.ts and modules/<module>/tests/middlewares/<Name>Middleware.spec.ts, installing the @talosjs/middleware dependency if it is missing. Pass --is-socket to generate a WebSocket middleware instead of an HTTP one; if omitted, you are asked interactively.

Usage

Examples

Options

AI Skill

This command ships a matching middleware:create skill. Your AI agent uses it to generate the HTTP or WebSocket middleware class and its test file, then implement the handler logic for the IMiddleware interface from @talosjs/middleware.