Herramienta de línea de comandos con numerosas funciones para descargar audio y video de miles de sitios web, derivada de youtube-dl.
apple/swift-argument-parser
A type-safe Swift library for declaring and parsing command-line arguments, options, and flags with auto-generated help.
- Estrellas
- 3,793
- Forks
- 438
- Issues abiertos
- 154
- Último commit
- hace 3 días
¿Qué es?
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.
Funciones clave
- 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.
Casos de uso
- 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.
Temas
Preguntas frecuentes
- ¿Qué es 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 es gratuito? ¿Qué licencia tiene?
- swift-argument-parser es open source bajo la licencia Apache-2.0. Revisa los términos de la licencia antes de usarlo en productos comerciales.
- ¿swift-argument-parser sigue mantenido?
- Mantenimiento activo. El último commit de swift-argument-parser fue el 16 oct 2026.
- ¿Para qué puedo usar 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.
- ¿Dónde consigo swift-argument-parser?
- El código fuente y las instrucciones de instalación están en GitHub: https://github.com/apple/swift-argument-parser
Resumen generado por IA a partir del README del proyecto. Las estadísticas de GitHub se actualizan a diario.
Proyectos relacionados
A smarter cd command that learns your most-used directories and lets you jump to them with a few keystrokes, across all major shells.
A macOS CLI and AI agent skill that draws big arrows, boxes and signs on screen to point users at UI elements, without clicking or capturing anything.
A macOS terminal app for running and monitoring multiple coding agents, with sessions kept alive by a daemon and an iPhone companion.
Kit de herramientas que genera interfaces de línea de comandos nativas para agentes a partir de software existente e incluye CLI-Hub, un registro para instalar CLIs listas para usar.
A cross-platform Xcode replacement that builds, signs and installs iOS apps from SwiftPM packages on Linux, Windows and macOS.