Download the PHP package monkeyscloud/monkeyslegion-cli without Composer
On this page you can find all versions of the php package monkeyscloud/monkeyslegion-cli. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download monkeyscloud/monkeyslegion-cli
More information about monkeyscloud/monkeyslegion-cli
Files in monkeyscloud/monkeyslegion-cli
Package monkeyslegion-cli
Short Description Full-featured CLI framework for MonkeysLegion — code generation, migrations, environment tools, and interactive developer console.
License MIT
Informations about the package monkeyslegion-cli
MonkeysLegion CLI v2
Attribute-driven, PHP 8.4+ command-line toolkit for the MonkeysLegion framework.
Table of Contents
- Installation
- Quick Start
- Architecture
- Command Reference
- Entity Generator
- Migration System
- Maker Commands
- Writing Custom Commands
- Console Output API
- Testing
- Contributing
Installation
Requirements: PHP 8.4+, nikic/php-parser (for entity AST manipulation).
Quick Start
Architecture
v2 Design Principles
- Attribute-driven — Commands register via
#[Command('name', 'description')]attributes - PHP 8.4+ — Leverages asymmetric visibility (
public private(set)), property hooks,readonlyclasses - Zero boilerplate — Entity properties are public (no getter/setter generation); only collection relations get add/remove/get helpers
- Dual mode — Every generator supports both interactive wizard and
--flagsnon-interactive usage - PSR-4 split — Each enum/class lives in its own file for proper autoloading
Directory Structure
Command Reference
General
| Command | Description |
|---|---|
list / help |
Display all available commands |
about |
Framework, PHP, and environment information |
down |
Put application in maintenance mode |
up |
Bring application out of maintenance mode |
tinker |
Interactive REPL with DI container |
optimize |
Run config:cache + route:cache + clear old caches |
Database (db:)
| Command | Description |
|---|---|
db:create |
Create the database schema from .env credentials |
db:seed |
Run database seeders (optionally specify one) |
db:wipe |
Drop all tables in the database |
Cache (cache: / config:)
| Command | Description |
|---|---|
cache:clear |
Clear the compiled view cache |
config:cache |
Compile config files into a cached file |
Environment (env:)
| Command | Description |
|---|---|
env:sync |
Compare .env with .env.example for missing keys |
key:generate |
Generate a new APP_KEY in your .env file |
Migration (migrate:)
| Command | Aliases | Description |
|---|---|---|
migrate |
m |
Run pending database migrations |
migrate:rollback |
m:rb |
Rollback the last migration batch |
migrate:fresh |
— | Drop all tables and re-run all migrations |
migrate:refresh |
— | Rollback all and re-run all migrations |
migrate:status |
m:st |
Show ran and pending migrations |
make:migration |
— | Generate a blank migration file |
schema:update |
— | Compare entities → database and apply changes |
Maker (make:)
| Command | Description |
|---|---|
make:entity |
Generate or update an Entity class with fields & relationships |
make:controller |
Generate a new Controller class |
make:middleware |
Generate a PSR-15 middleware class |
make:service |
Generate a service class |
make:dto |
Generate a readonly DTO class |
make:enum |
Generate a backed enum class |
make:event |
Generate a domain event class |
make:listener |
Generate an event listener class |
make:job |
Generate a queue job class |
make:resource |
Generate a JSON:API resource class |
make:factory |
Generate an entity factory for testing |
make:observer |
Generate an entity lifecycle observer |
make:policy |
Generate an authorization policy class |
make:seeder |
Generate a database seeder class |
make:test |
Generate a PHPUnit test class |
make:command |
Generate a custom CLI command |
Routing (route:)
| Command | Description |
|---|---|
route:list |
List all registered routes (filter with --method, --path) |
route:cache |
Cache all routes for production |
API
| Command | Description |
|---|---|
openapi:export |
Dump OpenAPI spec to stdout or a file |
Entity Generator
Interactive Mode
Launches a wizard that lets you:
- Add fields — Choose from 36 database types with nullable support
- Add relationships — OneToOne, OneToMany, ManyToOne, ManyToMany with automatic inverse generation
- Save — Writes the entity using PhpParser AST manipulation (non-destructive)
Non-Interactive Mode
Parses field:type[:nullable] triplets and applies them in a single pass. Ideal for CI pipelines.
Generated Entity (v2 Style)
Key v2 differences from v1:
#[Id]+#[Field]dual attributes (instead of combined)public private(set)for the primary key (PHP 8.4 asymmetric visibility)- No getter/setter methods — public properties are the API
- Collection relations still get
add{Entity}(),remove{Entity}(),get{Prop}()helpers
Migration System
Built on top of monkeyscloud/monkeyslegion-migration v1.x:
Maker Commands
All maker commands follow a consistent pattern:
Generated stubs use v2 conventions:
declare(strict_types=1)final classby default- PSR-4 namespace matching directory structure
- Typed properties and constructor promotion
Writing Custom Commands
1. Create the Command
2. Auto-Discovery
Commands in app/Command/ or app/Cli/Command/ are auto-discovered. No registration needed.
3. Available Helpers
Console Output API
CliLineBuilder
Build multi-colored, multi-styled output lines:
Colors: black, red, green, yellow, blue, magenta, cyan, white, gray, bright_*
Styles: bold, dim, italic, underline, blink, reverse, hidden, strikethrough
TableRenderer
UTF-8 box-drawing tables with column alignment:
ProgressBar & Spinner
Testing
Current stats: 152 tests, 299 assertions across 12 test files.
Test Coverage
| Component | Tests | Focus |
|---|---|---|
ClassManipulatorTest |
18 | AST manipulation, field/relation generation |
CommandTest |
30 | argument(), option(), hasOption(), output, safeQuery |
EntityConfigTest |
12 | PhpTypeMap, RelationKeywordMap, RelationInverseMap |
FieldTypeConfigTest |
7 | Field type parsing and validation |
CliLineBuilderTest |
15 | Multi-colored output building |
CommandAttributeTest |
8 | #[Command] attribute properties |
ProgressBarTest |
7 | Progress rendering |
TableRendererTest |
20 | Table formatting and alignment |
SpinnerTest |
8 | Spinner animation |
MakerHelpersTest |
10 | toPascalCase, ensureSuffix, etc. |
IdentifierTest |
9 | PHP identifier validation |
| Additional | 8 | Edge cases and integration |
Contributing
- Fork and create a feature branch from
2.x-dev - Follow MonkeysLegion v2 coding standards (PSR-12 +
declare(strict_types=1)) - Write tests for new functionality
- Run
vendor/bin/phpunitand ensure all tests pass - Submit a PR against
2.x-dev
License
MIT © 2026 MonkeysCloud Team
All versions of monkeyslegion-cli with dependencies
ext-ctype Version *
ext-readline Version *
ext-pdo Version *
nikic/php-parser Version ^5.5
doctrine/inflector Version ^2.0
monkeyscloud/monkeyslegion-core Version ^2.0
monkeyscloud/monkeyslegion-di Version ^2.0
monkeyscloud/monkeyslegion-entity Version ^2.0
monkeyscloud/monkeyslegion-database Version ^2.0
monkeyscloud/monkeyslegion-migration Version ^2.0
monkeyscloud/monkeyslegion-openapi Version ^1.0