1.0.0-beta.3 • Published 3 years ago
ottoman-cli v1.0.0-beta.3
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 generateCommands:
generatemigrate
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 migrateOttoman 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:
1. 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
ottomaninstance
import { Ottoman } from "ottoman";
const ottoman = new Ottoman(...);
export { ottoman };