middlewares array of the module. It writes modules/<module>/src/middlewares/<Name>Middleware.ts and modules/<module>/tests/middlewares/<Name>Middleware.spec.ts, and installs the @ooneex/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
| Option | Description | Default |
|---|---|---|
--name | Resource name (the Middleware suffix is appended automatically). | Prompted if omitted |
--module | Target module. | shared |
--is-socket | Generate a socket middleware instead of an HTTP one. | Prompted if omitted |
--override | Overwrite an existing file without confirmation. | false |
AI Skill
This command ships a matchingmiddleware:create skill. Your AI agent uses it to generate a new HTTP or WebSocket middleware class and its test file, then implement the handler logic for the IMiddleware interface from @ooneex/middleware.
- Claude
- Codex