Repolode
apple

apple/swift-argument-parser

A type-safe Swift library for declaring and parsing command-line arguments, options, and flags with auto-generated help.

스타
3,793
포크
438
열린 이슈
154
마지막 커밋
3일 전

어떤 프로젝트인가요?

Swift Argument Parser is a library for building command-line tools in Swift. You declare a type whose stored properties are annotated with property wrappers for flags, options, and positional arguments, then conform it to ParsableCommand or AsyncParsableCommand. The library parses the arguments, instantiates your type, and runs your run() method, or exits with an error message.

Because the parser uses property names, types, and the help text you supply, it generates usage lines, detailed --help output, and error messages without extra code. Commands can be nested into subcommands, and the package includes examples such as a nested math tool and an async/await line counter.

The package follows semantic versioning and requires a minimum Swift toolchain that depends on the release, from Swift 5.1 for early versions up to Swift 6.0 for 1.8.0 and later.

핵심 기능

  • 01Declare flags, options, and positional arguments with property wrappers.
  • 02Generates usage text, detailed help, and error messages automatically.
  • 03Supports nested commands and subcommands.
  • 04Offers async/await support through AsyncParsableCommand.
  • 05Integrates with Swift Package Manager as a dependency.

활용 사례

  • Building a command-line tool in Swift or on Apple platforms.
  • Adding a structured subcommand hierarchy to an existing Swift CLI.
  • Writing a quick script-style utility that needs typed argument parsing.

토픽

자주 묻는 질문

swift-argument-parser은(는) 무엇인가요?
A type-safe Swift library for declaring and parsing command-line arguments, options, and flags with auto-generated help. Swift Argument Parser is a library for building command-line tools in Swift. You declare a type whose stored properties are annotated with property wrappers for flags, options, and positional arguments, then conform it to ParsableCommand or AsyncParsableCommand. The library parses the arguments, instantiates your type, and runs your run() method, or exits with an error message.
swift-argument-parser은(는) 무료로 사용할 수 있나요? 라이선스는 무엇인가요?
swift-argument-parser은(는) Apache-2.0 라이선스의 오픈소스입니다. 상업용 제품에 사용하기 전에 라이선스 조건을 확인하세요.
swift-argument-parser은(는) 아직 유지보수되고 있나요?
활발히 유지보수 중. swift-argument-parser의 마지막 커밋은 2026년 10월 16일입니다.
swift-argument-parser은(는) 어디에 사용할 수 있나요?
Building a command-line tool in Swift or on Apple platforms. Adding a structured subcommand hierarchy to an existing Swift CLI. Writing a quick script-style utility that needs typed argument parsing.
swift-argument-parser은(는) 어디서 받을 수 있나요?
소스 코드와 설치 방법은 GitHub에 있습니다: https://github.com/apple/swift-argument-parser

요약은 프로젝트 README를 바탕으로 AI가 작성했습니다. GitHub 통계는 매일 갱신됩니다.

관련 프로젝트