PHPackages                             zero-to-prod/psr4-classname-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. zero-to-prod/psr4-classname-cli

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

zero-to-prod/psr4-classname-cli
===============================

A CLI to generate a PSR-4 compliant classname

v1.1.0(1y ago)02361MITPHPPHP &gt;=8.1CI passing

Since Jan 29Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/zero-to-prod/psr4-classname-cli)[ Packagist](https://packagist.org/packages/zero-to-prod/psr4-classname-cli)[ Docs](https://github.com/zero-to-prod/psr4-classname-cli)[ Fund](https://github.com/sponsors/zero-to-prod)[ RSS](/packages/zero-to-prod-psr4-classname-cli/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (4)Used By (1)

Zerotoprod\\Psr4ClassnameCli
============================

[](#zerotoprodpsr4classnamecli)

[![](art/logo.png)](art/logo.png)

[![Repo](https://camo.githubusercontent.com/9a90a3efeee26aed7d7f2feee9cd84566a26f9c362cc773b184d076210906e1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6769746875622d677261793f6c6f676f3d676974687562)](https://github.com/zero-to-prod/psr4-classname-cli)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/72707227d71cecbd1e245f2dc8197e3930d4738b1be718b129e2a4c4536cd86a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f707372342d636c6173736e616d652d636c692f746573742e796d6c3f6c6162656c3d74657374)](https://github.com/zero-to-prod/psr4-classname-cli/actions)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/826e598cdf1d7a77d186e9fbbc2de571f41d143349072af306547c04752508f3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f707372342d636c6173736e616d652d636c692f6261636b77617264735f636f6d7061746962696c6974792e796d6c3f6c6162656c3d6261636b77617264735f636f6d7061746962696c697479)](https://github.com/zero-to-prod/psr4-classname-cli/actions)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/e7ce25adc1ff7b6a8b595bd178b348f353b9b2325094dce90965fb1f770f6fd0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f707372342d636c6173736e616d652d636c692f6275696c645f646f636b65725f696d6167652e796d6c3f6c6162656c3d6275696c645f646f636b65725f696d616765)](https://github.com/zero-to-prod/psr4-classname-cli/actions)[![Packagist Downloads](https://camo.githubusercontent.com/311257906ba45f81c3c14ca22cec93e47d707ab6650cbdeee43fba2e8b1326ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a65726f2d746f2d70726f642f707372342d636c6173736e616d652d636c693f636f6c6f723d626c7565)](https://packagist.org/packages/zero-to-prod/psr4-classname-cli/stats)[![php](https://camo.githubusercontent.com/6f7c6ff951b8ef686f44b655503c9b85e26c2cd3703a75dbcb827eba2fb0b069/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7a65726f2d746f2d70726f642f707372342d636c6173736e616d652d636c692e7376673f636f6c6f723d707572706c65)](https://packagist.org/packages/zero-to-prod/psr4-classname-cli/stats)[![Packagist Version](https://camo.githubusercontent.com/6545d3b67118948852faad785c92065dcae0befb41349b69fc05b2d8e2f4d422/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a65726f2d746f2d70726f642f707372342d636c6173736e616d652d636c693f636f6c6f723d663238643161)](https://packagist.org/packages/zero-to-prod/psr4-classname-cli)[![License](https://camo.githubusercontent.com/1076028e977b53e284a8548ede055a9853fec874ccded8eea861d370002d1080/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7a65726f2d746f2d70726f642f707372342d636c6173736e616d652d636c693f636f6c6f723d70696e6b)](https://github.com/zero-to-prod/psr4-classname-cli/blob/main/LICENSE.md)[![wakatime](https://camo.githubusercontent.com/703efa7c54d767703a3ad6239575161da7e52e1e79e40b0983250ce01677e85e/68747470733a2f2f77616b6174696d652e636f6d2f62616467652f6769746875622f7a65726f2d746f2d70726f642f707372342d636c6173736e616d652d636c692e737667)](https://wakatime.com/badge/github/zero-to-prod/psr4-classname-cli)[![Hits-of-Code](https://camo.githubusercontent.com/f30d2f43c352ddd95c7483caf3fdae624ca00fcf13119b4834f26e121002391d/68747470733a2f2f686974736f66636f64652e636f6d2f6769746875622f7a65726f2d746f2d70726f642f707372342d636c6173736e616d652d636c693f6272616e63683d6d61696e)](https://hitsofcode.com/github/zero-to-prod/psr4-classname-cli/view?branch=main)

Contents
--------

[](#contents)

- [Introduction](#introduction)
- [Requirements](#requirements)
- [Installation](#installation)
- [Documentation Publishing](#documentation-publishing)
    - [Automatic Documentation Publishing](#automatic-documentation-publishing)
- [Usage](#usage)
    - [Available Commands](#available-commands)
        - [`psr4-classname-cli:generate`](#psr4-classname-cligenerate)
        - [`psr4-classname-cli:src`](#psr4-classname-clisrc)
- [Docker Image](#docker-image)
- [Local Development](./LOCAL_DEVELOPMENT.md)
- [Image Development](./IMAGE_DEVELOPMENT.md)
- [Contributing](#contributing)

Introduction
------------

[](#introduction)

A CLI to generate a PSR-4 compliant classname

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

[](#requirements)

- PHP 8.1 or higher.

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

[](#installation)

Install `Zerotoprod\Psr4ClassnameCli` via [Composer](https://getcomposer.org/):

```
composer require zero-to-prod/psr4-classname-cli
```

This will add the package to your project's dependencies and create an autoloader entry for it.

Documentation Publishing
------------------------

[](#documentation-publishing)

You can publish this README to your local documentation directory.

This can be useful for providing documentation for AI agents.

This can be done using the included script:

```
# Publish to default location (./docs/zero-to-prod/psr4-classname-cli)
vendor/bin/zero-to-prod-psr4-classname-cli

# Publish to custom directory
vendor/bin/zero-to-prod-psr4-classname-cli /path/to/your/docs
```

### Automatic Documentation Publishing

[](#automatic-documentation-publishing)

You can automatically publish documentation by adding the following to your `composer.json`:

```
{
    "scripts": {
        "post-install-cmd": [
            "zero-to-prod-psr4-classname-cli"
        ],
        "post-update-cmd": [
            "zero-to-prod-psr4-classname-cli"
        ]
    }
}
```

Usage
-----

[](#usage)

Run this command to see the available commands:

```
vendor/bin/psr4-classname-cli list
```

### Available Commands

[](#available-commands)

#### `psr4-classname-cli:generate`

[](#psr4-classname-cligenerate)

**Description**: Generates a valid PSR-4 compliant classname from a string.

**Usage**:

```
vendor/bin/psr4-classname-cli psr4-classname-cli:generate
```

**Arguments**:

- `classname` (required) - The string to convert to a PSR-4 compliant classname

**Examples**:

```
# Generate a classname from a simple string
vendor/bin/psr4-classname-cli psr4-classname-cli:generate "my class"
# Output: MyClass

# Generate a classname from a string with special characters
vendor/bin/psr4-classname-cli psr4-classname-cli:generate "user-profile_manager"
# Output: UserProfileManager

# Generate a classname from a string with numbers
vendor/bin/psr4-classname-cli psr4-classname-cli:generate "api v2 client"
# Output: ApiV2Client
```

#### `psr4-classname-cli:src`

[](#psr4-classname-clisrc)

**Description**: Displays the project's GitHub repository URL.

**Usage**:

```
vendor/bin/psr4-classname-cli psr4-classname-cli:src
```

**Arguments**: None

**Example**:

```
vendor/bin/psr4-classname-cli psr4-classname-cli:src
# Output: https://github.com/zero-to-prod/psr4-classname-cli
```

Docker Image
------------

[](#docker-image)

You can also run the cli using the [docker image](https://hub.docker.com/repository/docker/davidsmith3/psr4-classname-cli/general):

```
docker run --rm davidsmith3/psr4-classname-cli
```

Contributing
------------

[](#contributing)

Contributions, issues, and feature requests are welcome! Feel free to check the [issues](https://github.com/zero-to-prod/psr4-classname-cli/issues) page if you want to contribute.

1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Commit changes (`git commit -m 'Add some feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Create a new Pull Request.

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance55

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

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

Total

3

Last Release

465d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/502649f05d36c87d494988bd99193a4d908d345335d99c080928a726277371f5?d=identicon)[zero-to-prod](/maintainers/zero-to-prod)

---

Top Contributors

[![zero-to-prod](https://avatars.githubusercontent.com/u/61474950?v=4)](https://github.com/zero-to-prod "zero-to-prod (15 commits)")

---

Tags

zero-to-prodpsr4-classname-cli

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zero-to-prod-psr4-classname-cli/health.svg)

```
[![Health](https://phpackages.com/badges/zero-to-prod-psr4-classname-cli/health.svg)](https://phpackages.com/packages/zero-to-prod-psr4-classname-cli)
```

###  Alternatives

[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[matthiasnoback/symfony-console-form

Use Symfony forms for Console command input

368264.8k8](/packages/matthiasnoback-symfony-console-form)[shel/neos-terminal

Neos CMS Ui terminal for running Eel expressions and other commands

1441.3k](/packages/shel-neos-terminal)

PHPackages © 2026

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