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
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

The database for AI-powered applications.

MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
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

5 days ago