PHPackages                             mcuadros/cli-array-editor - 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. mcuadros/cli-array-editor

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

mcuadros/cli-array-editor
=========================

This library provides an easy way to edit arrays in CLI using vim or your preferred editor.

1995PHP

Since Apr 8Pushed 13y ago1 watchersCompare

[ Source](https://github.com/mcuadros/cli-array-editor)[ Packagist](https://packagist.org/packages/mcuadros/cli-array-editor)[ RSS](/packages/mcuadros-cli-array-editor/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

CLIArrayEditor [![Build Status](https://camo.githubusercontent.com/73c54256e90db42db7ad3f81b3ed7ea8e0c1443295634571c3ed1880e1d7fcbe/68747470733a2f2f7472617669732d63692e6f72672f6d63756164726f732f636c692d61727261792d656469746f722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/mcuadros/cli-array-editor)
=========================================================================================================================================================================================================================================================================================================================

[](#cliarrayeditor-)

This library provides an easy way to edit arrays in CLI using vim or your preferred editor.

Can be useful in scenarios where we need an interface to edit arrays from a CLI PHP application, CLIArrayEditor will open an editor with the array in a readable format (json, yaml, etc) and wait for the user (like "crontab -e" or "git commit").

The editor can be configured or by default $EDITOR from the environment will be used.

Requirements
------------

[](#requirements)

- PHP 5.3.23;
- Unix system;
- PECL yaml &gt;= 0.5.0 (optional)

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

[](#installation)

The recommended way to install CLIArrayEditor is [through composer](http://getcomposer.org). You can see [package information on Packagist.](https://packagist.org/packages/mcuadros/cli-array-editor)

```
{
    "require": {
        "mcuadros/cli-array-editor": "dev"
    }
}
```

Examples
--------

[](#examples)

```
use CLIArrayEditor\Editor;
use CLIArrayEditor\Format\JSON;

$tmp = array(
    'baz' => true,
    'foo' => 'bar'
);

$editor = new Editor();
$result = $editor
    ->setFormat(new JSON)
    ->edit($tmp);

print_r($result);
```

Check available Editor's methods in [src/CLIArrayEditor/Editor.php](src/CLIArrayEditor/Editor.php)

Tests
-----

[](#tests)

Tests are in the `tests` folder. To run them, you need PHPUnit. Example:

```
$ phpunit --configuration phpunit.xml.dist

```

License
-------

[](#license)

MIT, see [LICENSE](LICENSE)

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

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://avatars.githubusercontent.com/u/1573114?v=4)[Máximo Cuadros](/maintainers/mcuadros)[@mcuadros](https://github.com/mcuadros)

---

Top Contributors

[![mcuadros](https://avatars.githubusercontent.com/u/1573114?v=4)](https://github.com/mcuadros "mcuadros (14 commits)")

### Embed Badge

![Health badge](/badges/mcuadros-cli-array-editor/health.svg)

```
[![Health](https://phpackages.com/badges/mcuadros-cli-array-editor/health.svg)](https://phpackages.com/packages/mcuadros-cli-array-editor)
```

###  Alternatives

[seld/cli-prompt

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

24726.4M22](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

13045.3M6.2k](/packages/illuminate-console)[styleci/cli

The CLI tool for StyleCI

71464.1k9](/packages/styleci-cli)[winbox/args

Windows command-line formatter

20718.9k21](/packages/winbox-args)

PHPackages © 2026

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