Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 54 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,30 @@
[![Release](https://img.shields.io/github/release/enapter/enapter-cli.svg)](https://github.com/enapter/enapter-cli/releases/latest)


This tool helps Enapter customers to work with devices. It useful in the following cases:
1. Develop devices via blueprints.
2. Update and monitor devices.
This tool helps Enapter customers to work with devices it is alternative for [Enapter IDE for EMS Toolkit 3.0](https://marketplace.visualstudio.com/items?itemName=Enapter.enapter-ems-toolkit-ide).
It helpful in the following cases:

1. Managing all your EMS setup as a code with Git and Ansible / Puppet
2. Establishing CI/CD workflow
3. Development and debugging of Enapter Blueprints
4. Development and debugging of Enapter Gateway Rules

## How to install

###  macOS - recommended

Version 1:

```bash
brew tap enapter/tap && brew install enapter
```

Version 3:

```bash
brew tap enapter/tap && brew install enapter@3
```

### Get prebuilt binaries

Choose your platform and required release on the [Releases page](https://github.com/Enapter/enapter-cli/releases).
Expand All @@ -32,7 +44,13 @@ Also you can pass custom output path:
./build.sh /usr/local/bin/enapter
```

## How to use
## How to use Version 1:

---
**NOTE**

Version 1 works only with Enapter Cloud connection.
---

### API token

Expand All @@ -52,8 +70,38 @@ Enapter CLI requires access token for authentication. Obtaining of the token is

Please note that if you don't save your token, it is not possible to reveal it anymore. You need generate new token.

## How to use Version 3:

### API token

Enapter CLI requires access token for authentication. Obtaining of the token is easy and can be done by following few steps.

1. Navigate to your Enapter Gateway 3.0 Web Interface `Settings` page by using IP address or mDNS name [http://enapter-gateway.local/settings](https://enapter-gateway.local/settings)
2. Enapter your Enapter Gateway password
3. Click `API Token` and copy token to clipboard
4. Set environment variables `ENAPTER3_API_TOKEN`, `ENAPTER3_API_URL` and `ENAPTER3_API_ALLOW_INSECURE`. To make it permanent don't forget to add it to configuration files of your shell.

```bash
export ENAPTER3_API_TOKEN="your token"
export ENAPTER3_API_URL="http://ip_address/api"
export ENAPTER3_API_ALLOW_INSECURE=true
```

5. Check connection works by running

```bash
enapter3 device list
```

### Autocompletion in your favourite terminal app

In order to make life easier with command line interface, you may use [Fig - the next-generation command line](https://fig.io/). This autocompletion tool has native support for the Enapter CLI for Mac OS X and Linux.
---
**NOTE**

Available for Version 1 now.
---

In order to make life easier with command line interface, you may use [Amazon Q](https://aws.amazon.com/q/). This autocompletion tool has native support for the Enapter CLI for Mac OS X and Linux.

<img src="./.assets/enapter-cli-fig-integration.gif">

<img src="./.assets/enapter-cli-fig-integration.gif">
Loading