Skip to content

Commit e3d3b26

Browse files
committed
adding reference for cli v3 and update readme
1 parent 1317202 commit e3d3b26

2 files changed

Lines changed: 1594 additions & 19 deletions

File tree

README.md

Lines changed: 83 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
[![License](https://img.shields.io/github/license/enapter/enapter-cli)](/LICENSE)
44
[![Release](https://img.shields.io/github/release/enapter/enapter-cli.svg)](https://github.com/enapter/enapter-cli/releases/latest)
55

6+
## Overview
7+
8+
The Enapter CLI is a command-line interface tool for managing Enapter services, including sites, devices, blueprints, and the rule engine. It provides a comprehensive set of commands for interacting with the Enapter Cloud platform and Gateway devices.
9+
10+
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).
611

7-
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).
812
It helpful in the following cases:
913

1014
1. Managing all your EMS setup as a code with Git and Ansible / Puppet
@@ -28,6 +32,22 @@ Version 3:
2832
brew tap enapter/tap && brew install enapter@3
2933
```
3034

35+
## How to upgrade
36+
37+
###  macOS - recommended
38+
39+
Version 1:
40+
41+
```bash
42+
brew upgrade enapter
43+
```
44+
45+
Version 3:
46+
47+
```bash
48+
brew upgrade enapter@3
49+
```
50+
3151
### Get prebuilt binaries
3252

3353
Choose your platform and required release on the [Releases page](https://github.com/Enapter/enapter-cli/releases).
@@ -59,43 +79,87 @@ Enapter CLI requires access token for authentication. Obtaining of the token is
5979
4. Follow the instructions on the screen
6080
<img src="./.assets/token.png">
6181

62-
5. Set environment variable `ENAPTER3_API_TOKEN` with new token. To make it permanent don't forget to add it to configuration files of your shell.
82+
5. Set environment variable `ENAPTER_API_TOKEN` with new token. To make it permanent don't forget to add it to configuration files of your shell.
6383

6484
```bash
65-
export ENAPTER3_API_TOKEN="your token"
85+
export ENAPTER_API_TOKEN="your token"
6686
```
6787

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

7090
## How to use Version 3:
7191

72-
### API token
92+
### Authentication
7393

74-
Enapter CLI requires access token for authentication. Obtaining of the token is easy and can be done by following few steps.
94+
The Enapter CLI requires an access token for authentication. You can obtain your access token from your Enapter Cloud account settings at [Enapter Cloud](https://cloud.enapter.com).
7595

76-
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)
77-
2. Enapter your Enapter Gateway password
78-
3. Click `API Token` and copy token to clipboard
79-
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.
96+
### Setting Up Your First Enapter Cloud Connection
8097

81-
```bash
82-
export ENAPTER3_API_TOKEN="your token"
83-
export ENAPTER3_API_URL="http://ip_address/api"
84-
export ENAPTER3_API_ALLOW_INSECURE=true
85-
```
98+
The recommended way to use the Enapter CLI is by setting up named connections. This approach allows you to:
99+
- Manage multiple environments (production, staging, development)
100+
- Switch between Enapter Cloud and Gateway connections easily
101+
- Associate connections with specific sites
102+
- Store configuration securely
86103

87-
5. Check connection works by running
104+
**Step 1: Add a connection**
88105

89-
```bash
90-
enapter3 device list
91-
```
106+
```bash
107+
enapter connection add --name my-cloud --token YOUR_ACCESS_TOKEN
108+
```
109+
110+
**Step 2: Set it as default (optional)**
111+
112+
```bash
113+
enapter connection set-default --name my-cloud
114+
```
115+
116+
**Step 3: Verify the connection**
117+
118+
```bash
119+
enapter connection list
120+
```
121+
122+
### Quick Start Examples
123+
124+
Once your connection is set up, you can start managing your Enapter resources:
125+
126+
**For Enapter Cloud connections:**
127+
128+
```bash
129+
# List all sites
130+
enapter site list
131+
132+
# List all devices for a specific site
133+
enapter device list --site-id SITE_ID
134+
135+
# Get device information
136+
enapter device get --site-id SITE_ID --device-id DEVICE_ID
137+
138+
# Upload a blueprint (from file or directory)
139+
enapter blueprint upload --path ./my-blueprint.enbp
140+
# or
141+
enapter blueprint upload --path ./my-blueprint/
142+
143+
# Create a new Lua device
144+
enapter device create lua-device \
145+
--site-id SITE_ID \
146+
--runtime-id UCM_DEVICE_ID \
147+
--device-name "My Device" \
148+
--device-slug my-device \
149+
--blueprint-path ./blueprint/ # or ./blueprint.enbp
150+
```
92151

93152
### Autocompletion in your favourite terminal app
94153

95154
> [!NOTE]
96155
> Available for Version 1 now.
156+
>
157+
> For Version 3. Please follow enapble `Dev mode` and use [https://github.com/nkrasko/autocomplete](https://github.com/nkrasko/autocomplete) repository until merge request is accepted.
97158
98-
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.
159+
In order to make life easier with command line interface, you may use [Kiro CLI](https://kiro.dev/cli/). This autocompletion tool has native support for the Enapter CLI for Mac OS X and Linux.
99160

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

163+
### Documentation
164+
165+
You can find extended documentation in [Enapter CLI 3 Referecnce](./enapter-cli-3-reference.md)

0 commit comments

Comments
 (0)