apple/swift-argument-parser

Straightforward, type-safe argument parsing for Swift

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 33 minutes ago
Type:Library / SDKCategory(s):Core & Utility LibrariesLanguages & Runtimes
Added to GitGenius on September 18th, 2026
Created on February 20th, 2020
Open Issues & Pull Requests: 143 (+0)
GitHub issues: Enabled
Number of forks: 414
Total Stargazers: 3,772 (+0)
Total Subscribers: 149 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 2.9 days
Mean response time: 83.6 days
90th percentile: 116.7 days
Tracked items: 105

Most active contributors

Sign in to see contributor activity.

How this project is maintained

60% of open issues come from outside the core team, a mix of external reports and the maintainers' own roadmap. Three people close 92% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 50
New in 7 days: 2
Closed in 7 days: 2
Avg open age: 802 days
Stale 30+ days: 46
Stale 90+ days: 41

Recent activity

Opened in 7 days: 2
Closed in 7 days: 2
Comments in 7 days: 0
Events in 7 days: 1

Top labels

  • enhancement (16)
  • bug (7)
  • good first issue (6)
  • help wanted (5)
  • documentation (3)
  • wontfix (1)

Detailed Description

Swift Argument Parser is a command-line argument parsing library for Swift that provides type-safe parsing through property wrappers and declarative command definitions.

The library solves the problem of parsing command-line arguments by letting developers declare a type that represents their command's interface, decorating properties with property wrappers to specify arguments, options, and flags. Developers then conform to ParsableCommand or AsyncParsableCommand and implement a run method containing the command logic. The parser automatically instantiates the command type from command-line arguments, generates help text and error messages based on property names and types, and handles execution or exits with useful feedback.

Developers adopting this tool should know it works well for building command-line tools in Swift where type safety and automatic help generation are valuable. The library supports nested commands and subcommands, async/await patterns through AsyncParsableCommand, and hybrid options that function both as flags and as options with values. It suits projects ranging from simple straight-line scripts to tools with deep command hierarchies. The README does not compare it to alternatives.

The project maintains source stability with semantic versioning, meaning public API changes only occur in major version releases. The library embraces Swift language improvements and periodically requires clients to upgrade to newer Swift toolchain versions, though such requirements only trigger minor version bumps. Help text and error message formatting, along with examples, tests, and documentation, may change in any release without triggering a major version increment.