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
Homebrew (recommended for macOS and Linux)
Install script
For macOS and Linux without Homebrew - and for CI runners - use the universal installer:/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: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.
Beta (pre-release) channel
Opt in to release candidates (such asv0.3.0-rc.1) so ankra upgrade resolves the newest release including pre-releases:
~/.ankra/settings.json (separate from your credentials).
Authentication
SSO Login (Recommended)
The easiest way to authenticate is using browser-based SSO:- Open your browser to the Ankra login page
- After you authenticate, save your credentials locally
- You can then use all ankra CLI commands
~/.ankra.yaml.
To logout and clear credentials:
Environment Variables (Alternative)
You can also use environment variables:~/.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 jsonprints the result as indented JSON;-o yamlemits 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 tableand acceptjson/yamlas alternatives.
-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, ...}.
Projects
ankra project, the global --project flag and ANKRA_PROJECT, ankra tokens create --project, ankra org invite --role project and the cost and usage project options require Ankra CLI v0.49.0 or later. Check with ankra --version and upgrade with ankra upgrade. Projects themselves are already on for every organisation on the new portal: older CLIs act in your current project, the one the console shows.--project or ANKRA_PROJECT names, else the one ankra project switch saved on this machine for this organisation, else your current project as the console shows it. ankra project manages projects and your place in them:
--id on a move also takes a cluster or application name. ankra project switch saves the project on this machine for the organisation you are in (ankra org switch forgets it), and it applies only when you act with your ankra login session, not with a token supplied by flag or environment variable; ankra project current says whether a flag, that saved selection or the platform’s current project decides. To act in another project for one command, use the global --project <slug|name|id> flag or the ANKRA_PROJECT environment variable. Like --org, it applies to every command and every request of the invocation, sent as X-Ankra-Project-Id, without moving your current project:
--role project on ankra org invite makes a project-only member of the project the global --project names; --project-role is admin, operator, member or viewer, member by default. ankra project move refuses with the platform’s code and sentence when the resource is already in that project (same_project), when operations are still running on a cluster (operations_in_flight), or when a DNS zone is bound to a cluster and follows it (follows_cluster). The kinds it accepts are listed on the Projects page.
Tokens take a project at creation: ankra tokens create <name> --project payments mints a token pinned to that project, see API tokens. The fleet cost reads (ankra cost summary, savings, ledger, trend, events, reconcile and cost budgets list) cover the project you act in and take --all-projects for the whole organisation; ankra cost object project <project> prices one project, and ankra org usage --group-by project splits worker vCPU-hours by project. See Cloud Cost and Usage. In an organisation with projects off (one whose portal is not yet the new one; the new portal carries /next in its address), every ankra project command exits 3 and says so.
ankra project is unrelated to ankra registry projects, which are the projects of your image registry. Because --project is now the global flag, two older local flags were renamed: ankra registry robots create --project is --registry-project, and ankra skills list|install|uninstall|clients --project <dir> is --dir <dir>. The old spellings still work on those commands for one minor release with a deprecation line, and there they still mean the registry project or the directory; use ANKRA_PROJECT to pick an Ankra project on those commands until the old flags are removed.
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 32 command families: cluster, credentials, tokens, profile, org, chat, agents, application, skills, and more.
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:
--tokenflag (explicit CLI argument)- Config file token (saved by
ankra login) ANKRA_API_TOKENenvironment variable
--base-url or the ANKRA_BASE_URL environment variable.
Troubleshooting
Common Issues
PATH issues:Error Messages
- “No active cluster selected” Run
ankra cluster selectfirst - “Resource not found” Verify the resource name and selected cluster
- “Unauthorized” Re-authenticate with
ankra login
Support & Resources
- Slack: Join Ankra Community
- Email: [email protected]
- GitHub: ankraio/ankra-cli
For more advanced usage, see the full documentation or contact support.