anujpratap / create-cscart-addon
CLI tool to scaffold CS-Cart addons
Package info
github.com/AnujPratap-96/create-cscart-addon
pkg:composer/anujpratap/create-cscart-addon
v1.0.2
2026-01-12 16:21 UTC
Requires
- php: >=8.0
README
A PHP CLI tool to quickly scaffold a CS-Cart addon with a correct folder structure, namespaces, and boilerplate files.
No Node.js required.
Works on Windows, Linux, and macOS.
β¨ Features
- π¦ Generates CS-Cartβcompatible addon structure
- π§© PSR-4 autoloading
- π§ Proper namespaces based on addon name
- π‘ Validates addon name (
letters, numbers, underscore) - β‘ Fast CLI execution
- π Cross-platform (Windows / Linux / macOS)
π Generated Structure
my_addon/
βββ app/
β βββ addons/
β βββ my_addon/
β βββ controllers/
β βββ models/
β βββ schema/
β βββ src/
β β βββ HookHandlers/
β β βββ Bootstrap.php
β β βββ Installer.php
β β βββ ServiceProvider.php
β βββ addon.xml
βββ design/
β βββ templates/
β βββ addons/
β βββ my_addon/
βββ var/
βββ langs/
βββ addons/
π¦ Installation
β Option 1: Install globally via Composer (recommended)
composer global require yourname/create-cscart-addon
Make sure Composer global bin is in your PATH:
# Linux / macOS export PATH="$HOME/.composer/vendor/bin:$PATH" # Windows (add manually) C:\Users\YourUser\AppData\Roaming\Composer\vendor\bin
β Option 2: Local usage (no global install)
php bin/create-cscart-addon my_addon
βΆοΈ Usage
create-cscart-addon price_update
Or (Windows / local):
php create-cscart-addon.php price_update
π§ͺ Validation Rules
β Allowed
price_update
my_addon_123
β Not allowed
price-update
price update
price@update
π§© Files Generated
addon.xml
- Autoload (PSR-4)
- Bootstrap
- Installer
- Active status
Bootstrap.php
- Registers service provider
- Hook handler support
Installer.php
- Install / uninstall lifecycle
- CS-Cart compliant
ServiceProvider.php
- Dependency container support (Pimple)
π₯ Platform Notes
Windows
- No
chmodrequired - Composer generates
.batautomatically
Linux / macOS
chmod +x bin/create-cscart-addon
π Requirements
- PHP 8.0+
- Composer
- CS-Cart 4.x+
πΊ Roadmap
- Interactive mode
-
--forceoverwrite flag - Auto-detect CS-Cart root
- Hook handler generator
- Unit tests
- Symfony Console integration
π€ Contributing
PRs are welcome.
- Fork the repository
- Create a feature branch
- Submit a pull request
π License
MIT License
β Why this tool?
CS-Cart addon development lacks a standard scaffold generator. This tool brings Laravel-level developer experience (DX) to CS-Cart.