⚖️ Four Cloud CLIs Side by Side: az, aws, gcloud and oci

The same job in four command-line tools: signing in, finding out where you are, defaults, output, queries (with a JMESPath primer), help, and cleaning up

💡 How this page was made. It collects what the four CLI pages found, so it inherits their method: the offline parts (versions, errors, config files, help, queries on built-in data) were run for real on 6 October 2026 with az 2.91.0, aws-cli 2.37.9, gcloud 588.0.0 and oci 3.94.2, in throwaway folders with empty home directories. Anything that needs a signed-in account is from the documentation, not run here. The detail is on the pages for az, aws, gcloud and oci.

The shape of a command

The version command is the same everywhere in spirit: az --version, aws --version, gcloud --version, oci --version.

What each says when you are not signed in

All four were run unsigned. The wording (real) tells you which tool you are looking at:

Signing in

Without installing anything: Cloud Shell exists on all four clouds, and each one has the CLI ready and signed in.

Where am I?

The most useful habit across all four: ask the tool who and where you are before you change anything.

Choosing the account, project or subscription

Defaults for region, location, group, project

Where the settings live: ~/.azure/, ~/.aws/, ~/.config/gcloud/, ~/.oci/. Treat all four folders as secret: they hold tokens or keys.

Output

For a script, the clean-value forms are: -o tsv (az), --output text (aws), --format="value(...)" (gcloud), and --raw-output or a JMESPath query that returns a single string (oci).

Query: a JMESPath primer

az, aws and oci all use JMESPath in --query. gcloud has its own --format projections and --filter. Learn JMESPath once and it works three times. These examples ran for real on the az cloud list data built into the Azure CLI (no account):

user@lab:~$ az cloud list --output table
IsActive    Name               Profile
----------  -----------------  ---------
True        AzureCloud         latest
False       AzureChinaCloud    latest
False       AzureUSGovernment  latest
False       AzureBleuCloud     latest
user@lab:~$ az cloud list --query '[].name' --output tsv
AzureCloud
AzureChinaCloud
AzureUSGovernment
AzureBleuCloud
user@lab:~$ az cloud list --query "[?isActive].{Name:name, ARM:endpoints.resourceManager}" --output json
[
  {
    "ARM": "https://management.azure.com/",
    "Name": "AzureCloud"
  }
]
user@lab:~$ az cloud list --query "[].{Name:name, Portal:endpoints.portal}" --output table
Name               Portal
-----------------  --------------------------------
AzureCloud         https://portal.azure.com
AzureChinaCloud    https://portal.azure.cn
AzureUSGovernment  https://portal.azure.us
AzureBleuCloud     https://portal.sovcloud-azure.fr

The building blocks, using those examples:

What differs between the tools is the wrapper around the answer:

Shell quoting is the thing that bites: put the query in double quotes and use single quotes inside for strings, or the other way round, and test it on a small command first.

Help, offline

The same small jobs in four tools (from the documentation, not run here)

Cleaning up

The mistakes that are the same everywhere

  1. Wrong account, subscription, project or profile. Fix: the "where am I" command above, every time.
  2. Wrong region. The default is in the profile or configuration, and a forgotten one puts things somewhere unexpected.
  3. Secrets in the wrong place: keys in repositories, tokens in shell history, config folders in backups.
  4. Long-lived keys instead of short-lived sign-in.
  5. Quotes. A query that works in one shell breaks in another.
  6. Running a delete without listing first. List with the same filter, then delete.

The cheat sheet

← The Oracle Cloud CLI (oci): Config File, API Keys, Sessions and Query · ↑ All tutorials