0.0.59 • Published 1 month ago

@enlythealth/enlyt v0.0.59

Weekly downloads
-
License
ISC
Repository
-
Last release
1 month ago

enlyt-cli

Purpose

The Enlyt CLI is a Command Line Interface tool built on top of Oclif (The Open CLI Foundation) framework and is used to streamline everything related to Enlyt Health Cloud Platform management & operation.

It provides the user with a set of easy-to-use commands.

The user can work with multiple tenants, multiple environments, easily switching between them back and forth, doing everything related to platform management, including (and not limited to):

What can you do with the Enlyt CLI?

  • Finding out if your environment has all the required dependencies
  • Configuring a tenant - reading & writing,
  • Developing your apps using your local machine - mobile & web
  • Building your apps locally - mobile & web
  • Managing and signing assets - Android & iOS
  • and a lot more ...

Techlogies & Frameworks

Note: you should have your own developer account on Apple, Google, and Firebase to be able to use all the features provided.

Installing the Enlyt CLI

To install the Enlyt CLI all you have to do is execute the following command in your terminal:

npm install -g @enlythealth/enlyt

Setting Up your Local Environment

Before being able to work with your web/mobile apps, you need to perform the following steps:

  • Install all required dependencies
  • Set up environment variables
  • Complete authentication on your tenant

Install Required Dependencies

To find out what dependencies are needed, run the command below:

enlyt doctor

This command will scan your settings in order to find out if you have everything required or if something is missing. In case something is missing, it will mark it with a red X.

Log into Your Tenant

enlyt login

In case you're logging in for the first time, you'll be asked for the Enlyt CLI Configuration URL and passphrase. This URL comes in a format similar to the Mission Control URL and that is:

  • https://api.{environment}.{tenantname}.app.enlythealth.com/cli

You will also be asked for a passphrase, which can also be found on Mission Control under /docs/lms/platform/cli. Once authenticated you can add your tenant's environment.

Environments

env: namespace.

The environment you want to work with is the first thing that has to be configured before using the Enlyt CLI tool.

The Enlyt Cloud platform provides a special configuration URL for each tenant that is used to configure the Enlyt CLI with a single command. The URL is structured as follows:

  • https://api.{environment}.{tenantname}.app.enlythealth.com/cli

env:add

Add a new environment (tenant:environment).

env:remove

Remove an existing environment (tenant:environment).

env:current

Print out what the current (selected) environment (tenant:environment) is.

env:switch

Switch between environments.

The typical scenario is when the user needs to switch between stage and prod environments or between different tenants.

env:clear

Remove ALL environments.

$ enlyt env:clear
Done!

Authentication

No namespace.

login

Login on currently selected environment.

whoami

Print out the currently logged-in user and what the current (selected) environment (tenant:environment) is.

logout

Log out from the currently selected environment.

$ enlyt logout
You've been successfully logged out.

Authentication

No namespace.

login

Authenticate against the currently selected environment.

whoami

Print out the currently logged-in user and what the current (selected) environment (tenant:environment) is.

logout

Logout from the currently selected environment.

$ enlyt logout
You've been successfully logged out.

Access

repo: namespace.

repo:get-access

Execute a set of commands in order to both download your apps' source code to your local machine and give you the required permissions so that you can commit and push them back to your tenant

$ enlyt repo:get-access
  ✔ Create new user
  ✔ Set permissions
  ✔ Generate SSH key
  ✔ Register SSH key
  ✔ Upload SSH key
  ✔ Configure locally
  ✔ Test access
  ✔ Done.

repo:clone

Clone your applications code to your local machine.

You can optionally specify the repository name:

Configuration

config: namespace.

config:get

enlyt config:get
? Variable: EH_APP_ (Use arrow keys or type to search)
  EH_APP_NAME
❯ EH_APP_IDENTIFIER_IOS
  EH_APP_IDENTIFIER_ANDROID
<RETURN>

Stage  Variable               Value
stage  EH_APP_IDENTIFIER_IOS  com.enlythealth.ios

# –or–

$ enlyt config:get EH_APP_IDENTIFIER_IOS

Stage  Variable               Value
stage  EH_APP_IDENTIFIER_IOS  com.enlythealth.ios

config:set

$ enlyt config:set
? Variable: EH_APP (Use arrow keys or type to search)
❯ EH_APP_NAME
<RETURN>
? Variable:  EH_APP_NAME
? Stage:  stage
? Value:  Enlyt Health # entered
<RETURN>

Stage  Variable     Old Value  New Value
stage  EH_APP_NAME  Enlyt      Enlyt Health

config:dotenv

A command that can be used to get the contents of the .env file.

$ enlyt config:dotenv
# prints whole contents of the .env file

config:cicd

A command that is auto-configured on CI/CD build machines to provide the configuration of the app(s) during the build process.

Bootstrapping

This command will execute several instructions to make the tenant ready to use. That includes installing necessary packages and creating iOS apps. Also, It is possible to pass the '--platform' flag to enable setup only 'ios' or 'android' builds.

$ enlyt bootstrap

Mobile Signing

signing: namespace. This namespace contains all commands needed to sign your mobile applications, both Android and iOS.

signing:android

Generate Android signing assets - keystore.jks file. When invoked from within the core-mobile directory, it will save the generated keystore.jks file inside the ./android/secure folder, which is out of version control and set up as the default location for the Android Keystore file.

$ enlyt signing:android

signing:ios

Generate iOS signing assets as well as creates the app(s) in Apple Developer Portal and AppStore Connect.

$ enlyt signing:ios

This command will guide the user through a series of questions, then it will connect through Apple's APIs to the Developer Portal & AppStore Connect, create everything required for the iOS apps to work and the resulting signing assets will be pushed to the Enlyt Cloud applecerts repo for use by other developers.

signing:sync-ios

Synchronize the iOS signing assets generated by the enlyt signing:ios command from the Enlyt Health Cloud applecerts repo to the local machine of the user that invoked the command.

$ enlyt signing:sync-ios

signing:sync-android

Synchronize the Android signing assets generated by the enlyt signing:android command cloud storage repo to the local machine of the user that invoked the command.

$ enlyt signing:sync-android

Mobile Builds

Mobile CLI is being used for running the builds locally and in the cloud, therefore the namespace for builds is called mobile.

mobile: namespace.

mobile:android

Invoke an Android build. Run this command from within the core-mobile directory to properly handle everything build-related.

$ enlyt mobile:android --workflow=deploy_beta_from_local
$ enlyt mobile:android --workflow=deploy_prod_from_local

mobile:ios

Invokes an iOS build. Run this command from within the core-mobile directory to properly handle everything build-related.

$ enlyt mobile:ios --workflow=deploy_beta_from_local
$ enlyt mobile:ios --workflow=deploy_prod_from_local

How to create a new command

In order to create a new command, you need to create subfolder inside the commands folder. As for the structure, you can copy the structure from any of the existing commands and adapt to your needs.

0.0.59

1 month ago

0.0.57

3 months ago

0.0.58

3 months ago

0.0.55

3 months ago

0.0.56

3 months ago

0.0.53

3 months ago

0.0.54

3 months ago

0.0.52

4 months ago

0.0.51

5 months ago

0.0.50

5 months ago

0.0.49

5 months ago

0.0.48

5 months ago

0.0.47

5 months ago

0.0.46

5 months ago

0.0.40

7 months ago

0.0.41

6 months ago

0.0.42

6 months ago

0.0.43

6 months ago

0.0.44

6 months ago

0.0.45

5 months ago

0.0.37

10 months ago

0.0.38

9 months ago

0.0.39

8 months ago

0.0.30

10 months ago

0.0.31

10 months ago

0.0.32

10 months ago

0.0.33

10 months ago

0.0.34

10 months ago

0.0.35

10 months ago

0.0.36

10 months ago

0.0.29

11 months ago

0.0.28

11 months ago

0.0.27

11 months ago

0.0.26

11 months ago

0.0.25

11 months ago

0.0.24

11 months ago

0.0.23

11 months ago

0.0.22

11 months ago

0.0.21

11 months ago

0.0.20

12 months ago

0.0.19

12 months ago

0.0.18

12 months ago

0.0.17

12 months ago

0.0.16

12 months ago

0.0.15

12 months ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago