PHPackages                             facebook/hh-clilib - 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. facebook/hh-clilib

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

facebook/hh-clilib
==================

v2.6.0(5y ago)8782.6k↑213.8%12[3 issues](https://github.com/hhvm/hh-clilib/issues)14MITHack

Since Jun 12Pushed 3y ago10 watchersCompare

[ Source](https://github.com/hhvm/hh-clilib)[ Packagist](https://packagist.org/packages/facebook/hh-clilib)[ RSS](/packages/facebook-hh-clilib/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (10)Dependencies (8)Versions (30)Used By (14)

Hack CLI Library
================

[](#hack-cli-library)

[![Continuous Integration](https://github.com/hhvm/hh-clilib/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/hhvm/hh-clilib/actions/workflows/build-and-test.yml)

This library provides basic command-line handling, including:

- parsing of `ARGV`
- interactive TTY detection
- color TTY detection

It aims for as much code as possible to be in strict mode.

Installation
------------

[](#installation)

```
hhvm composer.phar require facebook/hh-clilib

```

Examples
--------

[](#examples)

In `src/MyCLI.hh`:

```
// MyCLI.hh
getStdout()->write("Hello, world!");
    return 0;
  }
}
```

In `bin/mycli`:

```
 { $this->verbosity++; },
			"Increase output verbosity",
			'--verbose',
			'-v',
		),
		CLIOptions\with_required_enum(
			OutputFormat::class,
			$f ==> { $this->format = $f; },
			Str\format(
				"Desired output format (%s). Default: %s",
				Str\join(OutputFormat::getValues(), '|'),
				(string) $this->format,
			),
			'--format',
			'-f',
		),
		CLIOptions\with_required_string(
			$s ==> { $this->outputRoot = $s; },
			"Directory for output files. Default: working directory",
			'--output',
			'-o',
		),
	];
}
```

Arguments
---------

[](#arguments)

Arguments do not have a name, and may be required. To support arguments, extend `CLIWithArguments` or `CLIWithRequiredArguments`.

Arguments are always strings, and can be retrieved via `->getArguments();`

Contributing
------------

[](#contributing)

See [CONTRIBUTING.md](CONTRIBUTING.md).

License
-------

[](#license)

hh-clilib is MIT-licensed.

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity46

Moderate usage in the ecosystem

Community34

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 73.8% 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 ~32 days

Recently: every ~42 days

Total

29

Last Release

2028d ago

Major Versions

v1.2.1 → v2.0.02018-11-29

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3757713?v=4)[Joel Marcey](/maintainers/JoelMarcey)[@JoelMarcey](https://github.com/JoelMarcey)

![](https://avatars.githubusercontent.com/u/601530?v=4)[Yang, Bo](/maintainers/Atry)[@Atry](https://github.com/Atry)

![](https://avatars.githubusercontent.com/u/727402?v=4)[Alexey Toptygin](/maintainers/alexeyt)[@alexeyt](https://github.com/alexeyt)

---

Top Contributors

[![fredemmott](https://avatars.githubusercontent.com/u/360927?v=4)](https://github.com/fredemmott "fredemmott (96 commits)")[![JoelMarcey](https://avatars.githubusercontent.com/u/3757713?v=4)](https://github.com/JoelMarcey "JoelMarcey (16 commits)")[![jjergus](https://avatars.githubusercontent.com/u/2483917?v=4)](https://github.com/jjergus "jjergus (8 commits)")[![lexidor](https://avatars.githubusercontent.com/u/31805625?v=4)](https://github.com/lexidor "lexidor (3 commits)")[![azjezz](https://avatars.githubusercontent.com/u/29315886?v=4)](https://github.com/azjezz "azjezz (2 commits)")[![YuryBandarchuk16](https://avatars.githubusercontent.com/u/19752696?v=4)](https://github.com/YuryBandarchuk16 "YuryBandarchuk16 (1 commits)")[![kmeht](https://avatars.githubusercontent.com/u/1120478?v=4)](https://github.com/kmeht "kmeht (1 commits)")[![marcellino-ornelas](https://avatars.githubusercontent.com/u/35247622?v=4)](https://github.com/marcellino-ornelas "marcellino-ornelas (1 commits)")[![Wilfred](https://avatars.githubusercontent.com/u/70800?v=4)](https://github.com/Wilfred "Wilfred (1 commits)")[![alexeyt](https://avatars.githubusercontent.com/u/727402?v=4)](https://github.com/alexeyt "alexeyt (1 commits)")

### Embed Badge

![Health badge](/badges/facebook-hh-clilib/health.svg)

```
[![Health](https://phpackages.com/badges/facebook-hh-clilib/health.svg)](https://phpackages.com/packages/facebook-hh-clilib)
```

PHPackages © 2026

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