Akamai CLI

 Get Started   |   Contributing   |   Custom Packages   |   Style Guide

Get Started

Akamai CLI is an ever-growing CLI toolkit for working with Akamai APIs from the command line.

Benefits

  • Create consistent user experiences
  • Install new capabilities and manage your packages.
  • Build your own CLI packages to extend and enhance your capabilities using any of our nine supported languages, including Golang, Python, Javascript, PHP, Ruby, etc.

Goals

  • Simplicity
  • Consistent UX
  • Use-case/task focused

Prerequisites

Akamai CLI itself has no dependencies but may rely on packages that can be written using any language and may require additional runtimes.

 

Download

The easiest way to install Akamai CLI is to download a release binary for your platform and follow the instructions for your platform below. There are no additional requirements.

View Release Binaries

Linux and macOS

Once you have downloaded the appropriate binary for your system, you must make it executable, and optionally move it somewhere within your path.

$ chmod +x ~/Downloads/akamai-<VERSION>-<PLATFORM>
$ mv ~/Downloads/akamai-<VERSION>-<PLATFORM> /usr/local/bin/akamai

Windows

Once you have downloaded the appropriate binary for your system, no further actions are required on your part, simply execute the binary from the command line.

Using Homebrew

If you are using macOS, you can also install using the Homebrew package manager:

$ brew install akamai

This will install all necessary dependencies, compile, and install the binary — which will then be available globally.

Using Docker

If you use (or want to use) docker, you can get a fully installed CLI instance by running:


 $ docker run -ti akamaiopen/cli

The container contains Akamai CLI, as well as the purge and property subcommands, pre-installed.

Note: When setting up your .edgerc, the purge subcommand defaults to the ccu credentials section, while the property subcommand uses the papi section. These can be changed using the --section flag.

Compiling from Source

If you want to compile it from source, you will need Go 1.7 or later, and the Glide package manager installed:

  1. Fetch the package:
    go get github.com/akamai/cli
  2. Change to the package directory:
    cd $GOPATH/src/github.com/akamai/cli
  3. Install dependencies using Glide:
    glide install
  4. Compile the binary:
  5. Linux/macOS/*nix: go build -o akamai
  6. Windows: go build -o akamai.exe
  7. Move the binary (akamai or akamai.exe) it to your PATH

Credentials

Akamai CLI uses the standard Akamai credentials file, .edgerc. By default, it will look for credentials in your HOME directory.

You can override both the credentials file location or the section, by passing the --edgerc or --section flags to each command.

To set up your credential file, see the authorization and credentials sections of the Get Started guide.

 

Upgrading

Akamai CLI can automatically check for newer versions (at most, once per day). You will be prompted to enable this feature the first time you run Akamai CLI v0.3.0 or later.

If a new version is found, you will be prompted to upgrade. Choosing to do so will download the latest version in-place, and your original command will then be executed using the new version.

Akamai CLI automatically checks the SHA256 signature of the new version to verify it’s validity.

To manually upgrade, see akamai upgrade.

 

Usage

All commands start with the akamai binary, followed by a command, and optionally an action or other arguments.


akamai [command] [action] [arguments...]

Built-in commands

Help

Calling akamai help will show basic usage info and available commands. To learn more about a specific command, use akamai help <command> [action].


$ akamai help                      # General Akamai CLI help
$ akamai help property            # General Akamai CLI for Property Manager Help
$ akamai help property create     # Help for the "create" action for Akamai CLI for Property Manager

List

Calling akamai list will show you a list of available commands. If a command is not shown, ensure that the binary is executable, and in your PATH.


$ akamai list

Install

The install command allows you to easily install new packages from a git repository.

Calling akamai install <package name or repository URL> will download and install the command repository to the $HOME/.akamai-cli directory.

For Github repositories, you can pass in user/repo or organization/repo. For official Akamai packages, you can omit the akamai/cli- prefix, so to install akamai/cli-property you can specify property.

For example, all of the following will install Akamai CLI for Property Manager from Github using various aliases:


$ akamai install property
$ akamai install akamai/cli-property
$ akamai install https://github.com/akamai/cli-property.git
$ akamai install git@github.com:akamai/cli-property.git # requires private repository access

Update

To update a package installed with akamai install, call akamai update <command>, where <command> is any command within that package.

Calling akamai update with no arguments will update all packages installed using akamai install.


$ akamai update property           # Update the Akamai CLI for Property Manager package
$ akamai update                    # Update all packages

Upgrade

Manually upgrade Akamai CLI to the latest version.


 $ akamai upgrade  

Installed Commands

To call an installed command, use akamai <command> [args], e.g.


 $ akamai property create example.org