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

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

gemvc/cli-base
==============

Internal GEMVC CLI foundation: terminal I/O, filesystem helpers, and codegen abstract base classes. For GEMVC ecosystem only.

1.0.1(3w ago)018↓50%2MITPHPPHP ^8.2

Since May 18Pushed 3w agoCompare

[ Source](https://github.com/gemvc/cli-base)[ Packagist](https://packagist.org/packages/gemvc/cli-base)[ RSS](/packages/gemvc-cli-base/feed)WikiDiscussions main Synced 1w ago

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

gemvc/cli-base
==============

[](#gemvccli-base)

Internal package for the **GEMVC** framework. It provides shared CLI primitives: typed terminal colors (`CliColor`), line/box drawing (`CliLine`), command base (`Command`), filesystem helpers (`FileSystemManager`), boxed output (`CliBoxShow`), codegen abstracts, and install smoke check (`InstallControl`).

---

For AI coding assistants (mandatory)
------------------------------------

[](#for-ai-coding-assistants-mandatory)

**Before** you modify code, tests, `composer.json`, or documentation in this repository, read **[`AI-Assistant.md`](./AI-Assistant.md) from top to bottom**. That file is the canonical source for:

- **GEMVC framework context** (HTTP four-layer architecture, CLI discovery, folder layout, how to ship **compatible** extra CLI packages)
- **Quick API reference** (every class, method, return type, and short behavior notes)
- Architecture boundaries (what belongs here vs in `gemvc/library`)
- Template resolution, Composer constraints, testing, and distribution (`archive` / `export-ignore`)

If `README.md` and `AI-Assistant.md` disagree, treat **`AI-Assistant.md`** as authoritative.

---

GEMVC architecture (short)
--------------------------

[](#gemvc-architecture-short)

GEMVC is a **PHP REST API framework** with a **fixed four-layer flow** (each layer has a clear job; do not skip layers):

LayerTypical folderRole**API**`app/api/`HTTP entry, schema validation, auth checks; classes extend `ApiService`.**Controller**`app/controller/`Orchestrates use cases; calls models.**Model**`app/model/`Business rules, validation, transformations.**Table**`app/table/`Database access via the framework `Table` / query builder.**HTTP routing:** there are **no hand-written route files**. URLs map by convention, e.g. `/api/{ServiceName}/{methodName}` → class in `app/api/` and method on that class (see GEMVC docs / main repo `.cursorrules`).

---

GEMVC CLI commands (short)
--------------------------

[](#gemvc-cli-commands-short)

The **`gemvc`** executable ships with **`gemvc/library`** (e.g. `vendor/bin/gemvc`). It loads Composer’s autoloader, parses **`argv[1]`** as the command, and maps names like **`create:service`** to a **PascalCase** class name (**`CreateService`**) by splitting on `:` and uppercasing each segment.

**Search order (simplified):**

1. **Framework commands** — namespace **`Gemvc\CLI\Commands\`**, PHP files under **`vendor/gemvc/library/src/CLI/commands/`** (or the monorepo `src/CLI/commands/` when developing the framework).
2. **Project commands** — namespace **`App\CLI\Commands\`**, files under **`app/CLI/commands/`** in the **application** repo (your `composer.json` must autoload that namespace).

The dispatcher does **`new $commandClass($remainingArgv)`** then **`execute()`**. Commands are plain PHP classes; **`gemvc/cli-base`** supplies shared bases (**`Command`**, **`FileSystemManager`**, **`CliBoxShow`**, generator abstracts) so framework and custom commands share the same terminal and filesystem behavior. Colors use the **`CliColor`** enum (not string color names).

**Where this package fits:** **`gemvc/cli-base`** is the **small dependency** with those bases; **`gemvc/library`** holds **`bin/gemvc`**, concrete **`Gemvc\CLI\Commands\*`** implementations, init flows, and HTTP/runtime code.

---

README vs `AI-Assistant.md` (where to put detail)
-------------------------------------------------

[](#readme-vs-ai-assistantmd-where-to-put-detail)

DocPurpose**`README.md`**Short orientation: what GEMVC is, how CLI discovery works, install pointer, **mandatory** link for AIs to `AI-Assistant.md`.**`AI-Assistant.md`**Full **API tables**, template rules, Composer boundaries, testing, distribution, and **deeper** notes on extending GEMVC and designing **compatible** CLI packages (including limits of the stock `gemvc` binary).Put **long** architecture and “how to build another CLI package” guidance in **`AI-Assistant.md`** so one file stays authoritative; keep **`README.md`** skimmable.

---

Human summary
-------------

[](#human-summary)

- **Not** a supported public API for arbitrary third-party packages.
- **Does not** depend on `gemvc/library` (avoids circular Composer dependencies).
- Template fallbacks resolve `gemvc/library` via Composer’s `InstalledVersions` when templates are not in the project.

Install with the main framework:

```
composer require gemvc/library
```

(`gemvc/library` 5.7+ declares a dependency on `gemvc/cli-base`.)

---

Development (this repo)
-----------------------

[](#development-this-repo)

```
composer install
composer test              # PHPUnit (tests/Unit)
composer test:coverage     # coverage report for src/ (requires PCOV or Xdebug)
composer phpstan           # PHPStan level 9 on src/
```

Coverage is configured in **`phpunit.xml`** (`` → `src/`). See **`AI-Assistant.md`** for the full API, template rules, and architecture boundaries.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance95

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity47

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

2

Last Release

22d ago

### Community

Maintainers

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

---

Top Contributors

[![gemvc](https://avatars.githubusercontent.com/u/211101824?v=4)](https://github.com/gemvc "gemvc (9 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.7k532.1M19.2k](/packages/laravel-framework)[symfony/symfony

The Symfony PHP framework

31.4k86.9M2.2k](/packages/symfony-symfony)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k246.0M11.0k](/packages/symfony-framework-bundle)[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.4k59.5M766](/packages/drush-drush)[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k181.3M2.2k](/packages/symfony-security-bundle)[symfony/web-profiler-bundle

Provides a development tool that gives detailed information about the execution of any request

2.3k156.8M1.1k](/packages/symfony-web-profiler-bundle)

PHPackages © 2026

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