phpxui‑cli — Instant PHPXUI Component Generator 🚀
Generate fully‑typed PHPXUI components for Prisma PHP right from the terminal.
⚡ npx phpxui add Alert
| 🌌 npx phpxui add --all
✨ Features
Feature | Details |
---|---|
Bulk install | Use --all to download all components in one request. |
Ready‑to‑use code | Files include $class merge logic and {$attributes} for Wave reactivity. |
Clean paths | Components are saved in src/Lib/PHPXUI/ . |
Friendly output | Clear green/red terminal feedback with relative paths. |
Automatic icons | Core PPIcons (x , chevron‑down , chevron‑right ) install automatically on first run. |
Cross‑platform | Works on Windows, macOS and Linux. |
📦 Installation
# Global npm install -g phpxui # Or as a dev‑dependency npm install -D phpxui
Requires Node 18+ and a Prisma PHP project (PHP 8.2+).
🚀 Quick Start
# Add a single component npx phpxui add Alert # Add multiple components at once npx phpxui add Alert Dialog Badge # Add the entire component set npx phpxui add --all
Example CLI output (first run installs icons automatically):
📦 Installing ppicons CLI… ✨ Installing default icons: x chevron-down chevron-right ✔ Icons installed in src/Lib/PPIcons ✔ Alert → src/Lib/PHPXUI/Alert.php ✔ Dialog → src/Lib/PHPXUI/Dialog.php ✔ Badge → src/Lib/PHPXUI/Badge.php
Each component will look like this:
<?php namespace Lib\PHPXUI; use Lib\PHPX\PHPX; class Alert extends PHPX { public function render(): string { $attributes = $this->getAttributes(); $class = $this->getMergeClasses(); return <<<HTML <div class="{$class}" {$attributes}> {$this->children} </div> HTML; } }
🔧 CLI Options
Flag / Argument | Description |
---|---|
<component …> |
One or more component names separated by space or comma. |
--all | Download the full catalogue in one request. |
--force | Overwrite existing files. |
🎨 Using Additional Icons
Need more icons? Use the PPIcons CLI directly:
npx ppicons add menu chevron-left arrow-right
Browse the complete catalogue and docs at ppicons.tsnc.tech.
💡 Contributing
We welcome contributions! Submit issues, improvements or feature suggestions via pull request.
📄 License
Licensed under the MIT License. See LICENSE
file for details.
👤 Author
Created by The Steel Ninja Code — Empowering developers to build modern PHP applications faster.
📧 Contact
Reach out at thesteelninjacode@gmail.com — we’d love to hear from you!