• Stars
    star
    207
  • Rank 189,769 (Top 4 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Manage and configure Akamai from the Command Line.

Akamai CLI

Build Status Go Report Card GitHub release License GoDoc

Use Akamai CLI to configure Akamai platform and products directly from the command line. You can install ready-to-use product packages or build your own custom solutions to manage from CLI.

Benefits

  • Simple and task-oriented interface
  • Consistent user experience across all Akamai products
  • Wide range of supported packages and capabilities
  • Extend or build your own CLI packages with supported programming languages such as Go, Python, and JavaScript

Available Packages

Browse the list of available packages.

Install Akamai CLI

Akamai CLI doesn't have any dependencies and is quick to install. However, you may need an additional runtime for packages depending on the programming language they are based on.

Install Akamai CLI by downloading a release binary. See instructions for various operating systems.

You can also use Homebrew, Docker, or compile from source.

System dependencies for Python-based packages

If you're using a Python-based CLI package, install these extra dependencies:

Install from binaries

Follow the instructions for your operating system.

Linux and macOS

Once you download the appropriate binary for your system, make it executable, and optionally make it available in your $PATH. Run the following commands:

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

Windows

Once you download the appropriate binary for your system, simply execute the binary from the command line. For example:

$ akamai.exe help

Install with Homebrew

You can also install Akamai CLI using the Homebrew package manager. If you haven’t used it before, check Homebrew documentation for system requirements and read the installation guide.

Once set up, simply run:

$ brew install akamai

This command compiles and globally installs the binary with all necessary dependencies.

Install with Docker

A container with Akamai CLI and pre-installed public packages is also available in Docker. All images are built using Docker files from the akamai-docker repository. You can find all Akamai builds on Docker Hub.

To start, create and run the container with Akamai Development Environment:

$ docker run -it -v $HOME/.edgerc:/root/.edgerc:ro akamai/shell

Note: This mounts your local $HOME/.edgerc into the container. To change the local path, modify the -v argument.

The akamai command and basic packages are already installed. See the akamai-docker repository for more details.

If you want to open Akamai Development Environment when calling the akamai command, add the following line to your .bashrc, .bash_profile, or .zshrc files:

alias akamai='docker run -it -v $HOME/.edgerc:/root/.edgerc:ro akamai/shell'

If you want to use a local .akamai-cli directory to configure and manage your installed packages, modify the -v argument:

$ docker run -it -v $HOME/.akamai-cli:/cli/.akamai-cli akamai/shell

This command installs the CLI and persists the configuration and packages in $HOME/.akamai-docker directory.

Compile from Source

Prerequisite: Make sure you install Go 1.17 or later.

To compile Akamai CLI from source:

  1. Change the working directory:

    $ cd $GOPATH
  2. Fetch the package:

    $ git clone github.com/akamai/cli
  3. Go to the package directory:

    $ cd cli
  4. Compile the binary:

  • For Linux, macOS, and other Unix-based systems, run: go build -o akamai cli/main.go
  • For Windows, run: go build -o akamai.exe cli/main.go
  1. Move the akamai or akamai.exe binary so that it's available in your $PATH.

API credentials

Akamai-branded packages use a .edgerc file for standard EdgeGrid authentication. By default, CLI looks for credentials in your $HOME directory.

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

To set up your .edgerc file, see Get started with APIs.

Upgrade

Unless you installed Akamai CLI with Homebrew, you can enable automatic check for updates when you run Akamai CLI v0.3.0 or later for the first time.

When run for the first time, CLI asks you to enable automatic upgrades. If you do not agree, last-upgrade-check=ignore is set in the .akamai-cli/config file (this option will still allow you to perform manual upgrade as explained below). Otherwise, if a new version is available, CLI prompts you to download it. Akamai CLI automatically checks the new version's SHA256 signature to verify it is not corrupt. After the update, your original command executes using the new version.

For information on manual upgrade and the supported Homebrew command, see akamai upgrade in Built-in commands.

How to use Akamai CLI

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

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

Built-in commands

Use the following commands to manage packages and the toolkit:

  • help

    akamai help shows basic usage info and available commands. To learn more about a specific command, run akamai help <command> [sub-command].

  • list

    akamai list shows a list of available commands. If a command doesn't display, ensure the binary is executable and in your $PATH.

  • install

    This installs new packages from a git repository.

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

    For Github repositories, specify user/repo or organization/repo. For official Akamai packages, you can omit the akamai/cli- prefix. For example, to install akamai/cli-property-manager, it's enough to run property-manager.

    These examples all install Akamai CLI for Property Manager from Github using various aliases:

    akamai install property-manager
    akamai install akamai/cli-property-manager
    akamai install https://github.com/akamai/cli-property-manager.git

    The install command accepts more than one argument, so you can install many packages at once using any of these types of syntax.

  • uninstall

    To remove all the package files you installed with akamai install, run akamai uninstall <command>, where <command> is any command within that package.

    The uninstall command accepts more than one argument, so you can uninstall many packages at once.

  • update

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

    You can specify multiple packages to update at once.

    If you don't specify additional arguments, akamai update updates all packages installed with akamai install

  • upgrade

    Manually upgrade Akamai CLI to the latest version.

    If you installed Akamai CLI with Homebrew, run this command instead:

    $ brew upgrade akamai
  • search

    Search all the packages published on developer.akamai.com for the submitter string. Searches apply to the package name, alias, and description. Search results appear in the console output.

  • config

    View or modify the configuration settings that drive the common CLI behavior. Akamai CLI maintains a local configuration file in its root directory. The config command supports these sub-commands:

    • get
    • set
    • list
    • unset or rm

Installed commands

This commands depend on your installed packages. To use an installed command, run akamai <command> <action> [arguments], for example:

akamai property-manager new-property -p example.org -g grp_123456 -c ctr_X-XXXXXX -d prd_Web_App_Accel

For the list of supported commands, see the documentation for each package.

Custom commands

Akamai CLI provides a framework for writing custom CLI commands. See the extended Akamai CLI documentation to learn how to contribute, create custom packages, and build commands.

Before you start to build your own commands, make sure you meet these prerequisites:

  1. The package is available through a Git repository that supports standard SSH public key authentication.
  2. The executable is named akamai-<command> using dashed-lowercase, or akamai<Command> using camelCase.
  3. Verify that akamai-command help works for you. Ideally, CLI should allow for akamai-command help <sub-command>.
  4. If you're using Akamai APIs, the executable must support the .edgerc format, and must support both --edgerc and --section flags.
  5. If an action fails to complete, the executable exits with a non-zero status code.

As long as the result is executable, you can use any of the supported languages to build your commands, including Python, Go, and JavaScript.

Logging

To see additional log information, prepend AKAMAI_LOG=<logging-level> to any CLI command. You can specify one of the following logging levels:

  • fatal
  • error
  • warn
  • info
  • debug

For example, to see extra debug information while updating the property-manager package, run:

AKAMAI_LOG=debug akamai update property-manager

Each level is a progressive superset of all previous tiers. The output for debug also includes fatal, error, warn, and info logs.

If you want to redirect logs to a file, use the AKAMAI_CLI_LOG_PATH environmental variable:

AKAMAI_LOG=debug AKAMAI_CLI_LOG_PATH=akamai.log akamai update property-manager

Dependencies

Akamai CLI supports the following package managers that help you automatically install package dependencies:

  • Python: pip (using requirements.txt)
  • Go: go modules
  • JavaScript: npm and yarn

If you want to use other languages or package managers, make sure you include all dependencies in the package repository.

Command package metadata

The package you install needs a cli.json file. This is where you specify the command language runtime version and define all commands included in package.

Format

  • requirements: Specifies the runtime requirements. You may specify a minimum version number or use the * wildcard for any version. Possible requirements are:

    • go
    • node
    • python
  • commands: Lists commands included in the package.

    • name: The command name, used as the executable name.

    • aliases: An array of aliases that invoke the same command.

    • version: The command version.

    • description: A short description for the command.

    • bin: A URL to fetch a binary package from if it cannot be installed from source.

      The bin URL may contain the following placeholders:

      • {{.Version}}: The command version.
      • {{.Name}}: The command name.
      • {{.OS}}: The current operating system, either windows, mac, or linux.
      • {{.Arch}}: The current OS architecture, either 386 or amd64.
      • {{.BinSuffix}}: The binary suffix for the current OS: .exe for windows.

Example

{
  "requirements": {
    "go": "1.8.0"
  },
  "commands": [
    {
      "name": "purge",
      "version": "0.1.0",
      "description": "Purge content from the Edge",
      "bin": "https://github.com/akamai/cli-purge/releases/download/{{.Version}}/akamai-{{.Name}}-{{.OS}}{{.Arch}}{{.BinSuffix}}"
    }
  ]
}

Akamai CLI exit codes

When you complete an operation, Akamai CLI generates one of these exit codes:

  • 0 (Success) - Indicates that the latest command or script executed successfully.
  • 1 (Configuration error) - Indicates an error while loading AKAMAI_CLI_VERSION or AKAMAI_CLI.
  • 2 (Configuration error) - Indicates an error while creating the cache directory.
  • 3 (Configuration error) - Indicates an error while saving the cache-path.
  • 5 (Application error) - Indicates an error with the initial setup. Occurs when you run Akamai CLI for the first time.
  • 6 (Syntax error) - Indicates that the latest command or script cannot be processed.
  • 7 (Syntax error) - Indicates that the commands in your installed packages have conflicting names. To fix this, add a prefix to the commands that have the same name.

More Repositories

1

akamai-security-research

This repository includes code and IoCs that are the product of research done in Akamai's various security research teams.
C
407
star
2

edgeworkers-examples

EdgeWorkers Examples – This repository contains practical examples, that can be used as a starting point for Akamai EdgeWorkers.
JavaScript
138
star
3

DDSpoof

DDSpoof is a tool that enables DHCP DNS Dynamic Update attacks against Microsoft DHCP servers in AD environments.
Python
113
star
4

terraform-provider-akamai

Terraform Akamai provider
Go
108
star
5

cl-http2-protocol

HTTP/2 interop library in Common Lisp
Common Lisp
103
star
6

Invoke-DHCPCheckup

PowerShell
101
star
7

AkamaiOPEN-edgegrid-python

This library implements an Authentication handler for the Akamai OPEN EdgeGrid Authentication scheme
Python
84
star
8

akr

Akamai Krypton CLI and SSH Agent (v2)
Rust
81
star
9

AkamaiOPEN-edgegrid-golang

This library implements an Authentication handler for the Akamai OPEN EdgeGrid Authentication scheme
Go
77
star
10

luda

Malicious actors often reuse code to deploy their malware, phishing website or CNC server. As a result, similiaries can be found on URLs path by inspecting internet traffic. Moreover, deep learning models or even regular ML model do not fit for inline deployment in terms of running performance. However, regexes ( or YARA rules ) can be deployed on a proxy and work in real time on all the traffic. LUDA can take a set of malicious and benign URLs and return a list of regexes ready to be deployed inline !
Python
74
star
11

httpie-edgegrid

Plugin for httpie to allow edge grid authentication for Akamai
Python
67
star
12

cli-purge

Akamai CLI for Purge allows you to purge cached content from the Edge using FastPurge (CCUv3).
Go
51
star
13

AkamaiOPEN-edgegrid-php-client

PHP client library for Akamai {OPEN} EdgeGrid Authentication scheme (based on Guzzle)
PHP
43
star
14

edgegrid-curl

Python based command line tool which simplifies Akamai OPEN EdgeGrid Client Authentication
Python
42
star
15

AkamaiOPEN-edgegrid-java

Java library for Akamai OPEN EdgeGrid Client Authentication
Java
39
star
16

akamai-docker

Dockerfile for official Akamai's DevOps environment containing CLI packages and useful tools
Dockerfile
38
star
17

EdgeAuth-Token-Python

Akamai Authorization Token for Python
Python
32
star
18

esi-test-server-docker

A dockerized version of Akamai's Edge Side Includes Test Server (ETS).
HTML
31
star
19

uls

Unified Log Streamer (ULS)
Python
30
star
20

hface

Hackable HTTP/{1,2,3} {client,server,proxy}
Python
29
star
21

cli-property-manager

Use this Property Manager CLI to automate Akamai property changes and deployments across many environments.
JavaScript
29
star
22

akamai_developer_toolkit

Akamai Developer Toolkit chrome extension
JavaScript
28
star
23

entropy-ip

Source code supporting Akamai's Custom Analytics project: http://entropy-ip.com/
Python
25
star
24

akamaipowershell

Powershell module for Akamai {OPEN} APIs
PowerShell
24
star
25

NetStorageKit-Python

Akamai Netstorage API for Python
Python
24
star
26

cli-terraform

Akamai CLI plugin Admin Support for multiple OpenAPI resource types
Go
24
star
27

wp-akamai

PHP
23
star
28

cli-eaa

CLI for Enterprise Application Access (EAA)
Python
23
star
29

EdgeAuth-Token-Node

Akamai Authorization Token for Node
JavaScript
20
star
30

js_api

Web server and API to scan any websites to detect malicious JS
JavaScript
19
star
31

stamp-materials

Educational materials related to the STAMP safety analysis framework.
TeX
19
star
32

cli-edgeworkers

Akamai CLI for EdgeWorkers, allows you to interact with EdgeWorkers APIs via a command line interface
TypeScript
19
star
33

NetStorageKit-Node

Akamai NetStorage API for Node
JavaScript
19
star
34

NetStorageKit-Golang

Netstorage API for Golang
Go
18
star
35

NetStorageKit-Java

Java
18
star
36

AkamaiOPEN-edgegrid-ruby

This library implements the Akamai OPEN EdgeGrid Authentication scheme for the ruby net/http library.
Ruby
18
star
37

cell-emulation-util

A script based on TC netem to emulate the latency, loss, and bandwidth of a real-world cellular network.
Shell
18
star
38

NetStorageKit-PHP

Akamai NetStorage for PHP
PHP
17
star
39

cli-netstorage

JavaScript
15
star
40

js2esi

Bidirectional JavaScript <-> ESI converter. Write javascript code that will be converted to valid ESI (Edge Side Includes), capable of running at the Edge.
Python
15
star
41

cli-firewall

Provides a way to interact with Firewall Rules and Site Shield related information via Open APIs.
Python
15
star
42

AkamaiOPEN-edgegrid-C-Sharp

C#
14
star
43

EdgeAuth-Token-Java

Akamai Authorization Token for Java
Java
14
star
44

examples-terraform

This repository contains examples and templates for the Akamai Terraform Provider. Maintained by the Developer Advocacy team @ Akamai.
HCL
14
star
45

AkamaiOPEN-edgegrid-php

PHP library for Akamai {OPEN} EdgeGrid Authentication scheme (signing only)
PHP
14
star
46

cli-cps

Provides a way to interact with the Akamai Certificate Provisioning System (CPS) via Open APIs. Provides various functionality such as viewing certificate details, generating audits, checking change statuses, and creating/modifying certificates.
Python
14
star
47

cli-sandbox

Akamai CLI for Sandbox
JavaScript
13
star
48

cli-appsec

Akamai CLI for Application Security
JavaScript
13
star
49

mpulse.js

mpulse.js JavaScript API
JavaScript
13
star
50

cli-diagnostics

Use the Edge Diagnostics CLI to identify, analyze, and troubleshoot common content delivery network issues that your users may encounter.
Go
12
star
51

bash

C
11
star
52

cli-mpulse

CLI for the Akamai's mPulse Query API
Python
10
star
53

cli-etp

CLI for Enterprise Threat Protector (ETP)
Python
10
star
54

cli-dns

Akamai CLI for Edge DNS
Go
9
star
55

AkamaiOPEN-edgegrid-powershell

Akamai OPEN EdgeGrid Powershell authorization wrapper
PowerShell
9
star
56

NetStorageKit-Ruby

Akamai NetStorage API for Ruby
Ruby
8
star
57

EdgeAuth-Token-Ruby

Akamai Authorization Token for Ruby
Ruby
7
star
58

edgeworkers-vscode

VS Code extension for Akamai EdgeWorkers
TypeScript
7
star
59

NetStorageKit-C-Sharp

C#
7
star
60

customersuccess-compute-workshop

HCL
6
star
61

papi-vscode-extension

TypeScript
6
star
62

boomerang-inspector

Boomerang Inspector Browser Extension
JavaScript
6
star
63

akamai-edgedns-traffic-exporter

Go
5
star
64

pallas

Pallas is Python library for querying AWS Athena.
Python
5
star
65

linode-failover-workshop

HCL
5
star
66

repository.js

JavaScript (Node.js) wrapper for the mPulse/CloudTest Repository REST API.
JavaScript
5
star
67

cli-test-center

Akamai CLI for test center allows you to test the behavior of configuration changes on your own from the Command Line
Go
5
star
68

UrbanCrawl-API

The Loopback based API that powers Urban Crawl apps
JavaScript
5
star
69

edgeworkers-unittest

Mocks and examples to write and run unit tests for EdgeWorkers
JavaScript
5
star
70

change-DNS-TTL

A command line tool for changing the TTL of zone records of Akamai DNS solutions.
Ruby
5
star
71

java-simple-mqtt-device

This is where some sample Java MQTT Paho client programs (multiple but one project) show how to connect to IoT Edge Connect
Java
5
star
72

edgenativeworkshop

Shell
4
star
73

nomcc

A python library for the Nominum Command Channel
Python
4
star
74

cli-api-gateway

Go
4
star
75

alerts-to-slack

Python
4
star
76

lds-connector

This script continuously moves Akamai logs into the Splunk SIEM tool
Python
4
star
77

mPulse-iOS

iOS tracking library for mPulse Analytics
Objective-C
4
star
78

akamai-gtm-metrics-exporter

Prometheus Exporter for Akamai GTM Activity Metrics
Go
4
star
79

cli-mfa

CLI module for Akamai MFA https://www.akamai.com/mfa
Python
4
star
80

certbot-plugin-edgedns

Python
4
star
81

intentspec

A LaTeX package extending enumeration and providing macros for use in writing "Intent Specification" style requirements documents.
TeX
4
star
82

cli-onboard

Akamai CLI Onboard allows you to create a new Property Manager configuration from any flexible template including SSL Certificates and adding to an existing WAF configuration
Python
4
star
83

cli-cloudlets

Akamai CLI for Cloudlets allows you to work with cloudlets from the Command Line
Python
3
star
84

re2g

A grep-alike built on re2
C++
3
star
85

Entity-Persistence-Service

3
star
86

AkamaiOPEN-edgegrid-perl

This library implements the Akama OPEN Edgegrid Authentication scheme for LWP
Perl
3
star
87

Jenkins-API-Gateway-sample-code

Sample code to showing how to use Jenkins to keep API Gateway Swagger definitions up to date
Python
3
star
88

distimate

Distributions visualized
Python
3
star
89

PowerShell

PowerShell
3
star
90

akj-tech-preview

Experimental JavaScript SDK for configuring Properties (tech preview)
TypeScript
2
star
91

Information-based-Heavy-Hitters-for-Real-Time-DNS-Exfiltration-Detection

Algorithm for detection of real-time DNS exfiltration
C
2
star
92

gtm-grafana-datasource-plugin

Grafana plugin to view Global Traffic Management (GTM) reports
Go
2
star
93

akamai-cli

NPM Installer for akamai CLI binary
JavaScript
2
star
94

cli-gtm

Go
2
star
95

mpulse-query.js

Akamai mPulse Query REST API interface for Javascript
JavaScript
2
star
96

akr-pkg

Shell
2
star
97

levelup-linode-workshop

HCL
2
star
98

edgeworkers-intellij

IntelliJ plugin for Akamai EdgeWorkers
Java
2
star
99

python-simple-mqtt-device

MQTT Device
Python
2
star
100

sandbox-client

2
star