# 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.

Latest version **1.0.0-beta.3** (published 2023-03-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install ottoman-cli
pnpm add ottoman-cli
yarn add ottoman-cli
bun add ottoman-cli
```

Provides the command `ottoman-cli`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-beta.3 |
| Published | 2023-03-27 |
| First published | 2023-03-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 60.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ejscribner_cb |

## Links

- npm: https://www.npmjs.com/package/ottoman-cli
- npm.io page: https://npm.io/package/ottoman-cli

## Dependencies (11)

- [esm](https://npm.io/package/esm.md) ^3.2.25
- [ncp](https://npm.io/package/ncp.md) ^2.0.0
- [ora](https://npm.io/package/ora.md) ^4.0.5
- [glob](https://npm.io/package/glob.md) ^9.3.1
- [dotenv](https://npm.io/package/dotenv.md) ^16.0.3
- [figlet](https://npm.io/package/figlet.md) ^1.5.2
- [ottoman](https://npm.io/package/ottoman.md) ^2.3.2
- [shelljs](https://npm.io/package/shelljs.md) ^0.8.5
- [inquirer](https://npm.io/package/inquirer.md) ^8.0.0
- [commander](https://npm.io/package/commander.md) ^10.0.0
- [pkg-install](https://npm.io/package/pkg-install.md) ^1.0.0

## Recent versions

- 1.0.0-beta.3 (latest) — 2023-03-27
- 1.0.0-beta.2 — 2023-03-24
- 1.0.0-beta.1 — 2023-03-24

## 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:
```shell
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

```shell
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:
1. You should build your app before run the `migrate` command
```shell
npm run build
ottoman-cli migrate
```
2. env variables should point to the built code

Correct
```dotenv
OTTOMAN_CLI_MODEL_PATTERN="dist/**/*.model.js"
```
Incorrect
```dotenv
OTTOMAN_CLI_MODEL_PATTERN="src/**/*.model.ts"
```
3. OTTOMAN_CLI_ENTRY="dist/config/ottoman.js" entry point file should export an `ottoman` instance
```ts
import { Ottoman } from "ottoman";

const ottoman = new Ottoman(...);

export { ottoman };
```

---
_Source: https://npm.io/package/ottoman-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
