3 ms·
Show HN: Swift List – A Modern Swift Implementation of Ls
SwiftList is a reimplementation of the Unix ls command in Swift 6.0. It provides compatibility with standard ls flags while offering modern Swift API design and cross-platform support.
Technical Implementation
- Swift 6.0 with Foundation and FileManager for reliable file operations
- Swift Argument Parser for clean command-line interface
- Shell completion support for bash, zsh, and fish
- Swift Package Manager integration for easy installation
- Follows Swift API Design Guidelines throughout
Key Features
- ls flag compatibility (--all, --long, --recurse, etc.)
- Color and icon (emoji) support for enhanced file identification
- Multiple display formats (basic, detailed, recursive)
- Multiple path support
- Built-in shell completion generation (--generate-completion-script)
Recent Development
- Fixed shell completion reliability across bash, zsh, and fish
- Added standard version flag support
- Enhanced long format display options
Why Swift?
Swift's strong type system, memory safety, and Foundation integration make it well-suited for system utilities. The result is a fast, reliable ls replacement with modern error handling and clean architecture.
The project demonstrates practical Swift usage beyond iOS/macOS app development, showing how Swift can be effective for command-line tools and system utilities.
MIT licensed, comprehensive test coverage, ready for production use.