PHPackages                             nixphp/cli - 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. nixphp/cli

ActiveNixphp-plugin[CLI &amp; Console](/categories/cli)

nixphp/cli
==========

NixPHP CLI Plugin for console applications.

v0.1.2(6mo ago)0156↓92.9%1MITPHPPHP &gt;=8.3CI passing

Since Nov 30Pushed 6mo agoCompare

[ Source](https://github.com/nixphp/cli)[ Packagist](https://packagist.org/packages/nixphp/cli)[ RSS](/packages/nixphp-cli/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (3)Versions (7)Used By (1)

[![Logo](https://camo.githubusercontent.com/075b2860e9651b98b8c190a8296595c54cff6900890d9e494f31131145e98a6f/68747470733a2f2f6e69787068702e6769746875622e696f2f646f63732f6173736574732f6e69787068702d6c6f676f2d736d616c6c2d7371756172652e706e67)](https://camo.githubusercontent.com/075b2860e9651b98b8c190a8296595c54cff6900890d9e494f31131145e98a6f/68747470733a2f2f6e69787068702e6769746875622e696f2f646f63732f6173736574732f6e69787068702d6c6f676f2d736d616c6c2d7371756172652e706e67)

[![NixPHP CLI Plugin](https://github.com/nixphp/cli/actions/workflows/php.yml/badge.svg)](https://github.com/nixphp/cli/actions/workflows/php.yml)

[← Back to NixPHP](https://github.com/nixphp/framework)

---

nixphp/cli
==========

[](#nixphpcli)

> **A minimal, developer-friendly command-line interface for your NixPHP application.**

This plugin gives you a clean CLI system with colored output, argument parsing, and auto-discovered commands. All without external dependencies.

> 🧩 Part of the official NixPHP plugin collection. Install it if you want powerful CLI tools for development, deployment, and automation.

---

📦 Features
----------

[](#-features)

- ✅ Adds `vendor/bin/nix` as your app’s command-line entry point
- ✅ Auto-discovers commands in `app/Commands/`
- ✅ Supports arguments, options, and interactive input
- ✅ Prints colored output for better UX
- ✅ Fully extensible – build your own tools and workflows

---

📥 Installation
--------------

[](#-installation)

```
composer require nixphp/cli
```

This will create `vendor/bin/nix`, your CLI gateway.

---

🚀 Usage
-------

[](#-usage)

### 🔍 Run a command

[](#-run-a-command)

```
vendor/bin/nix your:command
```

Commands are discovered automatically if placed in your app’s `app/Commands/` directory.

```
vendor/bin/nix
```

If you call the helper without arguments, it prints all available CLI commands.

---

### 🛠️ Create a custom command

[](#️-create-a-custom-command)

To create your own CLI command, add a class in the `app/Commands/` folder:

```
namespace App\Commands;

use NixPHP\CLI\Core\AbstractCommand;
use NixPHP\CLI\Core\Input;
use NixPHP\CLI\Core\Output;

class HelloCommand extends AbstractCommand
{
    public const NAME = 'hello:say';

    protected function configure(): void
    {
        $this->setTitle('Say Hello');
        $this->addArgument('name');
    }

    public function run(Input $input, Output $output): int
    {
        $name = $input->getArgument('name');
        $output->writeLine("Hello, {$name}!", 'ok');
        return static::SUCCESS;
    }
}
```

No registration needed — as long as the class resides in `app/Commands/`, it will be picked up automatically.

Then run:

```
vendor/bin/nix hello:say John
```

---

🎨 Colored output
----------------

[](#-colored-output)

Use `$output->writeLine()` to print messages with color support:

TypeAppearance`'ok'`✅ Green`'error'`❌ Red`'warning'`⚠️ Yellow`'title'`💡 Light green on black`'headline'`📢 Light blue on blackYou can also draw horizontal lines:

```
$output->drawStroke(30);
```

---

🧪 Interactive input
-------------------

[](#-interactive-input)

You can prompt the user:

```
$name = $input->ask('What is your name?');
```

---

📁 File structure
----------------

[](#-file-structure)

A typical CLI setup might look like this:

```
app/
└── Commands/
    └── HelloCommand.php

vendor/
└── bin/
    └── nix

bootstrap.php

```

---

✅ Requirements
--------------

[](#-requirements)

- `nixphp/framework` &gt;= 0.1.0
- PHP &gt;= 8.3

---

📄 License
---------

[](#-license)

MIT License.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance66

Regular maintenance activity

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

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

Total

3

Last Release

207d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f5d2bd3eecc9c3949d3caf98c4876c8e44c0c73fc80dbc65b55f4d91a5b63eae?d=identicon)[floknapp](/maintainers/floknapp)

---

Top Contributors

[![FloKnapp](https://avatars.githubusercontent.com/u/3774820?v=4)](https://github.com/FloKnapp "FloKnapp (25 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[illuminate/console

The Illuminate Console package.

13046.0M6.5k](/packages/illuminate-console)[styleci/cli

The CLI tool for StyleCI

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

Windows command-line formatter

20720.9k21](/packages/winbox-args)[tomatophp/filament-artisan

Simple but yet powerful library for running some artisan commands for FilamentPHP

3275.4k1](/packages/tomatophp-filament-artisan)[thettler/laravel-console-toolkit

This Package provides some usefully console features like the attribute syntax for arguments and options, validation, auto ask and casting.

324.1k](/packages/thettler-laravel-console-toolkit)

PHPackages © 2026

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