Swift Argument Parser is a type-safe, declarative library for building Swift command-line tools by annotating your command types with property wrappers like @Option, @Argument, and @Flag. It handles parsing, validation, automatic help generation, and dispatch to your run() or async entry point, letting you focus on command logic instead of boilerplate. The package supports subcommands, default values, custom parsing strategies, and rich error messages that match platform conventions. It integrates cleanly with Swift Package Manager, works well in CI, and provides incremental improvements such as Sendable conformances for wrappers to help in concurrent contexts. The issue tracker and releases show active maintenance, real-world usage patterns, and design notes for advanced scenarios like collecting unrecognized arguments or mixing parent options with subcommands. Overall, it standardizes CLI ergonomics across the Swift ecosystem with a small, testable surface.

Features

  • Declarative, type-safe parsing with property wrappers
  • Automatic help, usage, and error messaging
  • First-class subcommands and custom parsing strategies
  • Async command support with clean run() entry points
  • SwiftPM integration and CI-friendly tooling
  • Sendable-aware wrappers to play nicely with concurrency

Project Samples

Project Activity

See All Activity >

License

Apache License V2.0

Follow Swift Argument Parser

Swift Argument Parser Web Site

Other Useful Business Software
Quality Management Software Icon
Quality Management Software

Ideal for small to medium-sized businesses. Pay for all the modules or only the ones you need.

isoTracker Quality Management is a popular cloud-based quality management software (QMS) that is used by small to medium sized businesses on a worldwide basis. It helps to manage ISO 9001, ISO 13485, ISO 22000, ISO 17025, ISO 14001 systems...plus many similar other systems. It also conforms to the requirements of 21 CFR Part 11.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Swift Argument Parser!

Additional Project Details

Operating Systems

Apple iPhone, Mac

Programming Language

Swift

Related Categories

Swift Parser Generators

Registered

2025-10-08