ottoman-cli
v1.0.0-beta.3
Published
## Goals: - Provide some useful tools while working with Ottoman. - Speed up the Ottoman setup process. - Help to keep database sync easily in Development and Production environments. - Automate Ottoman's process.
Downloads
4
Readme
Ottoman CLI
Goals:
- Provide some useful tools while working with Ottoman.
- Speed up the Ottoman setup process.
- Help to keep database sync easily in Development and Production environments.
- Automate Ottoman's process.
Install
npm install -g ottoman-cli
Usage:
ottoman-cli generate
Commands:
generate
migrate
Generate command
Ottoman CLI generate
command will create an Ottoman app for you in no time,
just follow the available steps in the wizard. Happy Coding!
Migrate command
ottoman-cli migrate
Ottoman CLI migrate
command will sync your database with the information took from your models.
Scopes, Collections and Indexes will be created automatically after run the migrate
command.
Constraints:
- You should build your app before run the
migrate
command
npm run build
ottoman-cli migrate
- env variables should point to the built code
Correct
OTTOMAN_CLI_MODEL_PATTERN="dist/**/*.model.js"
Incorrect
OTTOMAN_CLI_MODEL_PATTERN="src/**/*.model.ts"
- OTTOMAN_CLI_ENTRY="dist/config/ottoman.js" entry point file should export an
ottoman
instance
import { Ottoman } from "ottoman";
const ottoman = new Ottoman(...);
export { ottoman };