fix: restore human format table display for get and list commands#1101
Merged
dluc merged 1 commit intomicrosoft:mainfrom Dec 1, 2025
Merged
fix: restore human format table display for get and list commands#1101dluc merged 1 commit intomicrosoft:mainfrom
dluc merged 1 commit intomicrosoft:mainfrom
Conversation
Fixes broken human format output caused by microsoft#1100 which wrapped ContentDto in anonymous objects, breaking HumanOutputFormatter's type checking. Also simplifies human format by hiding technical details (mimeType, size, dates) in normal mode, showing only essential information. Changes: - Created ContentDtoWithNode wrapper class instead of anonymous objects - Updated HumanOutputFormatter to handle ContentDtoWithNode - Moved node field before ID in both get and list displays - Moved mimeType, size, and dates to verbose mode only - Human format now shows: Node, ID, Content (+ Title, Description, Tags if present) All 301 tests pass, 0 skipped, coverage 80.14%
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes broken human format output in
km getandkm listcommands caused by #1100, which wrapped ContentDto objects in anonymous types that broke HumanOutputFormatter's type checking. This PR restores the table display functionality and improves the human format by:ContentDtoWithNodewrapper class instead of using anonymous objectsBefore: Human format was broken (displayed as JSON instead of tables)
After: Clean tables showing only essential information: Node, ID, Content, Title, Description, Tags
Changes
src/Core/Storage/Models/ContentDtoWithNode.cs- Proper wrapper class for content with node informationsrc/Main/CLI/Commands/GetCommand.cs- UsesContentDtoWithNode.FromContentDto()instead of anonymous objectsrc/Main/CLI/Commands/ListCommand.cs- UsesContentDtoWithNode.FromContentDto()for list itemssrc/Main/CLI/OutputFormatters/HumanOutputFormatter.cs- AddedFormatContentWithNode()andFormatContentWithNodeList()methodsHuman Format Display
km get (normal mode):
km get (verbose mode adds):
km list (normal mode):
| Node | ID | Content Preview |
Test Plan
km getdisplays table with node informationkm listdisplays table with node columnStats
ContentDtoWithNode)Breaking Changes
None - this is a bug fix that restores expected functionality and improves UX