Ottoman CLI
Goals:
- Provide some useful tools while working with Ottoman.
- Speed up the Ottoman setup process.
- Help keep databases in sync across Development and Production environments.
- Automate Ottoman's setup process.
Install
npm install -g ottoman-cli
Usage:
ottoman-cli generate
or
npx ottoman-cli generate <do not required previous installation>
Commands:
generatemigrate
Generate command
The Ottoman CLI's generate command will bootstrap an Ottoman app for you in no time!
Simply follow the steps in the wizard. Happy Coding!
ottoman-cli generate

Migrate command
ottoman-cli migrate
The Ottoman CLI's 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
migratecommand
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 };