PHPackages                             bag2php/p-command - 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. bag2php/p-command

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

bag2php/p-command
=================

AWK like PHP wrapper for command line

04PHP

Since Sep 2Pushed 6y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

p - AWK like PHP wrapper for command line
=========================================

[](#p---awk-like-php-wrapper-for-command-line)

`p` command is inspired by [AWK](http://www.awklang.org/), [rb](https://github.com/thisredone/rb) and [opy](https://github.com/ryuichiueda/opy).

Special variable
----------------

[](#special-variable)

- User-modified variables:
    - **`string $OFS`** - Output Field Separator *(default: ` `)* \[AWK compatible\]
    - **`string $ORS`** - Output Record Separator *(default: `PHP_EOL`)* \[AWK compatible\]
- Auto-set variables:
    - **`int $NR`** - The number of input records \[AWK compatible\]
    - **`int $FNR`** - The current record number in the current file \[AWK compatible\]
    - **`string $F0`** - Contains current line
    - **`string[] $F`** - Contains fields separated by `$OFS` \[AWK compatible\]
    - **`int $NF`** - The number of fields in `$F` \[AWK compatible\]
    - **`int $argi`** - Same as `$NR` \[PHP compatible\]
    - **`string $argn`** - Same as `$F0` \[PHP compatible\]

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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/e1cc4bc1729b858086681a12494fda6cced8f26db3d0928ae4d81c68ddf8dc06?d=identicon)[zonuexe](/maintainers/zonuexe)

---

Top Contributors

[![zonuexe](https://avatars.githubusercontent.com/u/822086?v=4)](https://github.com/zonuexe "zonuexe (8 commits)")

### Embed Badge

![Health badge](/badges/bag2php-p-command/health.svg)

```
[![Health](https://phpackages.com/badges/bag2php-p-command/health.svg)](https://phpackages.com/packages/bag2php-p-command)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

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

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[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)

PHPackages © 2026

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