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
19 changes: 18 additions & 1 deletion src/Main/CLI/Commands/GetCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,26 @@ public override async Task<int> ExecuteAsync(
return Constants.ExitCodeUserError;
}

// Wrap result with node information
var response = new
{
id = result.Id,
node = node.Id,
content = result.Content,
mimeType = result.MimeType,
byteSize = result.ByteSize,
contentCreatedAt = result.ContentCreatedAt,
recordCreatedAt = result.RecordCreatedAt,
recordUpdatedAt = result.RecordUpdatedAt,
title = result.Title,
description = result.Description,
tags = result.Tags,
metadata = result.Metadata
};

// If --full flag is set, ensure verbose mode for human formatter
// For JSON/YAML, all fields are always included
formatter.Format(result);
formatter.Format(response);

return Constants.ExitCodeSuccess;
}
Expand Down
19 changes: 18 additions & 1 deletion src/Main/CLI/Commands/ListCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,25 @@ public override async Task<int> ExecuteAsync(
// Get page of items
var items = await service.ListAsync(settings.Skip, settings.Take, CancellationToken.None).ConfigureAwait(false);

// Wrap items with node information
var itemsWithNode = items.Select(item => new
{
id = item.Id,
node = node.Id,
content = item.Content,
mimeType = item.MimeType,
byteSize = item.ByteSize,
contentCreatedAt = item.ContentCreatedAt,
recordCreatedAt = item.RecordCreatedAt,
recordUpdatedAt = item.RecordUpdatedAt,
title = item.Title,
description = item.Description,
tags = item.Tags,
metadata = item.Metadata
});

// Format list with pagination info
formatter.FormatList(items, totalCount, settings.Skip, settings.Take);
formatter.FormatList(itemsWithNode, totalCount, settings.Skip, settings.Take);

return Constants.ExitCodeSuccess;
}
Expand Down
Loading