The Leap CLI is a tool for developers. With the help of the CLI, the amount of boilerplate code and configuration is severely decreased. This guide explains the basic actions available in the CLI.
Follow the Leap CLI Installation and Setup Guide if you do not already have Leap CLI configured in your development environment.
The purpose of this document is to detail all of the available commands used by the CLI, they can be executed in any order unless the description states otherwise.
Creates a new Leap Project in the current directory. The root level of the project is created “/attunedlabs”. By default, all of the required framework and feature files – along with their configurations – will be generated within the project with the build profile of “local”.
leap-cli -init <profile>
<profile>, can consist of the values “local”, “test”, “prod”
-configDB, if you wish to initialize the database schema at the same time
leap-cli -init “prod”
leap-cli -init “local” -configDB “myDBSchema”
Creates a new schema in the existing MySQL Database. By default, the schema will be named “leap”. By using the optional -name parameter you can specify your own schema name.
If you use a custom schema name, be sure that the connection string in the globalAppConfig.properties file is also updated.
<schema name>, will be “leap” if not provided
leap-cli -configDB “testing”
Creates a new maven project in the “/attunedlabs/services” directory. This command automatically registers the Feature-Installer, BaseRoute, Beans, and creates a sample HTTP Service for testing.
leap-cli –a <folderName> –g <maven groupId> –fg <featureGroup> –fn <featureName> –impl <implementationName> –ven <vendorName> –p <profile>
-artifactId || -a, maven project name
-groupId || -g, maven project group ID
-featureGroup || -fg, feature group name of new feature
-featureName || -fn, feature name of new feature
-implementation || -impl, implementation name of new feature
-vendor || -ven, vendor name of new feature
-profile || -p, profile name(local, prod or test)
-permastore || -perma, adds default Permastore configuration files
-dataContext || -dContext, adds default Leap Data Context configuration files
-eventing || -ev, adds default Eventing configuration files
leap-cli –a “newProject” –g “com.attunedlabs” –fg “testing” –fn “first” –impl “welcome” –ven “attunedlabs” –p “local” -perma
Modifies an existing Feature to add one or more advanced configurations. Available configurations to add are Eventing, Data Context, and Permastore.
leap-cli -add <configName>
-add, options are “eventing-config”, “permastore”, “featureDataContext”
It’s possible to add more than one with a single command by combining the options into a single comma-separated string. Must be in a feature directory to use this command e.g. “/attunedlabs/services/testFeature/”
leap-cli -add “permatore, eventing-config”
Adds a new HTTP Service (endpoint) to an existing Leap Feature. To use this command, you must be in the directory of the Feature that you’d like to enrich.
e.g. To add “foo” service to “TestBar” Feature the required directory is: “/attunedlabs/services/TestBar“
leap-cli -addservice <serviceName> -httpMethod <METHOD>
-addservice, the name of the new service. This String should not contain spaces or special characters.
-httpMethod, the type of HTTP method to use. Options are: POST, GET, PUT, DELETE, UPDATE
leap-cli -addservice “foo” -httpMethod “POST”
Completes a Maven build for a specific Feature while inside of the “../services/<feature>” directory.
Executes the maven-build.bat file in the “../services” directory to build the entire Leap project. When executed from the “services” level.
leap-cli -build <profile>
-build, initiates the build process for Leap project or specific Feature, based on the current directory. Accepts “local”, “test”, or “prod” as <profile> values.
-new, when used in the “../services” directory, it will generate a new maven-build.bat file based on all of the Features currently available.
-verb, -verbose, using this parameter with the leap-cli will enable debug-level logging while building the whole leap project. This flag is not supported when building a specific feature.
If you have just imported a new Feature or created one manually, it would be a good choice to use the -new parameter to get a fresh
leap-cli -build “local” -new (services directory)
leap-cli -build “local” -verb (services directory)
leap-cli -build “local” (feature directory)
After building the Leap project, this will run the project using Maven, from the command line. This command can be run from either the /attunedlabs directory or the /attunedlabs/services directory.
-run, run the Feature-Installer and start project.
Registers a copied Feature with the current Leap project. After doing a copy-paste or clone of an already existing Feature it is required to configure the Feature with the Leap Framework for it to work properly.
Import will configure the BaseRoute, Beans, Feature-Installer POM file, and create a configuration directory for the new Feature.
leap-cli -importFeature <featureName> -execFile <executionFileName> -implFile <implementationFileName>
-importFeature, name of the Feature being imported
-execFile, the name of the execution file for the feature being imported. Only the short name is required if the standard execution file naming convention is followed (featureName-implementationName-feature.xml). If a non-standard execution file is present, you must provide the full file name.
-implFile, the name of the implementation file. Only the short name is required if the standard implementation file naming convention is followed (featureName-implementationName-impl.xml). If a non-standard implementation file name is present, you must provide the full file name.
leap-cli -importFeature “testFeature” -execFile “myExecutionFileName” -implFile “myImplementationFileName”
While running the Leap project, there are several companion services such as Hazelcast that start running. When you press CTRL+C to stop Leap from running, it does not stop the companion services. If these services are not stopped, when trying to run Leap again, the process may fail. It’s highly suggested to use this command every time that leap is stopped.
Because of this behavior, it is necessary to manually terminate the companion services. Leap-CLI can do this for you automatically with the -shutdown command. It is usable from the /services directory.
-shutdown, automatically closes companion services such as Hazelcast
Leap Quickstart Guide
Follow the Leap Quickstart Guide to create a practice project to get some hands-on experience with Leap and the Leap CLI.