PHPackages                             cymapgt/console - 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. cymapgt/console

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

cymapgt/console
===============

Create a console interface for any PSR-0 or PSR-3 compliant package

3.0.0(6y ago)334[1 issues](https://github.com/cymapgt/console/issues)[1 PRs](https://github.com/cymapgt/console/pulls)BSD-3-ClausePHPPHP &gt;=7.2.0

Since Oct 7Pushed 4y ago1 watchersCompare

[ Source](https://github.com/cymapgt/console)[ Packagist](https://packagist.org/packages/cymapgt/console)[ Docs](https://github.com/cymapgt/console)[ RSS](/packages/cymapgt-console/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (7)Versions (14)Used By (0)

console
=======

[](#console)

package for exposing PHP services via a console interface, providing build in authentication if needed

Description
-----------

[](#description)

The console package allows other packages to implement an interface that allows them to provide command line functionality to their classes in with minimal duplication of code. A NetConsoleInterface aware class can be registered to the console API; which offers among other things automatic help generation as well as an authentication interface prior to accessing registered namespaces.

Installing
----------

[](#installing)

### Install application via Composer

[](#install-application-via-composer)

```
require "cymapgt/console" : "^1.0.0"

```

Usage
-----

[](#usage)

### Overview

[](#overview)

- Authenticate the console user (named console) to the Service
- Provide interface to add services to the API
- Provide interface to remove services from the API
- Provide interface to amend a service using the API
- Provide interface to display usage for the API
- Provide interface to delegate actual API calls to the registered services

### Using the Console package

[](#using-the-console-package)

#### Writing a NetConsole aware class

[](#writing-a-netconsole-aware-class)

The package comes with two demo Classes that implement the NetConsoleInterface. See the files src/DemoApi.php and src/DemoRpi.php for template which you can use to implement your NetConsole class. Copy the files and customize as required.

#### Authentication to NetConsole

[](#authentication-to-netconsole)

The default NetConsole authentication comes with some assumptions:

1.You auth data store is a database, with a table named user; and fields for username and password

2.You have an active user named console in the datastore

If you adhere to the above, your console authentication will work out of the box (assuming as well that the NetworkBootstrap is properly configured).

If you would like to implement your own Authentication, replace the file src/helper/ConsoleCredentials.php and in it

1.Create a class named ConsoleCredentials

2.Creat a public static method named authenticate() that will implement your custom authentication logic

#### Core NetConsole Commands

[](#core-netconsole-commands)

The core of NetConsole implements the NetConsoleInterface. There are a number of reserved keywords:

1.**ADD COMMAND:**

add serviceName serviceNamespace

**COMMANDS AND SWITCHES:**

*COMMANDS*

serviceName - The name of the service as registered in the console, or one of the sticky services.

serviceNamespace - The fully qualified namespace for the service being registered to the netconsole API

*SWITCHES*

None

**EXAMPLE:**

add bootstrap cymapgt\\core\\utility\\bootstrap\\console\\BootstrapConsole;

2.**HELP COMMAND:**

help serviceName \[-v="..."\] \[-m="..."\]

**COMMANDS AND SWITCHES:**

*COMMANDS*

serviceName - The name of the service as registered in the console, or one of the sticky services.

*SWITCHES*

-v - The verbosity level of the help documentation

-m - Specifying a method name here will filter the help to provide only docs for that specific method

**EXAMPLES**

help bootstrap -m=config-all -v=3

help add

3.**REMOVE COMMAND:**

remove serviceName

**COMMANDS AND SWITCHES:**

*COMMANDS*

serviceName - The name of the service as registered in the console, or one of the sticky services.

*SWITCHES*

None

**EXAMPLE:**

remove bootstrap

4.**QUIT COMMAND:**

quit

**COMMANDS AND SWITCHES:**

*COMMANDS*

None

*SWITCHES*

None

**EXAMPLE:**

quit

5.**CUSTOM COMMANDS:**

Your PHP services functionality is exposed by implementing the NetConsoleInterface

After this implementation, you need to register your package with NetConsole by using the add command.

Successfully adding the package will expose all of the commands and switches you defined in the console configuration. The package can thus be used for managing tasks such as application installations within a controlled environment if you are distributing your proprietary logic.

It can also be used to quickly convert PHP services to console applications.

### Testing

[](#testing)

PHPUnit Tests are provided with the package

### Contribute

[](#contribute)

- Email @rhossis or contact via Skype
- You will be added as author for contributions

### License

[](#license)

BSD 3-clause

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 84.6% 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 ~145 days

Recently: every ~112 days

Total

11

Last Release

2424d ago

Major Versions

1.0.3 → 2.0.02018-04-24

2.0.5 → 3.0.02019-09-25

PHP version history (2 changes)2.0.0PHP &gt;=7.0.0

3.0.0PHP &gt;=7.2.0

### Community

Maintainers

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

---

Top Contributors

[![cymapgt](https://avatars.githubusercontent.com/u/12482626?v=4)](https://github.com/cymapgt "cymapgt (11 commits)")[![rhossis](https://avatars.githubusercontent.com/u/7324938?v=4)](https://github.com/rhossis "rhossis (2 commits)")

---

Tags

console

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.1B11.3k](/packages/symfony-console)[psy/psysh

An interactive shell for modern PHP.

9.8k545.6M719](/packages/psy-psysh)[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)

PHPackages © 2026

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