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:
[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:
| Variable | Meaning |
|---|---|
ACLOUD_TOKEN | API token. |
ACLOUD_PROFILE | Profile name. Default default. |
ACLOUD_API_URL | API base URL. |
NO_COLOR | Disable color output. |
Global flags
| Flag | Meaning |
|---|---|
--profile NAME | Use this profile from the config file. |
--api-url URL | Override the API URL. |
-o, --output FORMAT | table (default on a terminal), json or yaml. |
--timeout DURATION | Per-request timeout, such as 30s. Default 30s. |
--no-color | Disable color. |
--debug | Print requests and response headers to stderr. Tokens are redacted. |
-h, --help | Help for any command. |
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success. |
| 1 | Error from the API or the CLI. |
| 2 | Usage error: unknown flag or missing argument. |
| 3 | Authentication or authorization failure. |
| 4 | Not found. |
| 5 | --wait or --follow timed out. |
| 6 | A 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 statusShows 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 listLists 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 FILEUploads 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|cyclePower 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 IDBoots the rescue image and prints a one-hour SSH password.
acloud server console IDOpens 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 listBase 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
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 listShows 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 versionPrints the CLI and API versions.
acloud completion bash|zsh|fishPrints a shell completion script.