@enlythealth/enlyt
TypeScript icon, indicating that this package has built-in type declarations

0.0.62 • Public • Published

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).

$ enlyt env:add
? Enter Enlyt CLI Configuration URL:  https://api.{environment}.{tenantname}.app.enlythealth.com/cli
? Enter Enlyt CLI Configuration Passphrase: {passphrase found on Mission Control}

env:remove

Remove an existing environment (tenant:environment).

    $ enlyt env:remove
    ? env:
      {tenantname}:prod
      {tenantname}:stage
    ❯ {tenantname}:dev
(Move up and down to reveal more choices) 
? env: {tenantname}:dev Environment {tenantname}:dev was removed.

env:current

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

$ enlyt env:current
Current environment is {tenantname}:{environment}.

env:switch

Switch between environments.

$ enlyt env:switch
? env:
  {tenantname}:prod
❯ {tenantname}:stage
  {tenantname}:dev
(Move up and down to reveal more choices)

? env: {tenantname}:stage
Switched to {tenantname}:stage.

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.

$ enlyt login
Login
? Enter your username: {email}
? Enter your password: **************
? Enter MFA verification code (from SMS): {verification code}
You're logged in!

whoami

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

$ enlyt whoami
You're logged in as {email}.
Current environment is {tenantname}:{environment}.

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.

$ enlyt login
Login
? Enter your username: {email}
? Enter your password: **************
? Enter MFA verification code (from SMS): {verification code}
You're logged in!

whoami

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

$ enlyt whoami
You're logged in as {email}.
Current environment is {tenantname}:{environment}.

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.

enlyt repo:clone
Tenant: {tenantname}, Environment: stage, CI: N.
Cloning into 'monorepo'...
...
Branch 'stage' set up to track remote branch 'stage' from 'origin'.
Switched to a new branch 'stage'

You can optionally specify the repository name:

enlyt repo:clone applecerts
Tenant: {tenantname}, Environment: stage, CI: N.
Cloning into 'applecerts'...

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 2 optional flags:

  • The '--platform' flag to enable setup only 'ios' or 'android' builds.
  • The '--stages' flag to generate only the 'debug' or only the 'beta' apps.
$ 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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.6241latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.6241
0.0.610
0.0.604
0.0.590
0.0.580
0.0.570
0.0.560
0.0.550
0.0.540
0.0.530
0.0.520
0.0.511
0.0.500
0.0.490
0.0.480
0.0.470
0.0.460
0.0.450
0.0.440
0.0.430
0.0.420
0.0.410
0.0.400
0.0.390
0.0.380
0.0.371
0.0.360
0.0.350
0.0.340
0.0.330
0.0.321
0.0.310
0.0.300
0.0.290
0.0.280
0.0.270
0.0.260
0.0.250
0.0.240
0.0.230
0.0.220
0.0.210
0.0.200
0.0.190
0.0.180
0.0.170
0.0.160
0.0.150
0.0.140
0.0.130
0.0.120
0.0.110
0.0.100
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i @enlythealth/enlyt

Weekly Downloads

48

Version

0.0.62

License

ISC

Unpacked Size

163 kB

Total Files

143

Last publish

Collaborators

  • asilva_trifinlabs
  • dvoronin.trifin
  • jcalhoun-trifin
  • rsarabu
  • alexandra_poltaeva
  • sfielder