Command Line Interface (CLI)

The Cloud App Command Line Interface (CLI) is the tool used to create, develop, and build Cloud Apps. For information on installing the CLI, see the Getting Started guide.

Once the CLI is installed, you can type the command eca in your terminal or command prompt. The CLI will print a list of available commands. Each command can be run by typing eca <command name>, i.e. eca init.

$ eca

Available Commands

  init                 Initialize current directory
  start                Install dependencies, configure and start development server
                          --no-install : Do not install dependencies
                          --no-open-browser : Do not open browser after starting
  generate             Generate code in an initialized project
  extract-labels       Extract labels into json files for translation
  build                Build production-ready assets for app
  help                 Display this list of available commands

 

init

The init command creates a new Cloud App or initializes one which has be cloned from another repository.

New Cloud App

To create a new Cloud App, create a new directory and change into that directory. Then run the eca init command and follow the prompts.

$ mkdir my-new-app
$ cd my-new-app
$ eca init

Initialize an existing app

To initialize a Cloud App that you have cloned from another repository, run the eca init command in the root repository’s directory. Then follow the prompts.

$ git clone https://github.com/exlibrisgroup/cloudapp-tutorials
Cloning into 'cloudapp-tutorials'...

$ cd cloudapp-tutorials
$ eca init

Existing app detected. 
✔ Do you want to reconfigure this existing app? … yes

start

The start command is used to launch the local development server. The local development server allows you to develop your Cloud App using your sandbox (or production) Alma instance while the Cloud App code runs locally. The start command installs dependencies and then wraps the ng serve command from the Angular CLI.

The start command supports two flags:

  • --no-install: Do not install/update dependencies
  • --no-open-browser: Do not open the default browser with the login page of the Alma instance

 

build

The build command is used to build the Cloud App and prepare it for deployment to a production server. It wraps the ng build command from the Angular CLI. It is recommended that you build your Cloud App before you submit it for publishing to ensure there are no compile-time errors. For more information see the “Deploying Cloud Apps” documentation.

generate

The generate command is used to create new files in the Cloud App project such as new components. It wraps the ng generate command from the Angular CLI. For more information see the tutorial on “Adding additional routes.”

extract-labels

The extract-labels command is used to extract the strings used in the Cloud App and prepare files for translations. It wraps the ngx-translate-extract tool. For more information see the tutorial on “Making your app ready for translations.”