Install Axway Central CLI

Learn how to install the Axway CLI core package and Axway Central CLI extension, and authorize them to use the Amplify Central APIs. This enables you to integrate the CLI into your DevOps pipeline.

5 minute read

Note: This page details installation instructions for the ‘Axway Central CLI’ package, which replaced the deprecated ‘Amplify Central CLI’ package.

If you are a current user of the deprecated ‘Amplify Central CLI’ package, you can uninstall that package by running:

  [sudo] axway pm uninstall @axway/amplify-central-cli

Before you start

  • You will need an administrator account for Amplify Central (Managing Accounts).
  • You will need Node.js version 10.13.0 or later.

Operating system supported configurations

The following table describes the operating system supported configurations that you can use with Axway Central CLI.

OS Node.js Version Terminal Shells Supported Terminal Shells Unsupported
Mac OSX or later 10.13.0 or later bash , zsh
Windows 10 or later 10.13.0 or later Command Prompt, PowerShell Cygwin, Git Bash
Linux 10.13.0 or later bash

Install Axway CLI and Axway Central CLI

  1. Install Node.js 10.13.0 LTS or later.

  2. Install npm 6.9.0 or later.

  3. Run the following command to install Axway CLI:

    [sudo] npm install -g axway
    

    Use sudo on Mac OS X or Linux if you do not own the directory where npm installs packages to. On Windows, you do not need to run as Administrator as npm installs packages into your AppData directory.

  4. Run Axway package manager to install Axway Central CLI:

    [sudo] axway pm install @axway/axway-central-cli
    
  5. Run Axway package manager list command to view available packages:

    axway pm list
    

    Expected response:

    Axway CLI, version 1.4.0
    Copyright (c) 2018, Axway, Inc. All Rights Reserved.
    NAME                           | INSTALLED VERSIONS | ACTIVE VERSION
    @axway/axway-central-cli       | 1.0.0              | 1.0.0
    

All the development versions of Axway Central CLI can be found at NPM install of Axway Central CLI. To install a specific development version, run the following command:

[sudo] axway pm install @axway/amplify-central-cli@1.0.0-dev.10

Additional installation steps on Windows

After successfully installing Axway Central CLI, you must check if OpenSSL is installed. OpenSSL is needed to generate a public and private key pair for service account authentication, which is a pre-requisite for the creation of service accounts.

Install OpenSSL if not installed already:

  1. Download OpenSSL.

  2. Install OpenSSL, and ensure it is added to your path (C:\Program Files\OpenSSL-Win64\bin) in environment variables.

    Environment variables

  3. Verify that OpenSSL is installed and configured correctly.

     openssl version
    

Authorize your CLI to use the Amplify Central APIs

Before using the Amplify Central APIs you must first authorize your CLI, so you can use it, for example, as part of your DevOps pipeline.

You can use the following options to authorize your CLI:

  1. Use your Amplify Platform login credentials.
  2. Use a service account.

Option 1 - Log in with your Amplify Platform credentials

To use Central CLI to log in with your Amplify Platform credentials, run the following command:

axway auth login

On the dialog box displayed, enter valid credentials (email address and password). An “Authorization Successful” message is displayed, and you can go back to the Central CLI.

If you are a member of multiple Amplify organizations, you might have to choose an organization. After that, you have completed the authorization of your CLI.

If you have used the client-id configuration to authorize with the CLI, you must remove it. To verify that you have used client-id, run:

axway central config list

Expected response:

{
   ...
   'client-id': 'apicentral',
   ...
}
# OR if used a "DOSA" account before
{
   ...
   'client-id': 'DOSA_105cf15d051c432c8cd2e1313f54c2da',
   ...
}

To remove client-id, you must manually edit the configuration file ~/.axway/central.json and remove the client-id value from it.

Option 2 - Authenticate and authorize your service account

To use the Central CLI, your service account must authenticate with Amplify Platform and it must be authorized to use the Amplify Central APIs.

You can use the following options to create your service account:

2.1 Create a service account using the CLI

To create a service account from the CLI, run the following command (You must have OpenSSL installed to run this command):

axway central create service-account

You will be prompted to provide a name for the service account. A public and private key pair in RSA format will be generated for you.

2.2 Create a service account using the Amplify Central UI

To create a service account from the UI, log in to Amplify Central UI as an administrator, and create a service account for your CLI. Add the public key that you created earlier. When the account is created, copy the client identifier from the Client ID field.

Watch the animation to learn how to do this in Amplify Central UI.

Create service account in Amplify Central UI

Authorize the service account with Amplify platform

After you create a service account your must authorize it with Amplify platform, and log in to Axway CLI using the following command:

axway auth login --client-id DOSA_105cf15d051c432c8cd2e1313f54c2da --secret-file ~/test/private_key.pem

Expected response:

Axway CLI, version 1.4.0
Copyright (c) 2018, Axway, Inc. All Rights Reserved.

You are logged into 8605xxxxxxx28 as DOSA_5ed74d68defxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx604.

This account has been set as active.

Set the active service account

To set the service account client identifier for future operations:

axway central config set --client-id DOSA_105cf15d051c432c8cd2e1313f54c2da

To view the saved configuration, run:

axway central config list

Expected response:

{ 'client-id': 'DOSA_105cf15d051c432c8cd2e1313f54c2da' }

Review

You have learned how to install the Axway CLI core package, the Axway Central CLI extension, and how to register or link it to a service account, or to the Amplify Platform account. Now, you can integrate the Axway Central CLI into your DevOps pipeline to automate actions in Amplify Central.