What is Ankra CLI?

The Ankra CLI is a secure, robust, and user-friendly command-line interface for interacting with the Ankra platform. It enables you to manage clusters, deploy addons, and automate platform operations directly from your terminal. Main use cases:
  • Cluster management (create, select, delete, etc.)
  • Addon deployment (e.g., fluent-bit, cert-manager)
  • Automation of platform operations

Features

  • Easy cluster selection and management
  • Addon deployment and management
  • Secure authentication via API token
  • Supports both global and user-local installation
  • Clear versioning and help commands

Single Command Installation

Recommended Installation (Universal):
bash <(curl -sL https://github.com/ankraio/ankra-cli/releases/latest/download/install.sh)
Note: After installation, verify with:
ankra --version

Direct Download

If you prefer not to use the install script, you can download the Ankra CLI binary directly: Download ankra CLI binary After downloading, make it executable and move it to a directory in your PATH:
chmod +x ankra
mv ankra ~/bin/ankra  # or /usr/local/bin/ankra
Note: You may need to create the ~/bin directory and add it to your PATH if it doesn’t exist.

Post-Installation Setup

Set the required environment variables:

Export for Current Session

export ANKRA_API_TOKEN=your-token-here

Add to Shell Profile (~/.zshrc or ~/.bashrc)

echo 'export ANKRA_API_TOKEN=your-token-here' >> ~/.zshrc
# or use ~/.bashrc for bash users
Tip: Reload your shell profile after editing:
source ~/.zshrc
# or
source ~/.bashrc

Quick Start

List Clusters

ankra get clusters

Select a Cluster

ankra select cluster

List Addons

ankra get addons

Get Addon Details

ankra get addons kube-prometheus-stack

List Stacks

ankra get stacks

Get Stack Details

ankra get stacks infisical

List Operations

ankra get operations

Get Operation Details

ankra get operations aba25aaf-cfa8-4724-aa05-29aca9bf1997

Get Jobs for an Operation

ankra get jobs aba25aaf-cfa8-4724-aa05-29aca9bf1997

Get Help

ankra --help
ankra get --help
ankra select --help

Command Reference

Global Flags

FlagDescription
--versionShow CLI version
--helpShow help for any command
--base-urlBase URL for the Ankra API
--configConfig file (default is $HOME/.ankra.yaml)
--tokenAPI token for authentication

Main Commands

get

  • Description: Retrieve resources (clusters, stacks, addons, operations, jobs, manifests).
  • Usage:
    ankra get [resource] [name] [flags]
    
  • Examples:
    • List clusters: ankra get clusters
    • List stacks: ankra get stacks
    • Get stack details: ankra get stacks infisical
    • List addons: ankra get addons
    • Get addon details: ankra get addons kube-prometheus-stack
    • List operations: ankra get operations
    • Get operation details: ankra get operations <operation-id>
    • Get jobs for an operation: ankra get jobs <operation-id>
  • Flags:
    FlagDescription
    -h, --helpShow help for get command

select

  • Description: Interactively select a cluster and save as active.
  • Usage:
    ankra select cluster
    
  • Flags:
    FlagDescription
    -h, --helpShow help for select command

apply

  • Description: Apply an addon or manifest to the selected cluster.
  • Usage:
    ankra apply addon <addon-name>
    ankra apply manifest <manifest-file.yaml>
    
  • Flags:
    FlagDescription
    --helpShow help for apply command

delete

  • Description: Delete a cluster, addon, or manifest.
  • Usage:
    ankra delete cluster <cluster-name>
    ankra delete addon <addon-name>
    ankra delete manifest <manifest-name>
    
  • Flags:
    FlagDescription
    --helpShow help for delete command
Note: Use ankra <command> --help for detailed options on any command.

Troubleshooting

  • PATH issues: Ensure ankra is in your PATH. If not, add ~/bin or the install location to your PATH.
  • Missing dependencies: The CLI requires curl and bash for installation.
  • Check version:
    ankra --version
    
  • Verify installation:
    which ankra
    ankra --help
    
  • Common errors:
    • Resource not found: Double-check the resource name and active cluster.
    • Unstaged changes (git): Commit or stash changes before pulling updates.

Support & Resources

For more advanced usage, see the full documentation or contact support.