npm package: @jnig/chili-api-cli
Description: api-cli =======
Author: Jakob Niggel @Jnig
Latest version: 3.0.19

api-cli
=======



[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
[![Version](https://img.shields.io/npm/v/api-cli.svg)](https://npmjs.org/package/api-cli)
[![Downloads/week](https://img.shields.io/npm/dw/api-cli.svg)](https://npmjs.org/package/api-cli)
[![License](https://img.shields.io/npm/l/api-cli.svg)](https://github.com/Jnig/api-cli/blob/master/package.json)

<!-- toc -->
* [Usage](#usage)
* [Commands](#commands)
* [api-cli](#api-cli)
<!-- tocstop -->
# Usage
<!-- usage -->
```sh-session
$ npm install -g @jnig/chili-api-cli
$ chili-api-cli COMMAND
running command...
$ chili-api-cli (-v|--version|version)
@jnig/chili-api-cli/3.0.19 linux-x64 node-v14.17.4
$ chili-api-cli --help [COMMAND]
USAGE
  $ chili-api-cli COMMAND
...
```
<!-- usagestop -->
# Commands
<!-- commands -->
* [`chili-api-cli create-api`](#chili-api-cli-create-api)
* [`chili-api-cli create-controller`](#chili-api-cli-create-controller)
* [`chili-api-cli create-migration [NAME]`](#chili-api-cli-create-migration-name)
* [`chili-api-cli create-routes [DIRECTORY]`](#chili-api-cli-create-routes-directory)
* [`chili-api-cli help [COMMAND]`](#chili-api-cli-help-command)

## `chili-api-cli create-api`

Create an typescript api client from an openapi json definition.

```
USAGE
  $ chili-api-cli create-api

OPTIONS
  -f, --file=file      Filepath for writing the generation api client. Should end with .ts
  -h, --help           show CLI help
  -s, --schema=schema  [default: ./openapi.json] path to openapi / swagger file e.g. openapi.json

EXAMPLE
  $ magana-api-cli -u
  hello world from ./src/hello.ts!
```

_See code: [src/commands/create-api.ts](https://github.com/Jnig/chili-api-cli/blob/v3.0.19/src/commands/create-api.ts)_

## `chili-api-cli create-controller`

Generate a new CRUD controller.

```
USAGE
  $ chili-api-cli create-controller

OPTIONS
  -h, --help       show CLI help
  --model=model    (required) model name e.g. User or UserToken
  --module=module  (required) module name e.g. core or auth

EXAMPLE
  $ api-cli hello
  hello world from ./src/hello.ts!
```

_See code: [src/commands/create-controller.ts](https://github.com/Jnig/chili-api-cli/blob/v3.0.19/src/commands/create-controller.ts)_

## `chili-api-cli create-migration [NAME]`

Create a new database migration file.

```
USAGE
  $ chili-api-cli create-migration [NAME]

OPTIONS
  -f, --force
  -h, --help       show CLI help
  -n, --name=name  name to print

EXAMPLE
  $ magana-api-cli create-migration add-table-users
  hello world from ./src/hello.ts!
```

_See code: [src/commands/create-migration.ts](https://github.com/Jnig/chili-api-cli/blob/v3.0.19/src/commands/create-migration.ts)_

## `chili-api-cli create-routes [DIRECTORY]`

Create route definitions from controllers

```
USAGE
  $ chili-api-cli create-routes [DIRECTORY]

OPTIONS
  -f, --force
  -h, --help       show CLI help
  -n, --name=name  name to print

EXAMPLE
  $ api-cli hello
  hello world from ./src/hello.ts!
```

_See code: [src/commands/create-routes.ts](https://github.com/Jnig/chili-api-cli/blob/v3.0.19/src/commands/create-routes.ts)_

## `chili-api-cli help [COMMAND]`

display help for chili-api-cli

```
USAGE
  $ chili-api-cli help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.1/src/commands/help.ts)_
<!-- commandsstop -->
# api-cli