Skip to content

Command Line and Shell

Enhanced Mule Tools provides a command tool ( emt ) which can be used to perform various operations. This can be installed on your system as per instructions under setup.

The emt command tool also has the ability to run a custom shell by running the emt shell command. This shell has the benefit of provide auto-completion of commands.

Additionally, instead of installing the cli tool it is possible to access the same capabilities by using shell goal of the maven plugin. ie:

mvn com.aeontronix.enhanced-mule:enhanced-mule-tools-maven-plugin:1.4.62:shell

This maven goal can also be used to run commands using the cmd parameter

mvn com.aeontronix.enhanced-mule:enhanced-mule-tools-maven-plugin:1.4.62:shell -Dcmd=keygen

Base flags

Usage: emt [--version] [-p=<profileName>] [[-upw=<upw> <upw>]... [-bt=<bearer>]
[-cc=<clientCreds> <clientCreds>]...] [COMMAND]
-bt, --bearer=<bearer>
Bearer token credentials
-cc, --credential-credentials=<clientCreds> <clientCreds>
Credential Credentials
-p=<profileName>    Profile
-upw, --username-password=<upw> <upw>
Username / Password credentials
--version       display version info

Options:

Option Description
-p This is used to specify which profile to use when executing the command
-upw Authenticate using anypoint username/password credential. The first parameter is the username, the second is the password
-bt Used to specify an anypoint bearer token
-cc Authenticate using anypoint username/password credential. The first parameter is the client id, the second is the client secret
-d Enable debug logging

Configuration

emt profile

Usage: emt profile [-c] [<profile>]
Change or show active profile
      [<profile>]   profile to activate
  -c, --create      Create profile if required

This command can be used to view which profile is currently active by not specifying any parameter. ie:

> emt profile
Active profile: default

Or it can be used to change the active profile by adding the profile parameter

> emt profile otherprofile
Active profile: otherprofile

This assumes that profile already exists. To create a profile that doesn't already exist, use the -c flag

> emt profile -c otherprofile
Active profile: otherprofile

emt config upw

Usage: emt config upw <username> <password>
Set username/password authentication in configuration
      <username>   username
      <password>   password

This command is used to set authentication to use an anypoint username/password.

emt config bearer

Usage: emt config bearer <bearer>
Set username/password authentication in configuration
      <bearer>   Bearer token

This command is used to set authentication to use an anypoint bearer token

emt config env

Usage: emt config env <env>
Set default environment in configuration
      <env>   Default environment name or id

This command is used to set the default environment that

API Manager

emt api-manager dump

This command can be used to dump API policy configuration

Usage: emt api-manager dump [-o=<orgName>] <envName> [<regex>]
      <envName>   Environment name or id
      [<regex>]   Only include APIs matching this regex pattern
                    Default: .*
  -o=<orgName>    Organization group name or id

Exchange

emt exchange promote

Usage: emt exchange promote [-g=<businessGroup>] [-n=<newVersion>] <assetId>
                            <version>
Promote an snapshot application in exchange to a release version
      <assetId>   Asset Id
      <version>   Asset Version
  -g, --group-id=<businessGroup>
                  Business group name or id
  -n, --new-version=<newVersion>
                  New version

Properties

emt properties keygen

Usage: emt properties keygen [-r] [-s] [<file>]
Generate a property encryption key
      [<file>]   File to write key to
  -r, --rsa      Generate an RSA key pair instead of an AES key
  -s, --save     Save key to active profile

emt properties encrypt

Usage: emt properties encrypt [-d=<descPath>] [-n=<noExpression>] [-p=<filePath>]
                   [-v=<value>] [-s=<key> | -f=<keyFile>]
Encrypt properties
  -d, --descriptor-path=<descPath>
                             Property definition file path
                               Default: src/main/resources/properties.yaml
  -f, --key-file=<keyFile>   Encryption key file
  -n, --no-expression=<noExpression>
                             if this flag is used, only the encrypted value
                               will be returned rather than the whole property
                               expression
  -p, --file-path=<filePath> Property file path
                               Default: src/main/resources/properties-local.yaml
  -s, --key-string=<key>     Encryption key as text
  -v, --value=<value>        Text to encrypt

emt properties decrypt

Usage: emt properties decrypt [-d=<descPath>] [-p=<filePath>] [-v=<value>] [-s=<key> |
                   -f=<keyFile>]
Decrypt properties
  -d, --descriptor-path=<descPath>
                             Property definition file path
                               Default: src/main/resources/properties.yaml
  -f, --key-file=<keyFile>   Encryption key file
  -p, --file-path=<filePath> Property file path
                               Default: src/main/resources/properties-local.yaml
  -s, --key-string=<key>     Encryption key as text
  -v, --value=<value>        Text to encrypt

Cloudhub

emt cloudhub application download

This command is used to download the jar file of an application deployed on cloudhub

Usage
Usage: emt cloudhub application download [-e=<envNameOrId>] [-f=<file>]
[-o=<orgNameOrId>] <appDomain>
Download a cloudhub application
<appDomain>           Application id
-e, --env=<envNameOrId>   Environment name or id
-f, --file=<file>         File to save the application as (if directory is
specified, it will be saved in that directory
with the original application filename)
-o, --org=<orgNameOrId>   Environment name or id