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
Go From AI Idea to AI App Fast Icon
Go From AI Idea to AI App Fast

One platform to build, fine-tune, and deploy ML models. No MLOps team required.

Access Gemini 3 and 200+ models. Build chatbots, agents, or custom models with built-in monitoring and scaling.
Try 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