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

Installation

Global Install (requires sudo)

sudo curl -L https://cli.ankra.io/install.sh | bash

User-Local Install (no sudo, adds to ~/bin)

curl -L https://cli.ankra.io/install.sh | bash -s -- --user

Note: After installation, verify with:

ankra --version

Post-Installation Setup

Set the required environment variables:

Export for Current Session

export ANKRA_API_TOKEN=your-token-here
export ANKRA_BASE_URL=https://platform.ankra.app  # optional

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

echo 'export ANKRA_API_TOKEN=your-token-here' >> ~/.zshrc
echo 'export ANKRA_BASE_URL=https://platform.ankra.app' >> ~/.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 or stack and save as active.
  • Usage:
    ankra select cluster
    ankra select stacks
    
  • 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.