### Install Akamai CLI with Homebrew Source: https://github.com/akamai/cli/blob/master/README.md If you use the Homebrew package manager, you can install the Akamai CLI with a single command. ```sh $ brew install akamai ``` -------------------------------- ### Install Akamai CLI Packages Source: https://context7.com/akamai/cli/llms.txt Use `akamai install` to add packages from Git repositories. Supports shorthand names, full GitHub paths, and HTTPS/SSH URLs. Multiple packages can be installed at once. ```sh akamai install property-manager akamai install akamai/cli-purge akamai install https://github.com/akamai/cli-dns.git akamai install property-manager purge dns akamai install https://github.com/myorg/akamai-custom-tool.git # Expected output # [spinner] Attempting to fetch package configuration from https://github.com/akamai/cli-property-manager.git... OK # [spinner] Attempting to fetch command from https://github.com/akamai/cli-property-manager.git... OK # [spinner] Installing Dependencies... OK # # Installed Commands: # property-manager (alias: pm) # Manage Akamai properties (configurations) with Property Manager API ``` -------------------------------- ### Install Akamai CLI Packages Source: https://github.com/akamai/cli/blob/master/README.md Installs new packages from a Git repository. Supports package name, repository URL, or GitHub user/repo format. Multiple packages can be installed at once. ```sh akamai install property-manager ``` ```sh akamai install akamai/cli-property-manager ``` ```sh akamai install https://github.com/akamai/cli-property-manager.git ``` -------------------------------- ### Use Installed Akamai CLI Commands Source: https://github.com/akamai/cli/blob/master/README.md Executes an installed command with its specific action and arguments. Refer to individual package documentation for supported commands and actions. ```sh akamai property-manager new-property -p example.org -g grp_123456 -c ctr_X-XXXXXX -d prd_Web_App_Accel ``` -------------------------------- ### Run Akamai CLI with Docker Source: https://context7.com/akamai/cli/llms.txt Examples for running the Akamai CLI within a Docker container, including mounting .edgerc for authentication and persisting installed packages. ```bash # Run the official Akamai Development Environment image docker run -it \ -v $HOME/.edgerc:/root/.edgerc:ro \ akamai/shell ``` ```bash # Persist installed packages across container restarts docker run -it \ -v $HOME/.edgerc:/root/.edgerc:ro \ -v $HOME/.akamai-cli:/cli/.akamai-cli \ akamai/shell ``` -------------------------------- ### Install and Find Executables with LangManager Source: https://context7.com/akamai/cli/llms.txt Use LangManager to install package dependencies and locate executable paths for different runtimes. Ensure the correct LanguageRequirements are provided. ```go import ( "context" "github.com/akamai/cli/v2/pkg/packages" ) ctx := context.Background() lm := packages.NewLangManager() reqs := packages.LanguageRequirements{Python: "3.6"} // Install dependencies for a cloned package directory err := lm.Install(ctx, "/home/user/.akamai-cli/src/cli-firewall", reqs, []string{"firewall"}, // command names []string{""}, // ldflags (empty for Python) ) if err != nil { // possible errors: ErrRuntimeNotFound, ErrVirtualEnvCreation, // ErrRequirementsInstall, ErrPipNotFound, ErrUnknownLang panic(err) } // Find the executable path(s) including interpreter prefix execParts, err := lm.FindExec(ctx, reqs, "/home/user/.akamai-cli/src/cli-firewall/bin/akamai-firewall") // For Python: execParts = ["/home/user/.akamai-cli/venv/cli-firewall/bin/python3", // "/home/user/.akamai-cli/src/cli-firewall/bin/akamai-firewall"] // For Go: execParts = ["/home/user/.akamai-cli/src/cli-purge/bin/akamai-purge"] // Lifecycle hooks used when dispatching an installed command err = lm.PrepareExecution(ctx, reqs, "cli-firewall") // activates Python venv if needed deferr lm.FinishExecution(ctx, reqs, "cli-firewall") // deactivates venv on exit ``` -------------------------------- ### Akamai CLI Package Metadata Example Source: https://github.com/akamai/cli/blob/master/README.md This JSON structure defines the requirements and commands for an Akamai CLI package. It specifies the Go runtime version and details a 'purge' command, including its version, description, and a URL for fetching a binary package with version, name, OS, architecture, and binary suffix placeholders. ```json { "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}}" } ] } ``` -------------------------------- ### Compile Akamai CLI from Source (Windows) Source: https://github.com/akamai/cli/blob/master/README.md Compile the Akamai CLI from source on Windows using Go. Ensure you have Go 1.24.11 or later installed. ```go go build -o akamai.exe cli/main.go ``` -------------------------------- ### List Installed Akamai CLI Commands Source: https://context7.com/akamai/cli/llms.txt Use `akamai list` to display all registered commands. Add the `--remote` flag to fetch the package registry and show packages not yet installed. ```bash # List installed commands akamai list ``` ```bash # List all available (not-yet-installed) packages akamai list --remote ``` -------------------------------- ### Run Akamai CLI Tests and Linter Source: https://context7.com/akamai/cli/llms.txt Commands to execute the full test suite and run the linter for the Akamai CLI project. The linter requires golangci-lint to be installed. ```bash # Run the full test suite go test ./... ``` ```bash # Run linter (requires golangci-lint) golangci-lint run ``` -------------------------------- ### Run Akamai CLI Container with Docker Source: https://github.com/akamai/cli/blob/master/README.md This command starts a Docker container with the Akamai CLI and pre-installed packages, mounting your local .edgerc file for authentication. ```sh $ docker run -it -v $HOME/.edgerc:/root/.edgerc:ro akamai/shell ``` -------------------------------- ### Akamai CLI Global Flags Source: https://context7.com/akamai/cli/llms.txt Examples demonstrating the use of global flags for specifying non-default .edgerc files, named credential sections, account switching, and proxy settings. ```bash # Use a non-default .edgerc file akamai --edgerc ~/.edgerc.staging property-manager activate ... ``` ```bash # Use a named credentials section akamai --section staging property-manager list-properties ``` ```bash # Switch accounts (requires account-switch-key privilege) akamai --accountkey 1-ABCD:Z-XYZ property-manager list-properties ``` ```bash # Route all HTTP traffic through a proxy akamai --proxy http://proxy.corp.example.com:8080 install property-manager ``` -------------------------------- ### Compile Akamai CLI from Source (Unix-based) Source: https://github.com/akamai/cli/blob/master/README.md Compile the Akamai CLI from source on Linux, macOS, or other Unix-like systems using Go. Ensure you have Go 1.24.11 or later installed. ```go go build -o akamai cli/main.go ``` -------------------------------- ### Package Manifest for Python CLI Package Source: https://context7.com/akamai/cli/llms.txt Example `cli.json` manifest for a Python-based CLI package. It specifies Python version requirements and command details. ```json { "requirements": { "python": "3.6" }, "commands": [ { "name": "firewall", "version": "2.1.0", "description": "Manage Akamai network lists and firewall rules" } ] } ``` -------------------------------- ### Package Manifest for Go CLI Package Source: https://context7.com/akamai/cli/llms.txt Example `cli.json` manifest for a Go-based CLI package. It specifies Go version requirements and command details, including a `bin` field with a Go `text/template` for download URLs. ```json { "requirements": { "go": "1.14.0" }, "commands": [ { "name": "purge", "aliases": ["content-control"], "version": "1.0.5", "description": "Purge content from the Akamai edge network", "auto-complete": true, "bin": "https://github.com/akamai/cli-purge/releases/download/{{.Version}}/akamai-{{.Name}}-{{.OS}}{{.Arch}}{{.BinSuffix}}" } ] } ``` -------------------------------- ### Search Akamai CLI Packages Source: https://context7.com/akamai/cli/llms.txt Use `akamai search` to find packages in the official registry. It searches by keyword, name, title, command names, aliases, and descriptions, displaying available and installed versions. ```bash # Search by keyword akamai search property ``` ```bash # Search with multiple keywords akamai search dns zone record ``` -------------------------------- ### Display Akamai CLI Version Source: https://github.com/akamai/cli/blob/master/README.md The --version flag shows the version number of the currently installed Akamai CLI. This is useful for checking compatibility and update status. ```bash akamai --version ``` -------------------------------- ### Upgrade Akamai CLI Source: https://github.com/akamai/cli/blob/master/README.md Manually upgrades Akamai CLI to the latest version. If installed via Homebrew, use the `brew upgrade akamai` command instead. ```sh $ brew upgrade akamai ``` -------------------------------- ### Update Akamai CLI Packages Source: https://context7.com/akamai/cli/llms.txt Use `akamai update` to pull the latest changes for installed packages. It performs a git pull with a hard reset for repository-based packages or checks for version differences for binary installations. Use `AKAMAI_LOG=debug` for verbose logging. ```sh akamai update property-manager akamai update AKAMAI_LOG=debug akamai update property-manager # Expected console output (already up-to-date) # [spinner] Attempting to update "property-manager" command... ⚠ OK # command "property-manager" already up-to-date ``` -------------------------------- ### Run Akamai CLI Container with Persistent Configuration Source: https://github.com/akamai/cli/blob/master/README.md This command runs the Akamai CLI Docker container while persisting the CLI configuration and installed packages to a local directory. ```sh $ docker run -it -v $HOME/.akamai-cli:/cli/.akamai-cli akamai/shell ``` -------------------------------- ### Manage Akamai CLI Configuration Source: https://context7.com/akamai/cli/llms.txt Use `akamai config` sub-commands (`get`, `set`, `list`, `unset`/`rm`) to view and modify CLI configuration stored in `~/.akamai-cli/config`. Configuration values are also available as environment variables. ```bash # Read a single value akamai config get cli.last-upgrade-check ``` ```bash # Write a value akamai config set cli.last-upgrade-check ignore ``` ```bash # List all values in a section akamai config list cli ``` ```bash # List all values across all sections akamai config list ``` ```bash # Remove a value akamai config unset cli.last-upgrade-check ``` ```bash # Remove a value (alias) akamai config rm cli.last-upgrade-check ``` -------------------------------- ### Uninstall Akamai CLI Packages Source: https://context7.com/akamai/cli/llms.txt Use `akamai uninstall` to remove installed packages. Accepts one or more package names. This command removes the package source and any associated virtual environments. ```sh akamai uninstall purge akamai uninstall purge dns netstorage # Expected output # [spinner] Attempting to uninstall "purge" command... OK ``` -------------------------------- ### Create Root and Sub-package CLI Apps Source: https://context7.com/akamai/cli/llms.txt Build the main Akamai CLI application or a template for sub-package binaries. Ensure context is properly initialized with terminal and configuration settings. ```go import ( "context" "os" "github.com/akamai/cli/v2/pkg/app" "github.com/akamai/cli/v2/pkg/commands" "github.com/akamai/cli/v2/pkg/terminal" "github.com/akamai/cli/v2/pkg/config" ) ctx := context.Background() ctx = terminal.Context(ctx, terminal.Color()) cfg, _ := config.NewIni() ctx = config.Context(ctx, cfg) // Build the root Akamai CLI application cliApp := app.CreateApp(ctx) cliApp.Commands = append(commands.CommandLocator(ctx), cliApp.Commands...) cliApp.RunContext(ctx, os.Args) // Build a sub-package app template (for custom command packages) subApp := app.CreateAppTemplate(ctx, "purge", "Purge content from the edge", "", "1.0.5") // subApp.Name → "akamai purge" (when AKAMAI_CLI is set) // subApp.Flags includes --edgerc, --section, --accountkey subApp.Commands = []*cli.Command{ /* package-specific commands */ } subApp.RunContext(ctx, os.Args) ``` -------------------------------- ### Run Akamai CLI on Windows Source: https://github.com/akamai/cli/blob/master/README.md On Windows, after downloading the appropriate binary, you can execute it directly from the command line. ```sh $ akamai.exe help ``` -------------------------------- ### Display Help Information Source: https://github.com/akamai/cli/blob/master/README.md The --help flag displays basic usage information and a list of available commands. This is a fundamental command for exploring CLI capabilities. ```bash akamai --help ``` -------------------------------- ### Compile Akamai CLI from Source (Windows) Source: https://context7.com/akamai/cli/llms.txt Steps to compile the Akamai CLI from source on Windows systems. Requires Go 1.24.11+. ```bash # Windows go build -o akamai.exe cli/main.go ``` -------------------------------- ### Make Binary Executable and Move to PATH (Linux/macOS) Source: https://github.com/akamai/cli/blob/master/README.md After downloading the Akamai CLI binary for Linux or macOS, use these commands to make it executable and place it in your system's PATH for easy access. ```sh $ chmod +x ~/Downloads/akamai-- $ mv ~/Downloads/akamai-- /usr/local/bin/akamai ``` -------------------------------- ### Compile Akamai CLI from Source (Linux/macOS) Source: https://context7.com/akamai/cli/llms.txt Steps to clone the Akamai CLI repository and compile it from source on Linux or macOS systems. Requires Go 1.24.11+. ```bash # Prerequisites: Go 1.24.11+ git clone https://github.com/akamai/cli cd cli # Linux / macOS go build -o akamai cli/main.go mv akamai /usr/local/bin/akamai ``` -------------------------------- ### Basic Akamai CLI Command Structure Source: https://github.com/akamai/cli/blob/master/README.md Illustrates the fundamental structure of an Akamai CLI command, including global flags, command, action, and arguments. This is the general format for all CLI operations. ```bash akamai [global flags] [command] [action] [arguments...] ``` -------------------------------- ### Manage Configuration with IniConfig Source: https://context7.com/akamai/cli/llms.txt Use IniConfig to read, write, and persist configuration settings in ~/.akamai-cli/config. Settings can be exported as environment variables. ```go import ( "context" "github.com/akamai/cli/v2/pkg/config" ) cfg, err := config.NewIni() // opens or creates ~/.akamai-cli/config if err != nil { panic(err) } ctx := config.Context(context.Background(), cfg) // Read if val, ok := cfg.GetValue("cli", "last-upgrade-check"); ok { fmt.Println("Last check:", val) } // Write and persist cfg.SetValue("cli", "last-upgrade-check", "2025-12-10T14:00:00Z") cfg.Save(ctx) // Remove cfg.UnsetValue("cli", "last-upgrade-check") cfg.Save(ctx) // Export all keys as env vars // AKAMAI_CLI_LAST_UPGRADE_CHECK, AKAMAI_CLI_CACHE_PATH, … cfg.ExportEnv(ctx) // Enumerate all sections and keys for section, keys := range cfg.Values() { for key, val := range keys { fmt.Printf("%s.%s = %s\n", section, key, val) } } ``` -------------------------------- ### Configure Package Auto-completion Source: https://context7.com/akamai/cli/llms.txt Individual packages can opt into sub-command completion by setting 'auto-complete' to true in their cli.json command entry. ```json "auto-complete": true ``` -------------------------------- ### Specify .edgerc File Location Source: https://github.com/akamai/cli/blob/master/README.md Use the --edgerc flag to specify a custom configuration file path instead of the default ~/.edgerc. Useful for managing multiple sets of credentials. ```bash akamai --edgerc ~/.edgerc2 ... ``` -------------------------------- ### Specify Account Switch Key Source: https://github.com/akamai/cli/blob/master/README.md Use the --accountkey flag to specify an account switch key for accessing different Akamai accounts. This is essential when working with multiple account contexts. ```bash akamai --accountkey 1-ABCD:Z-XYZ ... ``` -------------------------------- ### Compile Akamai CLI with Build Tags Source: https://context7.com/akamai/cli/llms.txt Compile the Akamai CLI from source using specific build tags to disable features like auto-upgrade or first-run prompts, suitable for CI/CD or containerized environments. ```bash # Build with no auto-upgrade support (embedded build tag) go build -tags noautoupgrade -o akamai cli/main.go ``` ```bash # Build with no first-run prompts (CI / container use) go build -tags nofirstrun -o akamai cli/main.go ``` -------------------------------- ### Enable Bash and Zsh Auto-completion Source: https://context7.com/akamai/cli/llms.txt Add these commands to your shell configuration file (~/.bashrc, ~/.zshrc) to enable command auto-completion for Akamai CLI. ```bash eval "$(akamai --bash)" ``` ```bash eval "$(akamai --zsh)" ``` -------------------------------- ### Enable Shell Auto-Completion Source: https://context7.com/akamai/cli/llms.txt Activate Bash or Zsh tab completion for Akamai CLI commands by evaluating the output of `akamai --bash` or `akamai --zsh` in your shell profile. ```sh # Akamai CLI generates Bash/Zsh completion scripts dynamically. Eval the output of `akamai --bash` or `akamai --zsh` in your shell profile to enable tab completion for all installed commands. ``` -------------------------------- ### Configure Logging Levels and Output Source: https://context7.com/akamai/cli/llms.txt Control Akamai CLI logging verbosity using the AKAMAI_LOG environment variable. Redirect logs to a file using AKAMAI_CLI_LOG_PATH. ```sh # Levels: fatal | error | warn | info | debug AKAMAI_LOG=debug akamai install property-manager # 2025/12/10 14:00:01 DEBUG INSTALL START # 2025/12/10 14:00:01 DEBUG Installing package from repository: https://github.com/akamai/cli-property-manager.git # 2025/12/10 14:00:02 DEBUG Installing dependencies for package in directory: ... # 2025/12/10 14:00:05 DEBUG INSTALL FINISH: 4.231s # Write logs to a file while still printing to terminal AKAMAI_LOG=info AKAMAI_CLI_LOG_PATH=akamai.log akamai update property-manager ``` -------------------------------- ### Enable Debug Logging for Akamai CLI Source: https://github.com/akamai/cli/blob/master/README.md Prepends `AKAMAI_LOG=` to any CLI command to enable additional log information. Use `debug` for extensive details. ```sh AKAMAI_LOG=debug akamai update property-manager ``` -------------------------------- ### Enable Zsh Auto-completion Source: https://github.com/akamai/cli/blob/master/README.md The --zsh flag provides instructions on how to set up auto-completion for Akamai CLI commands in a zsh shell, enhancing command-line productivity. ```bash akamai --zsh ``` -------------------------------- ### Enable Bash Auto-completion Source: https://github.com/akamai/cli/blob/master/README.md The --bash flag provides instructions on how to set up auto-completion for Akamai CLI commands in a bash shell, improving command-line efficiency. ```bash akamai --bash ``` -------------------------------- ### Specify Configuration Section Source: https://github.com/akamai/cli/blob/master/README.md Use the --section flag to select a specific configuration section within your .edgerc file, overriding the default 'default' section. This allows for distinct API access configurations. ```bash akamai --section cps ... ``` -------------------------------- ### Create Akamai CLI Docker Alias Source: https://context7.com/akamai/cli/llms.txt Create a shell alias to run the Akamai CLI command transparently through Docker, simplifying its usage. ```bash # Create a shell alias so the `akamai` command runs Docker transparently alias akamai='docker run -it -v $HOME/.edgerc:/root/.edgerc:ro akamai/shell' ``` -------------------------------- ### Akamai CLI Environment Variables Source: https://context7.com/akamai/cli/llms.txt Environment variables that provide equivalents to global flags, useful for configuring Akamai CLI in CI/CD pipelines or automated environments. ```bash # Environment variable equivalents (useful in CI/CD) export AKAMAI_EDGERC=~/.edgerc export AKAMAI_EDGERC_SECTION=staging export AKAMAI_EDGERC_ACCOUNT_KEY=1-ABCD:Z-XYZ akamai property-manager list-properties ``` ```bash # Run CLI in background/daemon mode (useful in Docker) AKAMAI_CLI_DAEMON=1 akamai ``` -------------------------------- ### Set Proxy for CLI Commands Source: https://github.com/akamai/cli/blob/master/README.md Use the --proxy flag to configure an HTTP proxy for Akamai CLI commands. This is necessary when operating within networks that require proxying. ```bash akamai --proxy http://example.com:8080 ... ``` -------------------------------- ### Upgrade Akamai CLI Binary Source: https://context7.com/akamai/cli/llms.txt Use `akamai upgrade` to update the Akamai CLI host binary itself. It downloads the latest release, verifies the signature, and replaces the current executable. You can specify a custom mirror using `CLI_REPOSITORY`. ```sh akamai upgrade CLI_REPOSITORY=https://my.mirror.example.com/akamai/cli akamai upgrade # Expected output (new version available) # [spinner] Checking for upgrades... OK # [spinner] Upgrading Akamai CLI OK # Expected output (already current) # [spinner] Checking for upgrades... ⚠ OK # Akamai CLI (v2.0.3) is already up-to-date # Homebrew users should upgrade via Homebrew instead: brew upgrade akamai ``` -------------------------------- ### Alias Akamai CLI command to Docker container Source: https://github.com/akamai/cli/blob/master/README.md Add this alias to your shell configuration file (.bashrc, .bash_profile, or .zshrc) to use the 'akamai' command directly, which will launch the Docker container. ```sh alias akamai='docker run -it -v $HOME/.edgerc:/root/.edgerc:ro akamai/shell' ``` -------------------------------- ### Redirect Akamai CLI Logs to a File Source: https://github.com/akamai/cli/blob/master/README.md Uses the `AKAMAI_CLI_LOG_PATH` environmental variable to redirect logs to a specified file, in addition to setting the logging level. ```sh AKAMAI_LOG=debug AKAMAI_CLI_LOG_PATH=akamai.log akamai update property-manager ``` -------------------------------- ### Bash Auto-completion Function Source: https://context7.com/akamai/cli/llms.txt This is the generated bash completion function for Akamai CLI. It is typically added to your ~/.bashrc or ~/.bash_profile. ```bash # The generated bash completion function: # _akamai_cli_bash_autocomplete() { # local cur opts base # COMPREPLY=() # cur="${COMP_WORDS[COMP_CWORD]}" # opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-bash-completion ) # COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) # return 0 # } # complete -F _akamai_cli_bash_autocomplete akamai ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.