# weblab-cli

> Command line tool to manage weblab.io micro services

Latest version **1.1.0** (published 2016-12-20) · MIT license · 0 weekly downloads

## Install

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

Provides the commands `wl`, `weblab`.

## 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.1.0 |
| Published | 2016-12-20 |
| First published | 2016-12-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Known vulnerabilities | 0 (+7 in 4 direct dependencies) |
| Install scripts | no |
| Author | Cristian Guraliuc |
| Maintainers | cguraliuc |
| Keywords | weblab, serverless, microservice, microservices, micro service, cli, scaling, realtime, service, aws, amazon, lambda, aws lambda, swagger |

## Links

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

## Dependencies (10)

- [read](https://npm.io/package/read.md) 1.0.7
- [chalk](https://npm.io/package/chalk.md) 1.1.3
- [express](https://npm.io/package/express.md) 4.14.0
- [archiver](https://npm.io/package/archiver.md) 1.3.0
- [glob-all](https://npm.io/package/glob-all.md) 3.1.0
- [commander](https://npm.io/package/commander.md) 2.9.0
- [superagent](https://npm.io/package/superagent.md) 3.3.0
- [body-parser](https://npm.io/package/body-parser.md) 1.15.2
- [lodash.merge](https://npm.io/package/lodash.merge.md) 4.6.0
- [lodash.padend](https://npm.io/package/lodash.padend.md) 4.4.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2016-12-20
- 1.0.1 — 2016-12-16
- 1.0.0 — 2016-12-16

## README

# Weblab CLI

**[Weblab](https://weblab.io)** – Build applications comprised of microservices that run forever, self-heal and scale as needed. Building scalable fault-tolerant systems has never been easier.

The **Weblab CLI** it's a command-line tool to interact with [Weblab](https://weblab.io/) for developing and deploying your serverless microservice architecture.

## Contents

*   [Quick Start](#quick-start)
*   [Examples](#examples)
*   [Upcoming Features](#features)
*   [Development](#development)

## <a name="quick-start"></a>Quick Start

Follow the steps below to create and deploy your first serverless microservice in seconds.

1.  **Install via npm:**

    ```
    $ npm install -g weblab-cli
    ```

2.  **Set-up your credentials**

    ```
    $ weblab register

      Setup your Weblab Account
      -------------------------
    > Email: cristi@weblab.io
    > Username: (cristi)
    > Password: ***********

      Success: User registration complete.
    ```

    or if you already have a Weblab account just sign in with your credentials

    ```
    $ weblab login
    ```

3.  **Deploy a service**

    In your Weblab microservice folder just run

    ```
    $ cd µservice
    $ wl deploy

      Service:
        hello-world-1.0.0

      Enpoints:
        GET - https://weblab.io/api/v1/run/cristi/hello-world-1.0.0/

      Uploading: ...
        success

    ```

4.  **List your services**

    ```
    $ wl ls

    CONTAINER      | MICROSERVICE           | STATE      | STATUS    
    3a377aea233d   | hello-world-1.0.0      | running    | Up 2 hours
    3a48678fce52   | hal-1.0.0              | running    | Up 2 hours
    8bd1f4577575   | container-events-0.0.2 | running    | Up 3 weeks
    1c260895c73e   | weblab-fb-bot-1.0.0    | running    | Up 11 weeks

    ```

5.  **Inspect logs**

    ```
    $ wl logs <container-id>
    ```

6.  **Remove a container**

    ```
    $ wl rm <container-id>
    ```

7.  **Scale your microservice**

    ```
    $ wl deploy -s 2

      Service:
        hello-world-1.0.0
      Scale:
        2 workers

      Enpoints:
        GET - https://weblab.io/api/v1/run/cristi/hello-world-1.0.0/

      Uploading: ...
        success

    $ wl ls

      CONTAINER      | MICROSERVICE           | STATE      | STATUS    
      ca5785b7aff2   | hello-world-1.0.0      | running    | Up 4 seconds
      6b0c33c7f206   | hello-world-1.0.0      | running    | Up 4 seconds
      3a48678fce52   | hal-1.0.0              | running    | Up 3 hours
      8bd1f4577575   | container-events-0.0.2 | running    | Up 3 weeks
      1c260895c73e   | weblab-fb-bot-1.0.0    | running    | Up 11 weeks

    ```

8.  **Run your microservice on your local machine**

    ```
    $ wl local

      Service:
        hello-world-1.0.0

      Endpoints:
        GET - http://localhost:8991/

      Server:
        Started on port 8991

    ```

    Useful if you want to test your microservice localy before deploying to Weblab.


## <a name="examples"></a>Examples

### Hello World

*package.json*
```
{
  "name": "hello-world",
  "version": "1.0.0",
  "main": "index.js"
}
```

*index.js*
```
module.exports = function (req, res) {
  res.send('Hello, world!')
}
```


## <a name="features"></a>Upcoming Features

1.  **Realtime log streaming** (scheduled for January 2017)

    ```
    $ wl logs -f <container-id>
    ```

2.  **Remote debugging** (scheduled for February 2017)

    Use your favorite IDE (WebStorm / VS Code / etc.) to remote debug your microservice.


## <a name="development"></a>Development

### Tests

```
$ npm test
```

#### Linter

We're using [ESLint](http://eslint.org/) with [Standard](https://github.com/feross/eslint-config-standard) config

[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](http://standardjs.com)

```
$ npm run lint
```

#### Unit tests

```
$ npm run unit
```

### Git Hooks

-   **pre-commit** hook to run *linter* before every commit

To install it just run in the **project root directory**:

```
$ ./tools/hooks/install.sh
```

If you want to skip the tests when you make a push just use the `--no-verify` flag. Example:

```
$ git commit --no-verify <remote> <branch>
```

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