API Builder CLI

The AMPLIFY CLI is a companion CLI for the Axway AMPLIFY platform. Once installed, you can use it to install the API Builder CLI. This CLI allows you to create projects (both running integrations and plugins) and, with an AMPLIFY account, download connectors from the Unifed Catalog.

Note

Icon

For users who downloaded the API Builder CLI directly via npm, we recommend that you re-install the CLI using the AMPLIFY CLI to take advantage of the full range of features this CLI offers. Your existing projects will continue to work as before.

Installing the API Builder CLI

Our Getting Started guide explains how to install the AMPLIFY CLI and then the API Builder CLI. Refer to the AMPLIFY CLI documentation for additional details.

Updating the API Builder CLI

We recommend always keeping the API Builder CLI up-to-date. To update the API Builder CLI (and other AMPLIFY CLI plugins) run the following command:

 $ amplify pm update

Sometimes there are new versions of the AMPLIFY CLI available as well. To update the AMPLIFY CLI run the following command:

 $ [sudo] npm i -g @axway/amplify-cli

Logging into the AMPLIFY Platform

Some of the options below require you to log into the AMPLIFY platform. You can do that with the following command:

 $ amplify auth login --client-id apicentral

Commands

init

This command creates a new integration project. The result is a directory containing a skeleton project with sample APIs and flows that can be removed. All npm dependencies are installed along with the project; this can be optionally disabled with a switch. Once the project is created, you are directed to change to the created directory to launch the project. The logfile will tell you the URL you need to use in your browser to access the graphical console. Normally, this will be http://localhost:8080/console.

This is the command to create a new project named "marketing_api"

$ amplify builder init marketing_api

Then, install the project's dependencies and start the API Builder project.

Run project
cd myproject
npm start

Once your project is running, point your browser to  http://localhost:8080/console to access the API Builder user interface (UI) console.

--get-catalog

If logged into the AMPLIFY platform (see above), this command will present you with a catalog of APIs available to you for use in your flows. This is an interactive command that allows you to choose which APIs for which you'd like to download specifications. If you don't want to run this command when creating your project, you can always run the get-catalog command (see below) at any time in your project. Once run successfully, you will see new flow nodes representing your chosen APIs in the flow editor.

The examples below imagines a project named "marketing_api".

 $ amplify builder init --get-catalog marketing_api

If you want to narrow down the list of APIs, you can filter the results on the API name.

 $ amplify builder init --get-catalog --filter="Marketo" marketing_api

 --no-install

This command prevents the installation of dependent node_modules when the project is initialized. Using the same example project name as above.

 $ amplify builder init --no-install marketing_api

Once you want to install dependencies, you can change to your project directory and run this command:

 $ npm install

get-catalog

This command has the same effect as the --get-catalog command described in the "init" section. It must be run while inside an API Builder project directory. If logged into the AMPLIFY platform (see above), you will be provided with a catalog of APIs available to you for use in your flows. This is an interactive command that allows you to choose which APIs for which you'd like to download specifications. Once run successfully, you will see new flow nodes representing your chosen APIs in the flow editor.

 $ amplify builder get-catalog

 --filter

If you want to narrow down the list of APIs, you can filter the results on the API name.

 $ amplify builder get-catalog --filter="Marketo"

plugin init

You use this command when you want to create a new plugin for use in your API Builder projects. There are two types of plugins:

  • Standard
    • This is the default type of plugin. This type of plugin results in a flow node that implements whatever functionality you choose (and can implement in JavaScript).
  • OAS
    • A "Custom OpenAPI" type plugin template allows you to package and share plugins containing flow-nodes generated by dropping OpenAPI files into your plugin's openapi directory. This allows you to use the plugin concept to manage the life-cycle of access to this API via npm, and the added flexibility of being able to extend how this API is accessed from an API Builder flow.

The following command will create a new plugin project:

$ amplify builder plugin init api-builder-plugin-legacy-connector

All API Builder plugins must being "api-builder-plugin", if you entered instead:

$ amplify builder plugin init legacy-connector

 Then a directory names api-builder-plugin-legacy-connector would still be created.

--no-install

This command prevents the installation of dependent node_modules when the plugin is initialized. (Using the same example plugin name as above.)

$ amplify builder plugin init --no-install legacy-connector

 --type

This option allows you to specify the type of plugin you'd like to create (see above). The options are "standard" and "oas". If neither is specified, then "standard" is assumed. You can specify "standard" as follows:

$ amplify builder plugin init --type=standard

You can also create a custom OpenAPI plugin template. A "Custom OpenAPI" type plugin template allows you to package and share plugins containing flow-nodes generated by dropping OpenAPI files into your plugin's openapi directory.

To create an OpenAPI plugin template, you can use this command (using the same example plugin name as above):

$ amplify builder plugin init --type=oas legacy-connector

 API Builder CLI (npm)

While we recommend to use the API Builder CLI as part of the AMPLIFY CLI, a secondary CLI is available for install on NPM which doesn't depend on the AMPLIFY CLI. This has all the same functionality, however the commands and install mechanism are slightly different.

Installation and update

$ [sudo] npm install -g @axway/api-builder

Commands

All commands are as documented above. The only difference is that instead of amplify builder, the command is api-builder. For example to initialise a new project, the following command is used: 

$ api-builder init marketing_api

Related Links