CLI reference

acloud is a thin client over the REST API. Anything it does, you can do with curl. Current version: 1.7.1.

Installation and configuration

Download the binary for your platform from Settings, CLI downloads in the console and verify it against the checksum file. See Getting started.

Configuration lives in ~/.config/acloud/config.toml, with one table per profile:

~/.config/acloud/config.toml
[default]
api_url = "https://api.ansiblecloud.io/v1"
token = "acl_..."
output = "table"

[ci]
token_cmd = "cat /run/secrets/acloud_token"
output = "json"

These environment variables override the file:

VariableMeaning
ACLOUD_TOKENAPI token.
ACLOUD_PROFILEProfile name. Default default.
ACLOUD_API_URLAPI base URL.
NO_COLORDisable color output.

Global flags

FlagMeaning
--profile NAMEUse this profile from the config file.
--api-url URLOverride the API URL.
-o, --output FORMATtable (default on a terminal), json or yaml.
--timeout DURATIONPer-request timeout, such as 30s. Default 30s.
--no-colorDisable color.
--debugPrint requests and response headers to stderr. Tokens are redacted.
-h, --helpHelp for any command.

Exit codes

CodeMeaning
0Success.
1Error from the API or the CLI.
2Usage error: unknown flag or missing argument.
3Authentication or authorization failure.
4Not found.
5--wait or --follow timed out.
6A job or build you waited on finished unsuccessfully.

auth

acloud auth login [--token-stdin] [--profile NAME]

Saves a token to the profile. With --token-stdin it reads the token from standard input and does not prompt.

acloud auth status

Shows the account, the token's scopes and its expiry.

acloud auth logout [--profile NAME]

Removes the token from the profile.

site and plan

acloud site list

Lists sites and their status.

acloud plan list [--site SITE]

Lists server plans with price and power draw in the --output json form.

ssh-key

acloud ssh-key add NAME FILE

Uploads a public key.

acloud ssh-key list
acloud ssh-key delete ID

server

acloud server list [--site SITE] [--status STATUS] [--label KEY=VALUE]...

--label can be repeated and filters are combined with AND.

acloud server create --site SITE --plan PLAN --image IMAGE --name NAME --ssh-key KEY [--label KEY=VALUE]... [--user-data FILE] [--wait] [--timeout 20m]

Creates a server. --wait blocks until it is active and prints the address. Exits with 5 if --timeout passes first.

acloud server get ID
acloud server power ID on|off|cycle

Power action. Returns when the BMC reports the new state.

acloud server reinstall ID --image IMAGE [--yes]

Erases the drives and installs the image.

acloud server rescue ID

Boots the rescue image and prints a one-hour SSH password.

acloud server console ID

Opens the serial console in your terminal. Press Ctrl-] then q to leave.

acloud server delete ID [--yes]

Deletes the server. Without --yes it asks for the server name.

$ acloud server list --site denver --label env=staging
ID                              NAME      SITE     PLAN   STATUS  ADDRESS
srv_01JC7SFX0RZ8M2K5Q4PYN7A3VB  batch-01  denver   c2.32  active  203.0.113.41

image

acloud image list

Base and custom images.

acloud image build --from FILE [--name NAME] [--wait] [--timeout 30m]

Builds a custom image from an image.yml with the keys name, base, size_gb, packages, project and playbook. --name overrides the file.

acloud image delete ID
image.yml
name: batch-debian13
base: debian-13
size_gb: 20
packages:
  - chrony
  - nvme-cli
project: platform-playbooks
playbook: playbooks/harden.yml

runbook and job

acloud runbook list
acloud runbook launch NAME_OR_ID [--limit PATTERN] [--extra-vars @FILE|JSON] [--tags TAGS] [--check] [--follow] [--wait]

Launches a job. --follow streams events and implies --wait. Exits with 6 if the job fails.

acloud job list [--status STATUS] [--runbook NAME_OR_ID]
acloud job get ID
acloud job logs ID [--follow]

Prints events. With --follow it streams until the job ends and reconnects if the connection drops.

acloud job cancel ID...

Cancels one or more jobs.

inventory

acloud inventory list
acloud inventory sync ID [--wait]

Re-reads all inventory sources.

token

acloud token list

Shows last_used_at and last_used_ip.

acloud token create --name NAME --scope SCOPE... [--expires DURATION] [--allow-cidr CIDR]...

--scope and --allow-cidr are repeatable. --expires takes values like 30d and defaults to 90d; the maximum is 365d.

acloud token revoke ID

audit

acloud audit list [--action ACTION] [--actor EMAIL] [--since TIME]

Other commands

acloud version

Prints the CLI and API versions.

acloud completion bash|zsh|fish

Prints a shell completion script.