Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .ai/checkpoints/topic-7-catalog-instance-commands.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .ai/specs/dcm-cli.spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -816,8 +816,8 @@ instance logs.
#### Table Output Columns

```
ID UID DISPLAY NAME CATALOG ITEM CREATED
my-instance c3d4e5f6-a7b8-9012-cdef-123456789012 My App Instance my-catalog-item 2026-03-09T10:00:00Z
ID UID DISPLAY NAME CATALOG ITEM RESOURCE ID CREATED
my-instance c3d4e5f6-a7b8-9012-cdef-123456789012 My App Instance my-catalog-item res-abc123 2026-03-09T10:00:00Z
```

#### Acceptance Criteria
Expand Down
2 changes: 1 addition & 1 deletion .ai/test-plans/dcm-cli-unit.test-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ test classes. Instead:
- **Type:** Unit
- **Given:** A mock server returning an instance with all fields populated
- **When:** `dcm catalog instance get my-instance` is executed with `--output table`
- **Then:** The table output includes columns: ID, UID, DISPLAY NAME, CATALOG ITEM, CREATED
- **Then:** The table output includes columns: ID, UID, DISPLAY NAME, CATALOG ITEM, RESOURCE ID, CREATED

---

Expand Down
7 changes: 5 additions & 2 deletions internal/commands/catalog_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,23 @@ import (
)

var catalogInstanceTableDef = &output.TableDef{
Headers: []string{"UID", "DISPLAY NAME", "CATALOG ITEM", "CREATED"},
Headers: []string{"UID", "DISPLAY NAME", "CATALOG ITEM", "RESOURCE ID", "CREATED"},
RowFunc: func(resource any) []string {
m, ok := resource.(map[string]any)
if !ok {
return []string{"", "", "", ""}
return []string{"", "", "", "", ""}
}
var catalogItemID string
var resourceID string
if spec, ok := m["spec"].(map[string]any); ok {
catalogItemID = stringifyValue(spec, "catalog_item_id")
resourceID = stringifyValue(spec, "resource_id")
}
return []string{
stringifyValue(m, "uid"),
stringifyValue(m, "display_name"),
catalogItemID,
resourceID,
stringifyValue(m, "create_time"),
}
},
Expand Down
3 changes: 3 additions & 0 deletions internal/commands/catalog_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func sampleInstanceResponse() map[string]any {
"create_time": "2026-03-09T10:00:00Z",
"spec": map[string]any{
"catalog_item_id": "my-catalog-item",
"resource_id": "res-abc123",
},
}
}
Expand Down Expand Up @@ -286,10 +287,12 @@ var _ = Describe("Catalog Instance Commands", func() {
Expect(out).To(ContainSubstring("UID"))
Expect(out).To(ContainSubstring("DISPLAY NAME"))
Expect(out).To(ContainSubstring("CATALOG ITEM"))
Expect(out).To(ContainSubstring("RESOURCE ID"))
Expect(out).To(ContainSubstring("CREATED"))
Expect(out).To(ContainSubstring("c3d4e5f6-a7b8-9012-cdef-123456789012"))
Expect(out).To(ContainSubstring("My App Instance"))
Expect(out).To(ContainSubstring("my-catalog-item"))
Expect(out).To(ContainSubstring("res-abc123"))
Expect(out).To(ContainSubstring("2026-03-09T10:00:00Z"))
})
})
Expand Down