Skip to main content
Generates a controller class in the target module. It writes modules/<module>/src/controllers/<Name>Controller.ts and a mirrored modules/<module>/tests/controllers/<Name>Controller.spec.ts, registers the controller into the module’s controllers array, and installs the @ooneex/controller dependency when missing. It supports both HTTP and WebSocket (socket) controllers and configures the route name, path, and method.

Usage

ooneex controller:create [options]

Examples

Run with no flags to be prompted for the name, controller type, and route name, path, and method:
ooneex controller:create
Create an HTTP controller non-interactively:
ooneex controller:create --name=UserCreate --module=user --is-socket=false --route-name=user.create --route-path=/users --route-method=post
Create a socket controller:
ooneex controller:create --name=ChatMessage --module=chat --is-socket=true --route-name=chat.message --route-path=/chat

Options

OptionDescriptionDefault
--nameController name (normalized to PascalCase, the Controller suffix is appended).Prompted if omitted
--moduleTarget module.shared
--is-socketGenerate a WebSocket socket controller instead of an HTTP one.Prompted if omitted
--overrideOverwrite an existing controller file without confirmation.false
--route-nameRoute name in dot notation (e.g. user.create).Prompted if omitted
--route-pathRoute URL path (e.g. /users).Prompted if omitted (defaults to /)
--route-methodHTTP route method (HTTP controllers only).Prompted if omitted

AI Skill

This command ships a matching controller:create skill. The skill generates the controller class, route type, and test file, then completes the implementation — keeping the controller thin, wiring validation and role-based access, and refreshing any SDK that exposes the route. Your AI agent uses it when creating a new HTTP or WebSocket controller with routing, validation, and access control.
ooneex claude:init