# gig-cli

Gig CLI creates a command called `gig` which allows you to `init`, `generate`, and `deploy` applications.

## Commands

Command    | Description
-----------|------------
`config`   | Prompts the user to configure the CLI.
`deploy`   | Deploys a gig to an environment.
`init`     | Initializes a project config in the current directory.
`generate` | Generates a project from a configuration.
`login`    | Logs user into their Gigster account.
`update`   | Checks if there is an update for the CLI and installs it.

### `config`

Usage:

```shell
$ gig config
```

Options:
  * `--only-new` (default false): When provided, will only prompt the user for new entries in the config.

Examples:

```shell
$ gig config
? autoupdate: true
? packageManager: yarn
? gitProtocol: ssh
Successfully updated the global config.

$ gig config --only-new
```

### `deploy`

To deploy a service, just specify the service name and environment.  For example:
``` shell
$ gig deploy api staging
```

You will be expected to have a Dockerfile in the root directory.  To create a simple one, in the project folder, run:
```shell
$ echo "FROM nginx:1.13.5-alpine" > ./Dockerfile
```

### `init`

Initializes a project `config` in the current directory.

Usage:

```shell
$ gig init
```

Examples:

```shell
# Initializes a project with the latest `blank` template.
$ gig init
```

### `generate`

Generates either an entire project or a specific block.

Usage:

```shell
$ gig generate <block>
```

Options:
  * `block` (optional): When provided, will generate only a specific block. Otherwise, it generates the entire project.

Examples:

```shell
# Generates the entire project.
$ gig generate

# Generates only the `api` block.
$ gig generate api

# Generates only the `deployment`.
$ gig generate deployment
```

### `login`

Prompts user for Gigster credentials and logs them into their Gigster account.

Usage:

```shell
$ gig login
```

Examples:

```shell
$ gig login
? email: example@gigster.com
? password: [hidden]
Successfully logged in as example@gigster.com
```

### `update`

Usage:

```shell
$ gig update
```
