Tools
CLI
The ankra-cloud command line tool for servers, storage, networks and every other API operation, with JSON output and waiting for operations.
ankra-cloud manages one Ankra Cloud account from a terminal or a script. It has curated commands for the everyday
resources and a generic ankra-cloud api <operation_id> that calls any operation an API token may call.
Install#
The CLI is a single static Go binary built from the Ankra Cloud repository:
make cli-build # writes bin/ankra-cloud
make cli-linux # bin/linux-amd64/ankra-cloud for Linux servers
Configure#
export ANKRA_CLOUD_ENDPOINT=https://cloud.ankra.app
export ANKRA_CLOUD_TOKEN=act_...
| Setting | Flag | Environment |
|---|---|---|
| API token | none, on purpose | ANKRA_CLOUD_TOKEN |
| Endpoint | --endpoint |
ANKRA_CLOUD_ENDPOINT |
| Private certificate authority | --certificate-authority |
ANKRA_CLOUD_CERTIFICATE_AUTHORITY |
The token is read only from the environment, never from a flag, so it never shows in process listings or shell
history. Create one under Settings → API tokens; a read token is a safe way to explore.
Everyday commands#
ankra-cloud zones list
ankra-cloud plans list
ankra-cloud templates list
ankra-cloud servers create --zone se-sto1 --hostname web-1 --plan starter-1c-1g \
--template debian-13 --ssh-key-file ~/.ssh/id_ed25519.pub --wait
ankra-cloud servers list
ankra-cloud servers get <server-id>
ankra-cloud servers stop <server-id> --wait
ankra-cloud servers delete <server-id> --keep-storages --wait
| Group | Commands |
|---|---|
zones, plans, templates, storage-tiers |
list |
quotas |
limits and usage |
servers |
list, get, create, start, stop, restart, delete |
storages |
list, get, create, attach, detach, resize, backup, delete |
object-storage (s3) |
list, enable <zone>, credentials <zone>, rotate-keys <zone>, env <zone> |
backups |
list, get, restore, delete |
custom-images |
list, copy, delete |
networks |
list, get, create, delete |
routers |
list, get, create, attach-network, detach-network, set-nat, delete |
floating-ips |
list, get, allocate, assign, release |
firewall |
get, set --file firewall.json |
operations |
get, wait |
audit |
list, export, integrity |
dns |
import, import verify (see "Move a DNS zone") |
ankra-cloud object-storage env <zone> prints AWS_ENDPOINT_URL, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and
AWS_REGION as shell exports, so eval "$(ankra-cloud object-storage env se-sto1)" points aws, rclone and the AWS
SDKs at the zone. A comment in the output names the zone's bucket prefix, where every bucket name must start with one,
and says when the endpoint needs a private certificate authority. The same operations are MCP tools
(enable_object_storage and the others) and the Terraform resource ankracloud_object_storage. list shows each
zone's backend and durability; see Object storage.
ankra-cloud <group> --help lists each command's flags. servers create takes --ssh-key and --ssh-key-file
(repeatable, at least one), --network <network-id>[=<address>], --user-data-file, --storage-gibibytes,
--storage-tier, --public-ipv4 for the IPv4 add-on and --no-public-ipv6.
Move a DNS zone: ankra-cloud dns import#
dns import moves a zone from Cloudflare or from any provider's zone file into hosted DNS, and says what will not
work after the move before anything changes. Without --apply it only plans; with it, it claims the zone, verifies
ownership and loads the records. Running it again is safe: it converges and never creates a record twice, and it never
deletes one.
export CLOUDFLARE_API_TOKEN=... # Zone Read and DNS Read; Email Routing Rules Read and Page Rules Read to report more
ankra-cloud dns import --zone example.com --cloudflare # plan only
ankra-cloud dns import --zone example.com --cloudflare --publish-challenge \
--verify-timeout 10m --apply # claim, verify, load
ankra-cloud dns import --zone example.com --zone-file example.com.zone --apply
ankra-cloud dns import verify --zone example.com --cloudflare # MATCH or DIFF per record set
Move a zone in this order:
- Import and read every finding.
NOT_PORTABLEis not imported and must be rebuilt elsewhere;BREAKS_AFTER_MOVEis imported but stops once the nameservers leave the old provider. Typical ones from Cloudflare: Email Routing (Cloudflare forwards mail only while it serves the zone, so set up another mail provider for the routes the plan lists), page and redirect rules (serve the redirect from your origin), proxied records (clients will reach the origin directly; a dummy address such as192.0.2.1is not imported) and DNSSEC. - Verify parity with
dns import verifyuntil every record set isMATCH(orEXPECTED, for records Cloudflare's proxy answers with its own addresses). - Fix the non-portable features while the old provider still serves the zone.
- Lower the TTLs at the old provider to 300 s and wait out the old TTL.
- Change the nameservers at the registrar to the zone's nameservers. If DNSSEC was on, remove the DS record at the registrar first and wait for its TTL to pass.
- Remove the
_ankra-cloud-challengeTXT record at the old provider. - Keep the old provider's zone for at least a week, so pointing the registrar back undoes the move. Then delete it.
TXT values that a provider splits into several quoted strings (long DKIM keys) are joined into one value, and
Cloudflare's "Auto" TTL becomes 300 seconds. The Cloudflare token is read only from CLOUDFLARE_API_TOKEN.
Waiting and output#
- Writes answer at once with the operation that carries them out. Add
--waitto wait for it (up to--timeout, 30 minutes by default) and print the result;ankra-cloud operations wait <id>waits for any operation. -o table(default) prints tables;-o jsonprints the API's JSON for scripts andjq.- Exit codes:
0on success,1when the API or an operation fails,2for usage and configuration mistakes.
Any operation: ankra-cloud api#
Every operation in the API reference has a stable operationId. ankra-cloud api calls it by
name, so the CLI reaches everything, curated command or not:
ankra-cloud api list # the operations an API token may call
ankra-cloud api list --all # every operation, with who may call it
ankra-cloud api get_server -p id=<server-id>
ankra-cloud api list_servers -p label=env=prod -p limit=20
ankra-cloud api create_edge --data @edge.json
ankra-cloud api redeem_coupon --data '{"code": "CODE"}'
-p name=value(repeatable) fills a path or query parameter.--datais the JSON request body, inline or@file.- The answer is printed as the API sent it, JSON indented. An answer outside 2xx exits with code 1.
Operations that need a signed-in session, a staff session or an operator token appear with --all but cannot be
called with an API token.