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.

Installation

The formula lives in the ankraio/homebrew-tap tap and is bumped automatically on every stable release. Upgrade later with Homebrew as usual:

Install script

For macOS and Linux without Homebrew - and for CI runners - use the universal installer:
It detects your OS and architecture, verifies the download against its published SHA-256 checksum, strips the macOS quarantine attribute where needed, and installs to /usr/local/bin/ankra. Pin an exact release by appending --version <tag>. After installing either way, verify with:

Direct Download

Download the binary directly from GitHub Releases.

Upgrading the CLI

If you installed with Homebrew, upgrade through Homebrew:
A Homebrew-managed binary refuses ankra upgrade and points you at brew upgrade ankra instead, so the two upgrade paths never fight over the same file. For script and manual installs, the CLI can update itself in place with ankra upgrade (aliased as ankra self-update). The downloaded binary is verified against its published SHA-256 checksum before it replaces the running executable.
If the binary lives in a root-owned location, run sudo ankra upgrade or re-run the install script.

Beta (pre-release) channel

Opt in to release candidates (such as v0.3.0-rc.1) so ankra upgrade resolves the newest release including pre-releases:
The channel preference is stored locally in ~/.ankra/settings.json (separate from your credentials).

Authentication

The easiest way to authenticate is using browser-based SSO:
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:

Environment Variables (Alternative)

You can also use environment variables:
Add to your shell profile (~/.zshrc or ~/.bashrc) for persistence.

Quick Start

Machine-readable output (-o json|yaml)

Commands that read or return data support structured output via the shared -o/--output flag, so scripts and AI agents never have to parse tables or prose:
  • -o json prints the result as indented JSON; -o yaml emits the same data as YAML.
  • The kubectl-style commands (cluster get ..., cluster describe, cluster events, cluster logs, cluster top ..., cluster helm releases, cluster metrics ...) default to -o table and accept json/yaml as alternatives.
Write commands (reconcile, provision, deprovision, scaling, node groups, token creation, …) also accept -o json and emit the API result - including operation IDs - so automation can poll ankra cluster operations list <id> -o json for completion. Asynchronous writes submitted without --wait emit {"submitted": true, ...}.

Command Reference

The full command reference - every command, subcommand, flag, and default - is generated from the CLI source on each release, so it never drifts:

CLI Command Reference

Browse all 21 command families: cluster, credentials, tokens, profile, org, chat, agents, application, skills, and more.
Every guide that shows an ankra command carries a CLI vX.Y.Z+ marker above it: the first stable release that shipped the command. Compare it with ankra --version; a marker newer than the latest stable release means a pre-release command, reachable through the beta channel. Highlights: ankra migrate up is the one that does the most in a single call: it converts a Docker Compose deployment into a stack, applies it to a cluster, and restores the deployment’s PostgreSQL, MySQL and MariaDB data into it. Run it with --plan first to see what it found. See Move a Docker deployment into a cluster. The conversion is done by a module, and docker is only the built-in one: another source format is an executable named ankra-module-<name> that the CLI talks JSON to, installed with ankra migrate modules install <url> or placed on PATH, and Write an ankra migrate module is the contract. The CLI is also extensible beyond migration, kubectl style: an unknown command runs an executable named ankra-<command> from ~/.ankra/plugins or PATH, and ankra plugins lists what is installed.

Agent Skills

The CLI carries Ankra’s curated Agent Skills - SKILL.md files that teach your AI assistant (Claude Code, the Claude app, Cursor, Codex, GitHub Copilot, Windsurf, Gemini CLI and others) to manage Kubernetes the Ankra way. ankra skills install detects the assistants on your machine and installs into all of them. See the Agent Skills guide.

Configuration

The CLI stores configuration in ~/.ankra.yaml:
Token resolution priority (highest to lowest):
  1. --token flag (explicit CLI argument)
  2. Config file token (saved by ankra login)
  3. ANKRA_API_TOKEN environment variable
The base URL can be overridden with --base-url or the ANKRA_BASE_URL environment variable.

Troubleshooting

Common Issues

PATH issues:
Authentication errors:
Check version:
Get 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.