Synopsis
Flags
| Flag | Description |
|---|---|
-h, --help | help for environments |
--name string | [optional] Only list environments whose name contains this substring (case-insensitive). |
-o, --output string | [defaulted] The format of the output. Valid formats are: [table, json]. (default “table”) |
--page int | [defaulted] The page number of a response. (default 1) |
-n, --page-limit int | [defaulted] The number of elements per page. (default 15) |
--sort string | [optional] The field to sort environments by. Valid values are: [name, last_modified_at, last_changed_at]. (defaults to name) |
--sort-direction string | [optional] The direction to sort environments in. Valid values are: [asc, desc]. (defaults to asc) |
--space-id strings | [optional] Only list environments in the space with this ID. Can be repeated to match more than one space. |
--tag strings | [optional] Only list environments that have this tag, given as ‘key’ or ‘key:value’. Can be repeated to match more than one tag. |
--type strings | [optional] Only list environments of this type. Valid types are: [K8S, ECS, S3, lambda, server, docker, azure-apps, cloud-run, logical]. Can be repeated to match more than one type. |
Flags inherited from parent commands
| Flag | Description |
|---|---|
-a, --api-token string | The Kosli API token. |
-c, --config-file string | [optional] The Kosli config file path. (default “kosli”) |
--debug | [optional] Print debug logs to stdout. |
-H, --host string | [defaulted] The Kosli endpoint. (default “https://app.kosli.com”) |
--http-proxy string | [optional] The HTTP proxy URL including protocol and port number. e.g. http://proxy-server-ip:proxy-port |
-r, --max-api-retries int | [defaulted] How many times should API calls be retried when the API host is not reachable. (default 3) |
--org string | The Kosli organization. |
-q, --quiet | [optional] Suppress non-critical warning messages. Errors and normal output are not affected. If both --quiet and --debug are set, --debug wins. |
Live Example
To view a live example of ‘kosli list environments’ you can run the command below (for the cyber-dojo demo organization).View example output
View example output
Examples Use Cases
These examples all assume that the flags--api-token, --org, --host, (and --flow, --trail when required), are set/provided.
list all environments for an org
list all environments for an org
show the second page of environments, 25 per page
show the second page of environments, 25 per page
list environments whose name contains a substring (in JSON)
list environments whose name contains a substring (in JSON)
list K8S and ECS environments tagged with team=platform
list K8S and ECS environments tagged with team=platform
list environments sorted by when they last changed, newest first
list environments sorted by when they last changed, newest first