Spectre.Console 0.50.0: AOT Testing CLI Improvements

by Spectre.Console Team

Spectre.Console 0.50.0: AOT Testing CLI Improvements

We're excited to announce Spectre.Console 0.50.0, a major release that brings Native AOT support, comprehensive testing enhancements, and significant improvements to the command-line interface framework. This release represents a substantial step forward in making Spectre.Console more compatible with modern .NET deployment scenarios while improving the developer experience.

What's New in 0.50.0

Native AOT Compatibility

One of the biggest additions in this release is Native AOT (Ahead-of-Time) support, making Spectre.Console applications faster to start and smaller in size:

  • AOT compatibility layers added throughout the codebase (Phil Scott)
  • Fallback exception formatting for AOT scenarios where reflection is limited (Phil Scott)
  • Enhanced type conversion with AOT-compatible fallbacks (Phil Scott)
  • Assembly name resolution improvements for better F# integration in AOT (Phil Scott)
  • Explicit AOT incompatibility warnings for Spectre.Console.Cli to guide developers (Phil Scott)

Testing Framework Overhaul

This release includes comprehensive improvements to testing capabilities:

  • New testing documentation with detailed guides and examples (Frank Ray)
  • Enhanced CommandAppTester with configurable output trimming (Frank Ray)
  • Improved unit test coverage across all major components (Frank Ray)
  • Version command testing ensuring proper CLI behavior (Frank Ray)
  • Strict parsing tests for better reliability (Frank Ray)

Command-Line Interface Enhancements

The CLI framework received significant attention with numerous improvements:

  • Smart version handling - version flags now work correctly even with default commands (Frank Ray)
  • Enhanced argument parsing with better unknown flag handling (Frank Ray)
  • Improved help generation with configurable colors and better formatting (Frank Ray)
  • Fluent configurator now returns IConfigurator for method chaining (Melvin Dommer)
  • Better error handling for invalid command configurations (Frank Ray)

User Interface Polish

Several UI components received improvements:

  • Async spinner extension methods for better async/await patterns (Phil Scott)
  • Enhanced multi-selection prompts with improved checkbox styling (Davide Piccinini)
  • Tree component fixes for expanded node display (Davide Piccinini)
  • Calendar highlighting for single events (Davide Piccinini)
  • Progress task positioning allowing tasks to be inserted before or after existing ones (Tom Longhurst)

Developer Experience Improvements

  • Three-digit hex color parsing support (Martijn Straathof)
  • Automatic command settings registration reducing boilerplate (Patrik Svensson)
  • Spanish translations for help strings (Daniel Cazzulino)
  • Exception formatting enhancements for generic types (Cédric Luthi)
  • Transfer speed column configuration with bits/bytes and binary/decimal prefixes (Tim Pilius)

Performance and Reliability

  • Emoji dictionary optimization using OrdinalIgnoreCase for better performance (Phil Scott)
  • Dependency updates including .NET 9.0 support (Patrik Svensson)
  • Strong name signing for all assemblies (Kirill Osenkov)
  • Progress percentage calculation improvements when max value is zero (Frank Ray)

Breaking Changes

  • Assembly strong naming may affect some reflection-based scenarios
  • CLI version handling behavior has changed - version flags are now opt-in
  • Some internal APIs have been restructured for AOT compatibility

Key Contributors

Special thanks to the amazing contributors who made this release possible:

  • Phil Scott: Native AOT support and numerous infrastructure improvements
  • Frank Ray: Testing framework overhaul and CLI enhancements
  • Patrik Svensson: Project coordination and core improvements
  • Davide Piccinini: UI component enhancements and bug fixes
  • Cédric Luthi: Exception handling improvements
  • Tom Longhurst: Progress task positioning features

Migration Guide

Most applications will upgrade seamlessly, but note:

  1. Version handling: If you rely on automatic version flags, you may need to explicitly enable them
  2. Strong naming: Applications using reflection might need updates
  3. AOT scenarios: CLI applications are not recommended for AOT - use core Spectre.Console instead

Get Started

Update your package reference:

<PackageReference Include="Spectre.Console" Version="0.50.0" />

For detailed migration information and new features, check out our updated documentation.

This release sets the foundation for our upcoming 1.0 release with robust AOT support, comprehensive testing, and a polished developer experience. We're excited to see what you build with these new capabilities!


Released on April 8, 2025