Library for parsing CLI options
1.2k
Stars
7
Forks
1
Open issues
4
Contributors
AI Analysis
A lightweight PHP library for parsing command-line arguments from $_SERVER['argv'], extracted from PHPUnit's internal utilities. It serves developers building CLI tools in PHP who need robust argument parsing without heavy dependencies. Best suited for PHP framework authors and CLI tool developers; not intended for web application request parsing.
Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.
AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.
Lightweight PHP CLI argument parser extracted from PHPUnit, serving as a focused utility for testing frameworks
sebastian/cli-parser is a PHP library that extracts and standardizes command-line argument parsing logic originally embedded in PHPUnit. It provides a minimal, purpose-built solution for parsing $_SERVER['argv'] with no external dependencies. Adoption appears limited to testing frameworks and developer tools within the PHP ecosystem, particularly PHPUnit-adjacent projects. The project solves a real but narrow problem: cleanly decoupling CLI parsing from test runner logic.
Created in August 2020 by Sebastian Bergmann, extracted from PHPUnit's codebase to promote reusability and separation of concerns. This reflects a common pattern in mature projects: isolating well-tested utilities into standalone libraries to reduce coupling and enable broader use.
The project shows modest, stable adoption (~1,208 stars, 7 forks) with minimal star growth in recent periods. The consistent activity (last push 2026-07-08) suggests maintenance rather than expansion. Growth appears driven by inclusion as a dependency in PHPUnit and related tools, rather than organic developer discovery or competitive differentiation.
Adoption not verified beyond reasonable inference that PHPUnit itself depends on this library (as it was extracted from PHPUnit). No public documentation of downstream users, production deployments, or adoption metrics. The presence on Packagist and use in CI suggests real usage, but scale and breadth are undisclosed.
Based on README, the library appears to be a single-purpose extraction: a stateless parser for $_SERVER['argv']. Likely organized as a lean utility without configuration frameworks or plugin systems. The extraction narrative suggests clean API boundaries, though specific design patterns are not documented in the README.
README displays a codecov badge linked to the repository, indicating test coverage is measured and tracked, but the specific percentage or targets are not stated in the provided excerpt. The presence of CI/CD badges suggests continuous testing is enforced.
Active maintenance confirmed: last push on 2026-07-08 (current date is 2026-07-09), indicating the project is being monitored and updated. CI workflow is present and functional. No evidence of stagnation; the slow star accumulation reflects narrow scope rather than abandonment. Issue and PR activity not disclosed in metadata.
ADOPT IF: you are building a testing framework, developer tool, or CLI utility in PHP and want a lightweight, zero-dependency argument parser that follows PHPUnit's proven patterns. AVOID IF: you need a feature-rich CLI framework (use Symfony Console instead), or if you require extensive community support and third-party integrations. MONITOR IF: you depend on PHPUnit and want to understand its internal CLI dependencies, or if you're considering extracting similar utilities from your own mature projects.
Independent dimensions
Mainstream potential
2/10
Technical importance
5/10
Adoption evidence
3/10
- Narrow scope and limited adoption mean fewer community examples and third-party integrations compared to larger frameworks.
- Single-author maintenance (Bergmann) creates key-person risk, though his track record with PHPUnit suggests reliability.
- No documented API stability promise or semantic versioning policy stated in README; breaking changes across minor versions possible.
- Adoption appears primarily internal to PHPUnit ecosystem; untested in diverse production environments outside testing tools.
- Limited discoverability: developers solving CLI parsing problems may not find this library if they don't know to look within PHPUnit's ecosystem.
This project will remain a stable, slowly-growing utility library with enduring use within PHPUnit and related testing tools. Unlikely to achieve mainstream adoption across general PHP CLI development, but will maintain its niche as long as PHPUnit remains the dominant testing framework. Incremental maintenance expected; no major feature expansion anticipated given the scope.
Newsletter
Get analyses like this every Monday
Free weekly digest of the most interesting open-source discoveries.
Languages
Information
- Language
- PHP
- License
- BSD-3-Clause
- Last updated
- 2d ago
- Created
- 72mo ago
- Analyzed with
- anthropic/claude-haiku-4-5
Stars over time
Contributors over time
Top 100 contributors only — repos with more will plateau at 100.
Open issues
Open pull requests
No open pull requests.
Top contributors
Similar repos
sebastianbergmann/environment
This PHP library provides utilities for detecting and handling runtime-specific...
| Repository | Stars | Week Δ | Language | Score | Updated |
|---|---|---|---|---|---|
|
|
1.2k | — | PHP | 8/10 | 2d ago |
|
|
6.8k | — | PHP | 8/10 | 2d ago |
|
|
1.1k | — | PHP | 7/10 | 5mo ago |
|
|
17.4k | — | PHP | 9/10 | 2d ago |
|
|
4.4k | — | C++ | 8/10 | 2d ago |
|
|
8.9k | — | PHP | 8/10 | 7h ago |
Symfony's Console component provides comprehensive CLI argument parsing with features like commands, options, and interactive prompts. sebastian/cli-parser is far more minimal and dependency-free, suitable for tools that need only argument parsing without a full framework.
A third-party CLI parsing library. sebastian/cli-parser is authored by a maintainer with higher visibility in the PHP testing ecosystem and requires no external dependencies, but Getopt offers more configuration flexibility.
Native PHP function with limited feature set. sebastian/cli-parser likely provides better abstractions and error handling, but adds a dependency that built-in functions avoid.
Another option-parsing library with a different API philosophy. Less well-maintained than sebastian/cli-parser based on visibility and author reputation.