Endpoint Scaffolding

CLI command to generate all files for a new endpoint

Info:

Coming Soon - This feature is planned for a future release and is not yet available.

Command

onion-cli generate endpoint users/get-user --method GET --path /users/:userId

Generated Files

presentation/http/users/get-user/
├── endpoint.metadata.ts
├── request.dto.ts
├── response.dto.ts
├── access-guard.ts
├── to-use-case.mapper.ts
└── to-response.mapper.ts

Plus stubs in the BC:

app/ports/inbound/get-user.query.inbound.ts
app/use-cases/queries/get-user.query.ts

Options

FlagDescription
--methodHTTP method (GET, POST, etc.)
--pathURL path with params
--bcTarget bounded context
--orchestrationCreate as composition/workflow instead