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 |
🔁 npx phpxui update
✨ Features
| Feature | Details |
|---|---|
| Bulk install | Use --all to download all components in one request. |
| Update in place |
Run phpxui update to scan your installed components in outputDir and re-download them (overwrite) so you stay in sync with the latest templates.
|
| Ready-to-use code | Files declare $class and $children, merge classes through getMergeClasses(...), and emit the rest with getAttributes(...) so PulsePoint can hydrate the component boundary. |
| 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
Requires Node 18+ and a Prisma PHP project (PHP 8.2+).
🚀 Quick Start
Example CLI output (first run installs icons automatically):
Each component will look like this:
🔁 Updating Components
Use update when you want to refresh everything you already installed—perfect after new PHPXUI releases or template improvements.
What update does:
- Loads your project config (ex:
phpxui.jsonif present). - Resolves
outputDir(default:src/Lib/PHPXUI). - Scans that folder for
*.phpcomponent files (ex:Alert.php,Dialog.php). - Re-downloads the matching components from the PHPXUI catalogue.
- Overwrites files automatically (no
--forcerequired for update).
Want to refresh just one component instead?
🔧 CLI Options
Commands
| Command | Description |
|---|---|
add |
Generate one or more components by name, or use --all to generate the full catalogue. |
update |
Scan installed components in outputDir and re-download them (overwrite) to refresh to the latest templates. |
Flags / Arguments
| Flag / Argument | Description |
|---|---|
<component …> |
One or more component names separated by space or comma (used with add). |
--all |
Download the full catalogue in one request (used with add). |
--force |
Overwrite existing files (used with add). |
🎨 Using Additional Icons
Need more icons? Use the PPIcons CLI directly:
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!