diff --git a/cli/templateversions.go b/cli/templateversions.go index 5390adb4f5..ae987394fd 100644 --- a/cli/templateversions.go +++ b/cli/templateversions.go @@ -141,6 +141,7 @@ type templateVersionRow struct { TemplateVersion codersdk.TemplateVersion `table:"-"` // For table format: + ID string `json:"-" table:"id"` Name string `json:"-" table:"name,default_sort"` CreatedAt time.Time `json:"-" table:"created at"` CreatedBy string `json:"-" table:"created by"` @@ -166,6 +167,7 @@ func templateVersionsToRows(activeVersionID uuid.UUID, templateVersions ...coder rows[i] = templateVersionRow{ TemplateVersion: templateVersion, + ID: templateVersion.ID.String(), Name: templateVersion.Name, CreatedAt: templateVersion.CreatedAt, CreatedBy: templateVersion.CreatedBy.Username, diff --git a/cli/testdata/coder_templates_versions_list_--help.golden b/cli/testdata/coder_templates_versions_list_--help.golden index 52c243c45b..d9ace416e6 100644 --- a/cli/testdata/coder_templates_versions_list_--help.golden +++ b/cli/testdata/coder_templates_versions_list_--help.golden @@ -9,7 +9,7 @@ OPTIONS: -O, --org string, $CODER_ORGANIZATION Select which organization (uuid or name) to use. - -c, --column [name|created at|created by|status|active|archived] (default: name,created at,created by,status,active) + -c, --column [id|name|created at|created by|status|active|archived] (default: name,created at,created by,status,active) Columns to display in table output. --include-archived bool diff --git a/docs/reference/cli/templates_versions_list.md b/docs/reference/cli/templates_versions_list.md index 0c738f1569..25c82af95d 100644 --- a/docs/reference/cli/templates_versions_list.md +++ b/docs/reference/cli/templates_versions_list.md @@ -30,10 +30,10 @@ Select which organization (uuid or name) to use. ### -c, --column -| | | -|---------|-----------------------------------------------------------------------| -| Type | [name\|created at\|created by\|status\|active\|archived] | -| Default | name,created at,created by,status,active | +| | | +|---------|---------------------------------------------------------------------------| +| Type | [id\|name\|created at\|created by\|status\|active\|archived] | +| Default | name,created at,created by,status,active | Columns to display in table output.