diff --git a/docs/pages/reference/cli/tctl.mdx b/docs/pages/reference/cli/tctl.mdx index 312b631feb7aa..0db16f3e45760 100644 --- a/docs/pages/reference/cli/tctl.mdx +++ b/docs/pages/reference/cli/tctl.mdx @@ -582,6 +582,16 @@ $ tctl bots instances list [] - `[]` - an optional bot name. If provided, filters the result to show only instances for the named bot. Otherwise, shows all instances for all bots. +### Flags + +| Name | Default Value(s) | Allowed Value(s) | Description | +| - | - | - | - | +| `--search` | none | A search term | Optional. Filters the returned bot instances using a fuzzy search based on the term provided. | +| `--query` | none | Teleport predicate language query | Optional. Filters the returned bot instances based on the Teleport predicate language query provided. | +| `--sort-index` | `bot_name` | `bot_name`, `active_at_latest`, `version_latest`, `host_name_latest` | Optional. Sorts the returned bot instances using the given field. | +| `--sort-order` | `ascending` | `ascending`, `descending` | Optional. Sorts the returned bot instances in the given order. | +| `--format` | `text` | `text`, `json` | If set to `json`, returns results as a machine-readable JSON string. | + ### Examples This shows all known instances for the bot named "example": @@ -590,6 +600,25 @@ This shows all known instances for the bot named "example": $ tctl bots instance list example ``` +This shows all known instances which contain the term "github"; + +```code +$ tctl bots instance list --search github +``` + +Searchable fields include; bot name, instance id, hostname, join method, version + +This shows all known instances with a version older than "18.0.0"; + +```code +$ tctl bots instance list --query `older_than(status.latest_heartbeat.version, "18.0.0")` +``` +Version-specific functions include; + +- `newer_than(version, comparison)` +- `older_than(version, comparison)` +- `between(version, lower (inclusive), upper (exclusive))` + ### Global flags These flags are available for all commands: `--debug, --config`. Run