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

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

neuron-php/cli
==============

Unified command-line interface for the Neuron PHP framework

0.8.14(4mo ago)01.4k—0%4MITPHPPHP ^8.4CI passing

Since Aug 13Pushed 4mo agoCompare

[ Source](https://github.com/Neuron-PHP/cli)[ Packagist](https://packagist.org/packages/neuron-php/cli)[ RSS](/packages/neuron-php-cli/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependencies (5)Versions (21)Used By (4)

[![CI](https://github.com/Neuron-PHP/cli/actions/workflows/ci.yml/badge.svg)](https://github.com/Neuron-PHP/cli/actions)[![codecov](https://camo.githubusercontent.com/92a3b904b2898460e4432b256d81fe1a232d8671eef98e73fde6c0216b5e81c8/68747470733a2f2f636f6465636f762e696f2f67682f4e6575726f6e2d5048502f636c692f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/Neuron-PHP/cli)

Neuron CLI Component
====================

[](#neuron-cli-component)

A unified command-line interface for the Neuron PHP framework that provides a modern, extensible CLI tool for all Neuron components.

Features
--------

[](#features)

- **Unified CLI Interface** - Single entry point for all component commands
- **Automatic Command Discovery** - Auto-detects commands from installed components
- **Rich Terminal Output** - Colored output, tables, and progress bars
- **Zero Configuration** - Works out of the box with any Neuron component
- **Extensible Architecture** - Easy to add custom commands

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

[](#requirements)

- PHP 8.4 or higher
- Composer

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

[](#installation)

### Local Installation (Recommended)

[](#local-installation-recommended)

```
composer require neuron-php/cli
```

After installation, the CLI will be available at:

```
./vendor/bin/neuron
```

### Global Installation

[](#global-installation)

```
composer global require neuron-php/cli
```

Make sure your global Composer bin directory is in your PATH, then:

```
neuron version
```

Basic Usage
-----------

[](#basic-usage)

### List All Commands

[](#list-all-commands)

```
neuron list
```

### Get Help

[](#get-help)

```
# General help
neuron --help

# Help for specific command
neuron help make:controller
```

Config Export
-------------

[](#config-export)

Export a YAML config as environment-style pairs for production.

```
# Export project config to .env production file
./vendor/bin/neuron config:env --config=config/neuron.yaml > .env.production

# Only export selected categories
./vendor/bin/neuron config:env --category=site,cache

# Shell format (export lines)
./vendor/bin/neuron config:env --format=shell

# Quoting control: auto|always|never (default: auto)
./vendor/bin/neuron config:env --quote=always
```

Notes:

- Keys become UPPER\_SNAKE\_CASE using `CATEGORY_NAME` from YAML.
- Nested and array values are flattened (e.g., `ARRAY_KEY_0`, `ARRAY_KEY_1`).
- Booleans and nulls are stringified appropriately for env files.

For Component Developers
------------------------

[](#for-component-developers)

The CLI component provides two ways for your component to register commands:

### Method 1: CLI Provider Class (Recommended)

[](#method-1-cli-provider-class-recommended)

This is the preferred method as it keeps all command registrations in one place.

1. **Update your component's `composer.json`:**

```
{
    "name": "neuron-php/your-component",
    "extra": {
        "neuron": {
            "cli-provider": "Neuron\\YourComponent\\Cli\\CommandProvider"
        }
    }
}
```

2. **Create the provider class:**

```
