PHPackages                             webtrendi/clapp - 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. webtrendi/clapp

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

webtrendi/clapp
===============

Parses command line arguments passed to a PHP script

v1.1.1(5y ago)8275↓83.3%[1 issues](https://github.com/webtrendi/clapp/issues)1MITPHPPHP &gt;=5.3.0

Since Apr 11Pushed 5y ago2 watchersCompare

[ Source](https://github.com/webtrendi/clapp)[ Packagist](https://packagist.org/packages/webtrendi/clapp)[ RSS](/packages/webtrendi-clapp/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)DependenciesVersions (6)Used By (1)

CLAPP: Command Line Argument Parser For PHP
===========================================

[](#clapp-command-line-argument-parser-for-php)

[![Build Status](https://camo.githubusercontent.com/ac02d28dde3199d0060a0337cdc335537093d5d4f9b06f4bc495dda085ce1a85/68747470733a2f2f7472617669732d63692e6f72672f7765627472656e64692f636c6170702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/webtrendi/clapp)

Parses command line arguments passed to a PHP script.

Usage
-----

[](#usage)

```
// Define accepted arguments
$definitions = new \Clapp\CommandLineArgumentDefinition(array(
    "help|h"      => "Shows help message",
    "message|m=s" => "Input message",
    "verbose|v+"  => "Set level of verbose output",
));

// Filter arguments based and validate according to definitions
$filter = new \Clapp\CommandArgumentFilter($definitions, $argv);

// Retrieve parameter if set
if ($filter->getParam('h') !== false) {
    echo $definitions->getUsage();
    exit();
} //if
```

Features
--------

[](#features)

- Simple definition syntax
- Supports long and short arugment names (-v --verbose)
- Supports repeated arguments (--name=bob --name=mary)
- Supports multiple short arguments (-abc equivalent of -a -b -c)
- Supports 2 ways of setting values (--name=bob or --name bob)
- Supports double dash delimiter for trailing values
- Creates detailed usage documentation using definitions

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

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 ~747 days

Total

4

Last Release

2175d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/792553?v=4)[Patrick Forget](/maintainers/patforg)[@patforg](https://github.com/patforg)

---

Top Contributors

[![patforg](https://avatars.githubusercontent.com/u/792553?v=4)](https://github.com/patforg "patforg (22 commits)")

---

Tags

cliconsolecommand-lineargument parsing

### Embed Badge

![Health badge](/badges/webtrendi-clapp/health.svg)

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

###  Alternatives

[symfony/console

Eases the creation of beautiful and testable command line interfaces

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

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

4.6k331.8M8.5k](/packages/nunomaduro-collision)[nunomaduro/laravel-console-menu

Laravel Console Menu is an output method for your Laravel/Laravel Zero commands.

815412.0k48](/packages/nunomaduro-laravel-console-menu)[nunomaduro/laravel-console-task

Laravel Console Task is a output method for your Laravel/Laravel Zero commands.

2582.1M11](/packages/nunomaduro-laravel-console-task)[splitbrain/php-cli

Easy command line scripts for PHP with opt parsing and color output. No dependencies

177817.2k28](/packages/splitbrain-php-cli)[nunomaduro/laravel-console-summary

A Beautiful Laravel Console Summary for your Laravel/Laravel Zero commands.

662.0M3](/packages/nunomaduro-laravel-console-summary)

PHPackages © 2026

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