PHPackages                             clip/clip - 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. clip/clip

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

clip/clip
=========

A simple framework for making and running CLI (console) commands

1.0.1(13y ago)21311MITPHPPHP &gt;=5.3.2

Since Nov 17Pushed 11y ago3 watchersCompare

[ Source](https://github.com/jimdoescode/clip)[ Packagist](https://packagist.org/packages/clip/clip)[ Docs](https://github.com/jimdoescode/clip)[ RSS](/packages/clip-clip/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (3)Used By (0)

Overview
--------

[](#overview)

Clip is a simple framework for making CLI (console) commands in PHP.

You can run a command by typing the following:

```
$ clip  [parameters...]

```

Output from the command will be displayed in the console.

New Commands
------------

[](#new-commands)

Make a new command by adding a file to the 'commands' directory. The file name should exactly match the class name. Clip provides an interface that must be implemented for any command.

```
class NewCommand implements \Clip\Command
```

This Command interface has two methods that must be defined:

The 'run' method which actually executes the command:

```
public function run(array $params)
```

The 'help' method which outlines what this command actually does:

```
public function help()
```

Configuration
-------------

[](#configuration)

Clip provides a very simple way to create and access config files. Add a new file to the 'config' directory. In that file you will return an associative array of configuration parameters.

```
return array(
    'foo' => 'bar',
    'test' => 'baz'
);
```

To access these parameters you would use the following command:

```
\Clip\Config::('foo');
```

You can specify additional configuration keys as parameters to the call to get an array back for each key specified.

```
\Clip\Config::('foo', 'test');
```

You can also not specify any parameters to get the entire configuration array back.

```
\Clip\Config::();
```

Styling Output
--------------

[](#styling-output)

Clip lets you style your output if you so choose. To do so you will need to use the render function under the clip namespace.

```
\Clip\render('Some colorful test [red]output[reset]. Neato!');
```

Check out the styles.php config file for the different options. Use the square bracket syntax with the key of the style in it. Feel free to add any additional styles that are not currently set in the config file.

Command nesting
---------------

[](#command-nesting)

If you would like to call another Command inside of a Command you can do that with Clip. Access the current Clip instance using the 'instance' method. Then call the 'fire' method on the Clip instance specifying what the other Command is and what parameters to use.

```
\Clip\instance()->fire('OtherCommand', $params);
```

This is useful if you have a separate Command that needs to be executed immediately after another Command finishes or if a Command relies on some parameters from another Command. I would advise that if you aren't careful this type of execution stack can get messy with too many Commands called consecutively.

Help
----

[](#help)

You can see what commands are available by typing:

```
$ clip

```

To see help text for a command you would type:

```
$ clip help

```

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

[](#installation)

Copy the files where ever you need them. All the files with the exception of commands/Test.php are required so make sure you have them all.

Also make sure the clip command file (./clip) has execute permissions.

License
-------

[](#license)

Clip is MIT licensed

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

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.

###  Release Activity

Cadence

Every ~120 days

Total

2

Last Release

4810d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/546125?v=4)[Jim](/maintainers/jimdoescode)[@jimdoescode](https://github.com/jimdoescode)

---

Top Contributors

[![jimdoescode](https://avatars.githubusercontent.com/u/546125?v=4)](https://github.com/jimdoescode "jimdoescode (1 commits)")

---

Tags

cliconsolemicroframework

### Embed Badge

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

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

###  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/termwind

It's like Tailwind CSS, but for the console.

2.5k239.8M286](/packages/nunomaduro-termwind)[wp-cli/php-cli-tools

Console utilities for PHP

68325.0M367](/packages/wp-cli-php-cli-tools)[php-school/cli-menu

A command line menu helper in PHP

2.0k1.1M27](/packages/php-school-cli-menu)[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)

PHPackages © 2026

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