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

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

decodelabs/clip
===============

CLI kernel integration for DecodeLabs Genesis

v0.6.8(7mo ago)018.2k5MITPHPPHP ^8.4CI passing

Since Nov 22Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/decodelabs/clip)[ Packagist](https://packagist.org/packages/decodelabs/clip)[ RSS](/packages/decodelabs-clip/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (42)Used By (5)

Clip
====

[](#clip)

[![PHP from Packagist](https://camo.githubusercontent.com/f954b8c4457c40b657fd1832750c3576be9000a15810b2691006ead12710a495/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6465636f64656c6162732f636c69703f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/clip)[![Latest Version](https://camo.githubusercontent.com/3b4029530228ad94fb7668cb929c1084688d87512565e0a3b4ca2a5a6c44fb9f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465636f64656c6162732f636c69702e7376673f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/clip)[![Total Downloads](https://camo.githubusercontent.com/d5885d3c3deb26ac1d50239bcb5505f40a50ceaafb5439bcef475e2fd3bac845/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6465636f64656c6162732f636c69702e7376673f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/clip)[![GitHub Workflow Status](https://camo.githubusercontent.com/c86e169dfad75d074216c44111db76ce07f5239add90f7a699554d61f8906227/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6465636f64656c6162732f636c69702f696e746567726174652e796d6c3f6272616e63683d646576656c6f70)](https://github.com/decodelabs/clip/actions/workflows/integrate.yml)[![PHPStan](https://camo.githubusercontent.com/e25c14ce011edabdd0fbd2e10415b41cc5d66ed11ef3e5b7edd074c5bdd35a2d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d656e61626c65642d3434434331312e7376673f6c6f6e6743616368653d74727565267374796c653d666c6174)](https://github.com/phpstan/phpstan)[![License](https://camo.githubusercontent.com/cccefe1559759ea795726cbc1466116b7b5ba6bdc72847b70a59f0c9c55ddb48/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6465636f64656c6162732f636c69703f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/clip)

### CLI kernel integration for DecodeLabs Genesis

[](#cli-kernel-integration-for-decodelabs-genesis)

Clip provides a framework for building comprehensive CLI based applications on top of [Genesis](https://github.com/decodelabs/genesis).

---

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

[](#installation)

This package requires PHP 8.4 or higher.

Install via Composer:

```
composer require decodelabs/clip
```

Usage
-----

[](#usage)

Clip is a middleware library that provides an out-of-the-box setup for implementing a Genesis based CLI task runner. This means you don't really interact with it much directly, except when setting up the core of your task running infrastructure.

### Create your Hub

[](#create-your-hub)

Define your Genesis Hub by extending Clip's abstract implementation:

```
namespace MyThing;

use DecodeLabs\Archetype;
use DecodeLabs\Clip\Hub as ClipHub;
use DecodeLabs\Commandment\Action as ActionInterface;
use MyThing\Action;

class Hub extends ClipHub
{
    public function initializePlatform(): void
    {
        parent::initializePlatform();

        // Load tasks from local namespace
        $archetype = $this->container->get(Archetype::class);
        $archetype->map(ActionInterface::class, Action::class);
    }
}
```

With this hub in place, you can run tasks defined in your nominated namespace from the terminal via a bin defined in composer:

```
namespace MyThing;

use DecodeLabs\Genesis\Bootstrap\Bin as BinBootstrap;
use MyThing\Hub;

require_once $_composer_autoload_path ?? __DIR__ . '/../vendor/autoload.php';
new BinBootstrap(Hub::class)->run();
```

```
{
    "bin": [
        "bin/thing"
    ]
}
```

Define your task:

```
namespace MyThing\Action;

use DecodeLabs\Commandment\Action;
use DecodeLabs\Commandment\Request;

class MyAction implements Action
{
    public function execute(
        Request $request
    ): bool {
        // Do the thing
        return true;
    }
}
```

```
composer exec thing my-action

# or with effigy
effigy thing my-action
```

### IO

[](#io)

When writing back to the terminal, you *can* use a `Terminus\Session`:

```
use DecodeLabs\Monarch;
use DecodeLabs\Terminus\Session;

$io = Monarch::getService(Session::class);
$io->$writeLine('Hello world');
```

To make your Actions as portable as possible, you should import the Terminus `Session` in your Action constructor using Commandment's dependency injection:

```
namespace MyThing\Action;

use DecodeLabs\Commandment\Action;
use DecodeLabs\Commandment\Request;
use DecodeLabs\Terminus\Session;

class MyAction implements Action
{
    public function __construct(
        private Session $io
    ) {
    }

    public function execute(
        Request $request
    ): bool {
        $this->io->writeLine('Hello world');

        return true;
    }
}
```

Then, any calling code can provide an alternative `Session` instance to the `Dispatcher` to allow your Action to run in a different context.

Licensing
---------

[](#licensing)

Clip is licensed under the MIT License. See [LICENSE](./LICENSE) for the full license text.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance67

Regular maintenance activity

Popularity22

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity66

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

Recently: every ~3 days

Total

40

Last Release

223d ago

PHP version history (3 changes)v0.1.0PHP ^8.0

v0.3.9PHP ^8.1

v0.3.16PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a241d64d12b3b5ee94197862ec1ec30b82ed2efa34a0cd7f4c3565a021daddd?d=identicon)[betterthanclay](/maintainers/betterthanclay)

---

Top Contributors

[![betterthanclay](https://avatars.githubusercontent.com/u/1273586?v=4)](https://github.com/betterthanclay "betterthanclay (157 commits)")

---

Tags

clikernelphp

### Embed Badge

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

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

###  Alternatives

[drush/drush

Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.

2.4k57.4M685](/packages/drush-drush)[povils/phpmnd

A tool to detect Magic numbers in codebase

5795.6M193](/packages/povils-phpmnd)[crunzphp/crunz

Schedule your tasks right from the code.

2292.0M6](/packages/crunzphp-crunz)[helhum/typo3-console

A reliable and powerful command line interface for TYPO3 CMS

2939.0M192](/packages/helhum-typo3-console)[laminas/laminas-cli

Command-line interface for Laminas projects

563.7M54](/packages/laminas-laminas-cli)[phly/keep-a-changelog

Tag and release packages on GitHub using Keep A Changelog; add new version entries to your changelog.

183109.4k25](/packages/phly-keep-a-changelog)

PHPackages © 2026

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