Releases: Kingrashy12/ziglet
v0.9.0
Release v0.9.0 - Color System Refactor & API Improvements
🎨 Major Changes
Modular Color System
- Extracted color handling into dedicated
src/utils/color.zigmodule for better maintainability - New Color API with method chaining support for composing styles
- Added comprehensive style support: bold, dim, italic, underline, blink, reverse, hidden, strikethrough
- Full 16-color palette: Standard and bright variants for both foreground and background
🔧 API Updates
printColored Function
// Old API - single style only
printColored(.cyan, "text", .{});
// New API - multiple styles via slice
printColored(&[_]Color.Style{.cyan, .bold}, "text", .{});New Color API Usage
// Method chaining
var color = Color.init(allocator);
defer color.deinit();
const styled = try color.bold().cyan().underline().paint("Hello World");
// One-shot helper
var colored = try Color.colored(allocator, "Error!", &[_]Style{.red, .bold});
defer colored.deinit();
print("{s}\n", .{colored.result});📝 Improvements
- Reduced code duplication in
cli_builder.zigwith newprintOptionfunction - Centralized color logic across
cli_builder.zigandparser.zig - Better error logging cleanup in terminal utilities
📦 Version
- Project version bumped to 0.9.0 in
build.zig.zon
🔄 Migration Guide
Update any calls to printColored from:
printColored(.color_name, "text", .{});to:
printColored(&[_]Color.Style{.color_name}, "text", .{});For multiple styles:
printColored(&[_]Color.Style{.red, .bold, .underline}, "Important!", .{});Full Changelog: compare v0.8.0...v0.9.0
v0.8.0
Main Feature
Added name and version fields to CommandContext
- The CommandContext struct now includes CLI application metadata that can be accessed during command execution
Key Changes
-
Enhanced Context Information
- Commands can now access the CLI application's name and version at runtime
- Useful for help messages, logging, or version-specific behavior
-
Bug Fix: Memory Leak Resolution
- Fixed memory leaks in the
validateOptionsfunction - Added proper error handling and memory deallocation to prevent resource leaks
- Fixed memory leaks in the
-
Documentation Updates
- Examples updated to reflect new parameter naming conventions
- Examples now demonstrate how to access the
namefield from context
v0.6.1
v0.6.1
✨ New Features
- Exported
stripAnsiutility function as part of public utils API - Removes ANSI escape codes from strings for clean terminal output parsing
v0.6.0
📢 Release Notes: Version 0.6.0
⚠️ BREAKING CHANGES
- Memory Management: The signature of the
formatBytesfunction has changed.- It now requires a
std.mem.Allocatorparameter for dynamic memory allocation. - The type of the
bytesparameter has been changed fromu64tousize. - Action Required: Callers of
formatBytesmust now manually free the returned string slice using the provided allocator to prevent memory leaks.
- It now requires a
🛠️ Fixed
- Critical Memory Safety Fix: The
formatBytesutility function has been corrected to properly allocate the formatted string in memory provided by the caller's allocator. This resolves a serious bug where the function was previously returning a dangling pointer (a reference to a local, temporary stack buffer) which would lead to unpredictable behavior, corruption, or crashes.
This change ensures the utility is robust and adheres to best practices for memory management in Zig.
v0.5.0
✨ New Feature
- Added a new formatting utility function to
utils/format.zigto provide enhanced text rendering options.
🛠️ Improvements & Bug Fixes
- Linux Stability Fix: Resolved a critical bug where the CLI builder could crash on certain Linux environments due to improper initialization of the
types.Valuevariable. Thevalueis now correctly initialized to.undefined. - Cleaner Help Output: The
Options:section in the generated help message is now only displayed if the command actually defines options, resulting in cleaner and more relevant output for simple commands.
v0.4.0
Release Notes
Breaking Changes
- CLI Builder API: Renamed the
ActionArgstruct toCommandContextfor improved clarity and consistency. This update impacts all action function signatures, type exports, and related example code.
Migration: Replace all instances ofActionArgwithCommandContextin your codebase to ensure compatibility.
v0.3.1
Release Notes — v0.3.1
This patch release focuses on stabilizing the CLI’s parsing logic and ensuring safer memory handling across core components.
Changes
✅ Improved resource cleanup in cli_builder.zig
- Reorganized
deferstatements to guarantee consistent deallocation. - Ensures all allocated buffers and option structures are safely released, even on early returns or parsing failures.
✅ Added robust errdefer logic in parser.zig
- Implemented
errdeferblocks to clean up temporary containers and option maps when errors occur. - Reduces risk of memory leaks during option parsing, argument slicing, and command handling.
v0.2.0
v0.2.0 - 2025-10-25
This release introduces several improvements and refactors to enhance Ziglet's functionality and maintainability.
Changes:
- Refactor: The
stdoutmodule has been renamed toterminalfor clarity. - Memory Management: Added an
allocatorfield to theActionArgstruct to improve memory management. - Utility Functions: Introduced the
cli_utils.zigmodule with utility functions (takeBool,takeString,takeNumber) for safer and more convenient value extraction in CLI action functions. - Deprecation Removal: Removed the deprecated
install.zigfile and its related features. - Parser Improvements: Enhanced the parser with improved boolean option handling.
v0.1.4
Release Notes - Ziglet v0.1.4
🚀 What's New in Ziglet v0.1.4
Ziglet v0.1.4, packed with powerful new features that make building CLI applications in Zig even more delightful!
✨ New Features
🌍 Global Options Support
- Automatically add
--helpand--versionflags to all your commands - Define global options that work across your entire CLI application
- No more repetitive option definitions!
🏭 Fluent Factory Pattern
- Build commands with an elegant, chainable API:
command().option().action().finalize() - More readable and maintainable command definitions
- Perfect for complex CLI applications
🎯 Enhanced Option Types
- Support for
bool,string, andnumberoption types - Type-safe option parsing and validation
- Better error handling and user experience
📚 Improved Help System
- Command-specific help with
command --help - Beautiful, formatted help output
- Clear usage instructions for each command
🔧 Developer Experience Improvements
- Option Validation: Automatic validation of required options
- Global Option Merging: Seamlessly combine global and command-specific options
- Better Error Messages: More helpful feedback when things go wrong
📖 Examples & Documentation
Comprehensive examples have been added showing:
- Basic CLI setup with commands and options
- Global options configuration
- Factory pattern for advanced use cases
Check out the examples/ directory for runnable code samples!
⚠️ Breaking Changes
This release includes some breaking changes to improve the API:
- Action handlers now use
ActionArgstruct instead of separate parameters parse()method signature updated for factory pattern support- Option definitions use the more structured
CLIOptionformat
Migration Guide: Update your action functions to accept ActionArg and use the new option access pattern. See the updated README.md for examples.
🎉 Get Started
zig fetch --save git+https://github.com/Kingrashy12/zigletThen check out the new examples in the examples/ directory!
Full changelog: See CHANGELOG.md for complete technical details.
Thank you for using Ziglet! Your feedback would help build better tools 🐣
v0.1.3
v0.1.3 - CLI Flags & Compatibility
New Features & Improvements
- Added short/long flag support: CLI options now accept both
-o(short) and--output(long) forms. (#1) [@ciathefed] - Refactored
install.zig: Fixed deprecated functions and integrated the new flag system. (#1) [@ciathefed]
Breaking Changes
Option.flag→Option.long: TheOption.flagfield is now renamed toOption.long, with an optionalOption.shortfield.- Migration: Update any code referencing
Option.flag.
- Migration: Update any code referencing
Other
- Version bumped to
v0.1.3. [@Kingrashy12]