---
name: Registry-registry_cli_list
title: Formatting and filtering the Container Registry CLI output
description: You can format and filter the IBM Cloud&reg; Container Registry command-line interface (CLI) output for supported IBM Cloud Container Registry commands.
last-updated: 2026-05-13
---

> ## Documentation Index
> The table of contents for this documentation set is at https://cloud.ibm.com/docs/Registry?format=markdown
> The index for all IBM Cloud docs is at: https://cloud.ibm.com/docs/llms.txt
> Use these files to discover more information as needed.

# Formatting and filtering the Container Registry CLI output
{: #registry_cli_list}

You can format and filter the IBM Cloud&reg; Container Registry command-line interface (CLI) output for supported IBM Cloud Container Registry commands.
{: shortdesc}

By default, the CLI output is displayed in a human-readable format. However, this view might limit your ability to use the output, particularly if the command is run programmatically. For example, in the `ibmcloud cr image-list` CLI output you might want to sort the `Size` field in numerical order, but the command returns a string description. The `container-registry` CLI plug-in provides the format option that you can use to apply a [Go template](https://pkg.go.dev/text/template){: external} to the CLI output.

You can alter the CLI output by applying the format option in two different ways:

- Format the data in your CLI output. For example, change the `Created` field output from UNIX&reg; time to standard time.
- Filter the data in your CLI output. For example, filter by details of the image to display a specific subset of images by using the [Go template](https://pkg.go.dev/text/template){: external} `if gt` condition.

You can use the format option with the following IBM Cloud Container Registry commands. Click a command to view a list of available fields and their data types.

- [Go template options for the `ibmcloud cr image-digests` command](#registry_cli_list_imagedigests).
- [Go template options for the `ibmcloud cr image-list` command](#registry_cli_list_imagelist).
- [Go template options for the `ibmcloud cr image-inspect` command](#registry_cli_list_imageinspect).

## Go template options for `ibmcloud cr image-digests`
{: #registry_cli_list_imagedigests}

Review the following table to find available [Go template](https://pkg.go.dev/text/template){: external} options and data types for the [`ibmcloud cr image-digests`](https://cloud.ibm.com/docs/Registry?topic=Registry-containerregcli&format=markdown#bx_cr_image_digests) command.

| Field | Type | Description |
| ----- | ---- | ----------- |
| `Created` | Integer (64 bit) | This option displays when the image was created, expressed by the number of seconds in UNIX time. |
| `Digest` | String | This option displays the unique identifier for an image. |
| `ManifestType` | String | This option displays the image manifest type. |
| `Repository` | String | This option displays the repository of the image. |
| `SecurityStatus` | Object | This option displays the vulnerability status for the image. You can filter and format the following values:  \n - **`Status`** `string`  \n - **`IssueCount`** `int`  \n - **`ExemptionCount`** `int`  \n  \n The possible statuses are described in [Reviewing a vulnerability report by using the CLI](https://cloud.ibm.com/docs/Registry?topic=Registry-va_index&interface=cli&format=markdown#va_registry_cli). |
| `Size` | Integer (64 bit) | This option displays the size of the image in bytes. |
| `Tags` | Array of strings | This option displays the tags for the image. |
{: caption="Available fields and data types in the Container Registry command to list image digests" caption-side="bottom"}
{: #table_registry_cli_list_image_digests}

### Example Go format command for `ibmcloud cr image-digests`
{: #registry_cli_list_imagedigests_go}

To display all untagged images referenced by their digests, run the following `ibmcloud cr image-digests` command.

```txt
ibmcloud cr image-digests --format '{{if not .Tags}}{{.Repository}}@{{.Digest}}{{end}}'
```
{: pre}

The following message is an example of the output from the command

```txt
example-<region>.icr.io/user1/my_first_repo@<digest1>
example-<region>.icr.io/user1/my_first_repo@<digest2>
example-<region>.icr.io/user1/my_first_repo@<digest3>
```
{: screen}

## Go template options for `ibmcloud cr image-list`
{: #registry_cli_list_imagelist}

Review the following table to find available [Go template](https://pkg.go.dev/text/template){: external} options and data types for the [`ibmcloud cr image-list`](https://cloud.ibm.com/docs/Registry?topic=Registry-containerregcli&format=markdown#bx_cr_image_list) command.

| Field | Type | Description |
| ----- | ---- | ----------- |
| `Created` | Integer (64 bit) | This option displays when the image was created, expressed by the number of seconds in UNIX time. |
| `Digest` | String | This option displays the unique identifier for an image. |
| `ManifestType` | String | This option displays the image manifest type. |
| `Namespace` | String | This option displays the namespace where the image is stored. |
| `Repository` | String | This option displays the repository of the image. |
| `SecurityStatus` | Object | This option displays the vulnerability status for the image. You can filter and format the following values:  \n - **`Status`** `string`  \n - **`IssueCount`** `int`  \n - **`ExemptionCount`** `int`  \n  \n The possible statuses are described in [Reviewing a vulnerability report by using the CLI](https://cloud.ibm.com/docs/Registry?topic=Registry-va_index&interface=cli&format=markdown#va_registry_cli). |
| `Size` | Integer (64 bit) | This option displays the size of the image in bytes. |
| `Tag` | String | This option displays the tag for the image. |
{: caption="Available fields and data types in the Container Registry command to list images" caption-side="bottom"}
{: #table_registry_cli_list_images}

### Example Go format command for `ibmcloud cr image-list`
{: #registry_cli_list_imagelist_go}

To display the repository, tag, and security status of all tagged images that are over 1 MB, run the following `ibmcloud cr image-list` command.

```txt
ibmcloud cr image-list --format "{{ if gt .Size 1000000 }}{{ .Repository }}:{{ .Tag }} {{ .SecurityStatus.Status }}{{end}}"
```
{: pre}

The following message is an example of the output from the command:

```txt
example-<region>.icr.io/user1/my_first_repo:latest No Issues
example-<region>.icr.io/user1/my_second_repo:1 2 Issues
example-<region>.icr.io/user1/my_second_repo:test1 1 Issue
example-<region>.icr.io/user1/my_second_repo_2:test2 7 Issues
```
{: screen}

If the listing images command times out, see [Why is it timing out when I list images?](https://cloud.ibm.com/docs/Registry?topic=Registry-troubleshoot-image-timeout&format=markdown) for assistance.
{: tip}

## Go template options for `ibmcloud cr image-inspect`
{: #registry_cli_list_imageinspect}

Review the following table to find available [Go template](https://pkg.go.dev/text/template){: external} options and data types for the [`ibmcloud cr image-inspect`](https://cloud.ibm.com/docs/Registry?topic=Registry-containerregcli&format=markdown#bx_cr_image_inspect) command.

| Field | Type | Description |
| ----- | ---- | ----------- |
| `Architecture` | String | This option displays the processor architecture that was used to build this image, and that is required to run the image. |
| `Author` | String | This option displays the author of the image. |
| `Comment` | String | This option displays the description of the image. |
| `Config` | Object | This option displays the configuration metadata for the image. For more information, see [`Config` field details](#registry_cli_list_imageinspect_config). |
| `Container` | String | This option displays the ID of the container that created the image. |
| `ContainerConfig` | Object | This option displays the default configuration for containers that are started from this image. For more information, see [`Config` field details](#registry_cli_list_imageinspect_config). |
| `Created` | String | This option displays the UNIX timestamp when the image was created. |
| `DockerVersion` | String | This option displays the Docker version that was used to build this image. |
| `ID` | String | This option displays the unique identifier for an image. |
| `Os` | String | This option displays the operating system family that was used to build this image, and that is required to run the image. |
| `OsVersion` | String | This option displays the version of the operating system that was used to build this image. |
| `Parent` | String | This option displays the ID of the parent image that was used to build this image. |
| `RootFS` | Object | This option displays the metadata that describes the root file system for the image. For more information, see [`RootFS` field details](#registry_cli_list_imageinspect_rootfs). |
| `Size` | Integer (64 bit) | This option displays the size of the image in bytes. |
| `VirtualSize` | Integer (64 bit) | This option displays the sum of the sizes of each layer in the image in bytes. |
{: caption="Available fields and data types in the Container Registry command to inspect images" caption-side="bottom"}
{: #table_registry_cli_list_image_inspect}

### `Config` field details
{: #registry_cli_list_imageinspect_config}

| Field | Type | Description |
| ----- | ---- | ----------- |
| `ArgsEscaped` | Boolean | [Windows]{: tag-windows} This option displays _true_ if the command is escaped (Windows&reg; specific). |
| `AttachStderr` | Boolean | This option displays _true_ if the standard error stream is attached to the container and _false_ if not. |
| `AttachStdin` | Boolean | This option displays _true_ if the standard input stream is attached to the container and _false_ if not. |
| `AttachStdout` | Boolean | This option displays _true_ if the standard output stream is attached to the container and _false_ if not. |
| `Cmd` | Array of strings | This option describes the commands and arguments that are passed to a container to run when the container is started. |
| `Domainname` | String | This option displays the fully qualified domain name of the container. |
| `Entrypoint` | Array of strings | This option describes the command that is run when the container starts. |
| `Env` | Array of strings | This option displays the list of environment variables in the form of key-value pairs. |
| `ExposedPorts` | Key-value map | This option displays the list of exposed ports in the format `[123:,456:]`. |
| `Healthcheck` | Object | This option describes how to check that the container is working correctly. For more information, see [`Healthcheck` field details](#registry_cli_list_imageinspect_healthcheck). |
| `Hostname` | String | This option displays the hostname of the container. |
| `Image` | String | This option displays the name of the image that was passed by the operator. |
| `Labels` | Key-value map | This option displays the list of labels that were added to the image as key-value pairs. |
| `MacAddress` | String | This option displays the MAC address that is assigned to the container. |
| `NetworkDisabled` | Boolean | This option displays _true_ if the networking is disabled for the container and _false_ if the networking is enabled for the container. |
| `OnBuild` | Array of strings | This option displays the `ONBUILD` metadata that was defined on the image Dockerfile. |
| `OpenStdin` | Boolean | This option displays _true_ if the standard input stream is open and _false_ if the standard input stream is closed. |
| `Shell` | Array of strings | This option displays the shell-form of `RUN`, `CMD`, `ENTRYPOINT`. |
| `StdinOnce` | Boolean | This option displays _true_ if the standard input stream is closed after the attached client disconnects and _false_ if the standard input stream stays open. |
| `StopSignal` | String | This option describes the UNIX&reg; stop signal to send when to stop the container. |
| `StopTimeout` | Integer | This option displays the timeout in seconds to stop a container. |
| `Tty` | Boolean | This option displays _true_ if a `pseudo-tty` is allocated to the container and _false_ if not. |
| `User` | String | This option displays the user that runs commands inside the container where the image is used. |
| `Volumes` | Key-Value map | This option displays the list of volume mounts that are mounted to a container. |
| `WorkingDir` | String | This option displays the working directory that is inside the container where the specified commands are run. |
{: caption="Available fields and data types in Config" caption-side="bottom"}
{: #table_registry_cli_list_config}

### `Healthcheck` field details
{: #registry_cli_list_imageinspect_healthcheck}

| Field | Type | Description |
| ----- | ---- | ----------- |
| `Interval` | Integer (64 bit) | This option displays the time to wait between two health checks in nanoseconds. |
| `Retries` | Integer | This option displays the number of consecutive failures that need to occur to deem that a container is not working correctly. |
| `Test` | Array of strings | This option displays how to run the health check test. The following options are available.  \n - `{}` inherit the health check.  \n - `{"NONE"}` the health check is disabled.  \n - `{"CMD", args...}` exec arguments directly.  \n - `{"CMD-SHELL", command}` run the command with the system's default shell. |
| `Timeout` | Integer (64 bit) | This option displays the time to wait, in nanoseconds, before the health check fails. |
{: caption="Available fields and data types in Health check" caption-side="bottom"}
{: #table_registry_cli_list_healthcheck}

### `RootFS` field details
{: #registry_cli_list_imageinspect_rootfs}

| Option | Type | Description |
| ------ | ---- | ----------- |
| `BaseLayer` | String | This option displays the descriptor for the base layer in the image. |
| `Layers` | Array of strings | This option displays the descriptors of each image layer. |
| `Type` | String | This option displays the type of file system. |
{: caption="Available fields and data types in RootFS" caption-side="bottom"}
{: #table_registry_cli_list_rootfs}

### Example Go format commands for `ibmcloud cr image-inspect`
{: #registry_cli_list_imageinspect_go}

The following code examples demonstrate how you might use the formatting and filtering options.

#### Example 1 for `ibmcloud cr image-inspect`
{: #registry_cli_list_imageinspect_go1}

To display where IBM Documentation is hosted for a specified IBM public image, run the following `ibmcloud cr image-inspect` command.

```txt
ibmcloud cr image-inspect ibm_public_image --format "{{ .ContainerConfig.Labels }}"
```
{: pre}

The following message is an example of the output from the command:

```txt
map[doc.url:/docs/images/docker_image_ibm_public_image/ibm_public_image_starter.html]
```
{: screen}

#### Example 2 for `ibmcloud cr image-inspect`
{: #registry_cli_list_imageinspect_go2}

To display the exposed ports for a specified image, run the following `ibmcloud cr image-inspect` command.

```txt
ibmcloud cr image-inspect ibm_public_image --format "{{ .Config.ExposedPorts }}"
```
{: pre}

The following message is an example of the output from the command:

```txt
map[9080/tcp: 9443/tcp:]
```
{: screen}