PHPackages                             packfire/options - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. packfire/options

AbandonedArchivedLibrary[CLI &amp; Console](/categories/cli)

packfire/options
================

Better CLI argument processing in PHP

1.1.2(13y ago)3981[1 issues](https://github.com/packfire/options/issues)1BSD-3-ClausePHPPHP &gt;=5.3.0

Since Dec 6Pushed 13y ago1 watchersCompare

[ Source](https://github.com/packfire/options)[ Packagist](https://packagist.org/packages/packfire/options)[ Docs](http://mauris.sg/packfire/)[ RSS](/packages/packfire-options/feed)WikiDiscussions develop Synced today

READMEChangelogDependenciesVersions (6)Used By (1)

\#Packfire Options

> Better CLI argument processing in PHP

Options helps you to parse CLI arguments using callbacks and Closures (in PHP 5.3+) effectively. Implementing the [NDesk.Options (C#)](http://www.ndesk.org/Options) in PHP, you will be able to write neat CLI applications in PHP quickly.

\##Requirements

- > = PHP 5.3

\##Installation

To install Packfire Options, add the entry to your `composer.json` "require" section:

```
"packfire/options": "1.1.*"

```

\##Usage

```
use Packfire\Options\OptionSet;

$command = null;
$quiet = false;
$force = false;
$linker = false;
$file = '';

$options = new OptionSet();

$options->addIndex(0, function($value) use(&$command) {
            $command = $value;
        });
$options->add('q', function() use(&$quiet) {
            $quiet = true;
        });
$options->add('l', function() use(&$linker) {
            $linker = true;
        });
$options->add('f', function() use(&$force) {
            $force = true;
        });
$options->add('file=', function($value) use(&$file) {
            $file = $value;
        });

$options->parse($_SERVER['argv']);

```

\##Projects using Packfire Options

- [PDC Dependency Checker](https://github.com/packfire/pdc)

\##Contributors

- Sam-Mauris Yong (@thephpdeveloper)

\##License

Packfire Options is licensed under the BSD 3-Clause License. See license file in repository for details.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

4

Last Release

4939d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1743cee8bb3242229368d7fca5a7ac952932fd377d0c3d4343eb8dceea6a395e?d=identicon)[mauris](/maintainers/mauris)

---

Top Contributors

[![mauris](https://avatars.githubusercontent.com/u/996939?v=4)](https://github.com/mauris "mauris (30 commits)")

---

Tags

cliprocessingclosurecallbackargument

### Embed Badge

![Health badge](/badges/packfire-options/health.svg)

```
[![Health](https://phpackages.com/badges/packfire-options/health.svg)](https://phpackages.com/packages/packfire-options)
```

###  Alternatives

[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.1B13.9k](/packages/symfony-console)[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.7k357.7M11.1k](/packages/nunomaduro-collision)[nunomaduro/termwind

It's like Tailwind CSS, but for the console.

2.5k271.5M386](/packages/nunomaduro-termwind)[wp-cli/wp-cli

WP-CLI framework

5.1k19.1M406](/packages/wp-cli-wp-cli)[wp-cli/php-cli-tools

Console utilities for PHP

68227.8M375](/packages/wp-cli-php-cli-tools)[socialengine/sniffer-rules

A Lumen 5 and Laravel 5 SquizLabs Code Sniffer 2.0 artisan command. Detect violations of a defined coding standard. It helps your code remains clean and consistent.

1348.3k1](/packages/socialengine-sniffer-rules)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
