PHPackages                             codecounter/php-argv - 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. codecounter/php-argv

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

codecounter/php-argv
====================

A library for process php argv in command line.

429PHP

Since Jan 29Pushed 11y ago1 watchersCompare

[ Source](https://github.com/codecounter/php-argv)[ Packagist](https://packagist.org/packages/codecounter/php-argv)[ RSS](/packages/codecounter-php-argv/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-argv
========

[](#php-argv)

A library for process php argv in command line.

Installation
============

[](#installation)

With composer

```
{
    ...
    "require": {
        "codecounter/php-argv": "0.1.0"
    }
}

```

Without composer

```
require '/path/to/php-argv/autoload.php';
```

Usage
=====

[](#usage)

```
// first, create a php-argv instance
$phpArgv = new \CodeCounter\PHPArgv\Argv();

// set version, desc
$phpArgv->version('1.0.0')
    ->desc('Some description for this command');

// create default module(sub command)
$phpArgv->module()
    // set description for this module
    ->desc()
    // set allowed options
    ->options(array(
        array(
            'key' => 'num',
            'type' => 'int'
        ),
        array(
            'key' => 'path',
            'type '=> 'path'
        )
    ))
    ->onProcess(function ($module, $options) {
        if (empty($options) || isset($options['help'])) {
            $module->defaultHelp();
        }

        // other logic
    });

// create another module
$phpArgv->module('another-module')
    ...

// parse argv, default is global argv
$phpArgv->parse();
```

Documentation
=============

[](#documentation)

\[complete later\]

Test
====

[](#test)

```
cd /path/to/php-argv/tests
php index.php --help

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/030a3499da596715f5efc32a0b0390914c9e006876433465999ceab504e1a5ba?d=identicon)[codecounter](/maintainers/codecounter)

---

Top Contributors

[![codecounter](https://avatars.githubusercontent.com/u/10571656?v=4)](https://github.com/codecounter "codecounter (5 commits)")

### Embed Badge

![Health badge](/badges/codecounter-php-argv/health.svg)

```
[![Health](https://phpackages.com/badges/codecounter-php-argv/health.svg)](https://phpackages.com/packages/codecounter-php-argv)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.1k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)[codedungeon/php-cli-colors

Liven up you PHP Console Apps with standard colors

10210.1M26](/packages/codedungeon-php-cli-colors)

PHPackages © 2026

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