Skip to content

Add CLI export with interactive menu and streaming XML for large packages - #18

Draft
AThraen with Copilot wants to merge 4 commits into
mainfrom
copilot/extend-cli-export-functionality
Draft

AThraen with Copilot wants to merge 4 commits into
mainfrom
copilot/extend-cli-export-functionality

Conversation

Copilot AI commented Nov 17, 2025 •

Copy link
Copy Markdown
Contributor

Extends CLI to match Blazor feature parity with optimizations for large package files using streaming XML parsing to avoid loading entire documents into memory.

Changes

CLI Infrastructure

  • Interactive menu mode - Launch by passing package file path alone, provides guided navigation through content exploration and export wizards
  • Command-line mode - list and export commands with --type, --format, --output, --properties options for automation

List Commands

  • list --type [content|content-types|media|categories|audiences] - Displays items with summary statistics (counts by type, language, properties, etc.)
  • Supports all package artifact types available in Blazor version

Export Functionality

  • CSV/JSON export for content (with custom property selection), content-types, and categories
  • Interactive mode shows available properties before export to guide selection
  • Auto-detects large packages (>10k items) and switches to streaming mode

Performance Optimization

  • StreamingPackageParser - XmlReader-based parser that yields items incrementally instead of loading full XDocument
  • Exposed ZipArchive property on ZipPackage for streaming access
  • Progress indicators every 1,000 items for long-running exports

Example Usage

# Interactive mode
./CLI.exe package.episerverdata

# Command-line list
./CLI.exe list --type content package.episerverdata

# Command-line export with streaming (auto-enabled for large files)
./CLI.exe export package.episerverdata \
  --type content \
  --format csv \
  --output out.csv \
  --properties PageName,PageTypeName,PageLink

Dependencies

  • System.CommandLine 2.0.0-beta4 - Argument parsing
  • CsvHelper 33.0.1 - CSV serialization
  • System.Text.Json 8.0.5 - Streaming JSON writer
Original prompt

This section details on the original issue you should resolve

<issue_title>CLI Export</issue_title>
<issue_description>Extend the CLI to support all the features as the blazor version, but also scale so it can work with very large package files (using tricks like avoid loading all xml into one xdocument).
If started with only a filename of a package it should offer a menu with options of what to do - like list content, content types, media, categories and so on.
All lists should also include summaries.

It should also have the possibility to export content to csv or json, where the user provides a list of properties to export and a filename to export to.
These things should be possible both using the CLI menu (where there should also be helpful information along the way like which properties are available and so on), or purely through commandline parameters.

Use as much shared code from the Core package as possible.

</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits November 17, 2025 10:11
…upport

Co-authored-by: AThraen <5888420+AThraen@users.noreply.github.com>
Co-authored-by: AThraen <5888420+AThraen@users.noreply.github.com>
Co-authored-by: AThraen <5888420+AThraen@users.noreply.github.com>
Copilot AI changed the title [WIP] Extend CLI to support features from Blazor version Add CLI export with interactive menu and streaming XML for large packages Nov 17, 2025
Copilot AI requested a review from AThraen November 17, 2025 10:24

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI Export

2 participants