diff --git a/cli/list.go b/cli/list.go
index c88c9a7563581..655427f2a15e1 100644
--- a/cli/list.go
+++ b/cli/list.go
@@ -22,6 +22,7 @@ type workspaceListRow struct {
codersdk.Workspace `table:"-"`
// For table format:
+ Favorite bool `json:"-" table:"favorite"`
WorkspaceName string `json:"-" table:"workspace,default_sort"`
Template string `json:"-" table:"template"`
Status string `json:"-" table:"status"`
@@ -46,9 +47,15 @@ func workspaceListRowFromWorkspace(now time.Time, workspace codersdk.Workspace)
if status == "Starting" || status == "Started" {
healthy = strconv.FormatBool(workspace.Health.Healthy)
}
+ favIco := " "
+ if workspace.Favorite {
+ favIco = "★"
+ }
+ workspaceName := favIco + " " + workspace.OwnerName + "/" + workspace.Name
return workspaceListRow{
+ Favorite: workspace.Favorite,
Workspace: workspace,
- WorkspaceName: workspace.OwnerName + "/" + workspace.Name,
+ WorkspaceName: workspaceName,
Template: workspace.TemplateName,
Status: status,
Healthy: healthy,
diff --git a/cli/testdata/coder_list_--help.golden b/cli/testdata/coder_list_--help.golden
index 615787278345d..adc1ae74a7d03 100644
--- a/cli/testdata/coder_list_--help.golden
+++ b/cli/testdata/coder_list_--help.golden
@@ -12,9 +12,9 @@ OPTIONS:
Specifies whether all workspaces will be listed or not.
-c, --column string-array (default: workspace,template,status,healthy,last built,current version,outdated,starts at,stops after)
- Columns to display in table output. Available columns: workspace,
- template, status, healthy, last built, current version, outdated,
- starts at, starts next, stops after, stops next, daily cost.
+ Columns to display in table output. Available columns: favorite,
+ workspace, template, status, healthy, last built, current version,
+ outdated, starts at, starts next, stops after, stops next, daily cost.
-o, --output string (default: table)
Output format. Available formats: table, json.
diff --git a/docs/cli/list.md b/docs/cli/list.md
index 9681d32c1a5a4..6366898622859 100644
--- a/docs/cli/list.md
+++ b/docs/cli/list.md
@@ -31,7 +31,7 @@ Specifies whether all workspaces will be listed or not.
| Type | string-array
|
| Default | workspace,template,status,healthy,last built,current version,outdated,starts at,stops after
|
-Columns to display in table output. Available columns: workspace, template, status, healthy, last built, current version, outdated, starts at, starts next, stops after, stops next, daily cost.
+Columns to display in table output. Available columns: favorite, workspace, template, status, healthy, last built, current version, outdated, starts at, starts next, stops after, stops next, daily cost.
### -o, --output