Skip to main content

What is Ankra CLI?

The Ankra CLI is a powerful command-line interface for interacting with the Ankra platform. It enables you to manage clusters, chat with AI about your infrastructure, browse Helm charts, manage credentials, deploy stacks, and automate platform operations directly from your terminal. Main use cases:
  • SSO authentication with the Ankra platform
  • AI-powered chat for troubleshooting and assistance
  • Cluster management (list, select, reconcile, clone)
  • Stack management (create, list, rename, delete)
  • Helm chart discovery and search
  • Credentials management
  • API token management

Features

  • SSO Login - Browser-based authentication with PKCE
  • AI Chat - Interactive and one-shot AI-powered troubleshooting
  • Cluster Management - List, select, reconcile, and clone clusters
  • Stack Management - Create, list, rename, delete, and view stack history
  • Helm Charts - Browse, search, and get details on available charts
  • Credentials - Manage cloud provider and Git credentials
  • API Tokens - Create, list, revoke, and delete API tokens
  • Secure - Credentials stored locally in ~/.ankra.yaml

Installation

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

Direct Download

Download the binary directly from GitHub Releases.
chmod +x ankra
mv ankra ~/bin/ankra  # or /usr/local/bin/ankra

Authentication

The easiest way to authenticate is using browser-based SSO:
ankra login
This will:
  1. Open your browser to the Ankra login page
  2. After you authenticate, save your credentials locally
  3. You can then use all ankra CLI commands
Your credentials are saved to ~/.ankra.yaml. To logout and clear credentials:
ankra logout

Environment Variables (Alternative)

You can also use environment variables:
export ANKRA_API_TOKEN=your-token-here
export ANKRA_BASE_URL=https://platform.ankra.app  # optional
Add to your shell profile (~/.zshrc or ~/.bashrc) for persistence.

Quick Start

# 1. Login with SSO
ankra login

# 2. List your clusters
ankra cluster list

# 3. Select a cluster to work with
ankra cluster select

# 4. Start chatting with AI about your infrastructure
ankra chat "What's the status of my deployments?"

Command Reference

Authentication

login

Authenticate with the Ankra platform using browser-based SSO.
ankra login

logout

Remove saved credentials from ~/.ankra.yaml.
ankra logout

AI Chat

chat

AI-powered chat for troubleshooting and assistance. Interactive mode:
ankra chat
ankra chat --cluster my-cluster  # with cluster context
One-shot mode:
ankra chat "Why are my pods in CrashLoopBackOff?"
ankra chat --cluster staging "How do I scale my deployment?"
Commands in interactive mode:
  • exit, quit, q - Exit chat
  • clear - Clear conversation history

chat health

Get AI-analyzed cluster health for the selected cluster.
ankra chat health
ankra chat health --ai  # include detailed AI analysis

chat history

List previous chat conversations.
ankra chat history
ankra chat history --cluster my-cluster  # filter by cluster
ankra chat history --limit 10

chat show

Show a specific conversation.
ankra chat show <conversation_id>

chat delete

Delete a conversation.
ankra chat delete <conversation_id>

Cluster Operations

cluster list

List all clusters.
ankra cluster list

cluster get

Get details of a specific cluster.
ankra cluster get <cluster-name>

cluster select

Interactively select a cluster for subsequent commands.
ankra cluster select

cluster reconcile

Trigger cluster reconciliation to sync desired state with actual state.
ankra cluster reconcile                  # uses selected cluster
ankra cluster reconcile <cluster-name>   # specific cluster

cluster clone

Clone stacks from an existing cluster to a new cluster configuration.
# Clone all stacks
ankra cluster clone source-cluster.yaml new-cluster.yaml

# Clone from a remote URL
ankra cluster clone https://github.com/org/repo/raw/main/cluster.yaml new-cluster.yaml

# Clone only specific stacks
ankra cluster clone cluster.yaml new-cluster.yaml --stack "monitoring" --stack "networking"

# Replace all stacks in target
ankra cluster clone cluster.yaml new-cluster.yaml --clean

# Force merge even with conflicts
ankra cluster clone cluster.yaml new-cluster.yaml --force

# Copy missing files from skipped stacks
ankra cluster clone cluster.yaml new-cluster.yaml --copy-missing

Stack Management

All stack commands operate on the currently selected cluster.

cluster stacks list

List all stacks for the active cluster.
ankra cluster stacks list
ankra cluster stacks list <stack-name>  # show details for a specific stack

cluster stacks create

Create a new stack.
ankra cluster stacks create my-stack
ankra cluster stacks create my-stack --description "Application stack"

cluster stacks delete

Delete a stack.
ankra cluster stacks delete <stack-name>

cluster stacks rename

Rename a stack.
ankra cluster stacks rename <old-name> <new-name>

cluster stacks history

Show change history for a stack.
ankra cluster stacks history <stack-name>

Helm Charts

charts list

List available Helm charts.
ankra charts list
ankra charts list --page 2 --page-size 50
ankra charts list --subscribed  # show only subscribed charts
Search for Helm charts by name.
ankra charts search nginx
ankra charts search prometheus

charts info

Get detailed information about a chart.
ankra charts info nginx
ankra charts info grafana --repository https://grafana.github.io/helm-charts

Credentials

credentials list

List all credentials.
ankra credentials list
ankra credentials list --provider github  # filter by provider
Aliases: ankra creds, ankra cred, ankra credential

credentials get

Get details of a specific credential.
ankra credentials get <credential_id>

credentials validate

Check if a credential name is available.
ankra credentials validate my-new-credential

credentials delete

Delete a credential.
ankra credentials delete <credential_id>

API Tokens

tokens list

List all API tokens.
ankra tokens list
Alias: ankra token list

tokens create

Create a new API token.
ankra tokens create my-ci-token
ankra tokens create my-temp-token --expires "2024-12-31T00:00:00Z"

tokens revoke

Revoke an API token (must be revoked before deletion).
ankra tokens revoke <token_id>

tokens delete

Delete a revoked API token.
ankra tokens delete <token_id>

Global Flags

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

Configuration

The CLI stores configuration in ~/.ankra.yaml:
token: your-api-token
base-url: https://platform.ankra.app
token_id: token-uuid
token_name: ankra-cli-hostname-username
Environment variables take precedence over config file values:
  • ANKRA_API_TOKEN - Override the stored token
  • ANKRA_BASE_URL - Override the base URL

Troubleshooting

Common Issues

PATH issues:
which ankra  # verify installation location
echo $PATH   # check PATH includes ankra location
Authentication errors:
ankra logout  # clear credentials
ankra login   # re-authenticate
Check version:
ankra --version
Get help:
ankra --help
ankra cluster --help
ankra chat --help

Error Messages

  • “No active cluster selected” - Run ankra cluster select first
  • “Resource not found” - Verify the resource name and selected cluster
  • “Unauthorized” - Re-authenticate with ankra login

Support & Resources

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