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
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
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