node-ottoman
node-ottoman copied to clipboard
Create an Ottoman CLI
A CLI for Ottoman.js to improve developer experience. The CLI could handle:
- project scaffolding using ottoman using some templates for languages like js and ts also for frameworks like express, nest, feather, fastify, ...
- handle migrations and/or database structure update (this point is very important because we can get rip of the start function and avoid executing it every time the ottoman app start)
- create files like models and/or schema. (ottoman-cli create user -> generate userSchema and userModels classes files with minimal setup)
...many other features can be added to the CLI as well.
Requirements:
- Git repository
Result:
- A CLI application deployed on NPM (Node Package Manager Repository)
- A git repository with source code
- A readme file with instruction to install and usage.
Syntax:
-
ottoman-cli init
-
ottoman-cli init --output=ottoman
Commands:
-
init
: Initialize a new project using ottoman. The init command will use many templates for popular node solutions Templates: express, nestjs, typescript, only javascript, ... -
migrate
: Similar to the logic of the ottoman.start method, the migrate command will attempt to create scopes, collections, and indices defined in the models and schemas. (This approach to managing the creation of scopes, collections and indexes is better and should be the way to go, I suggest removing the start method in the future in favor of the CLI)