scafkit-cli
v1.0.12
Published
Scaffold PHP, React, and PERN starters, then package Laravel apps for shared hosting.
Maintainers
Readme

Scafkit CLI
Scafkit CLI is a practical project scaffolding and build helper for PHP MVC, PERN, React, and Laravel workflows. It helps you create starter projects, add PHP MVC files, run local projects, inspect tooling, and package Laravel apps for deployment.
Links
- Repository: https://github.com/RaileySawada/scafkit-cli
- Bugs: https://github.com/RaileySawada/scafkit-cli/issues
- Homepage: https://github.com/RaileySawada/scafkit-cli#readme
- npm: https://www.npmjs.com/package/scafkit-cli
Install
npm install -g scafkit-cliStart the interactive shell:
scafkitRun a direct command:
scafkit react dashboard --twWhat You Can Do
| Need | Command |
| ---------------------------------- | ---------------------------------------------------------- |
| Create a React app | scafkit react my-app |
| Create a PERN app | scafkit pern inventory --sq-pg --tw |
| Create a PHP MVC auth starter | scafkit php auth-app |
| Add a PHP MVC controller | scafkit make:controller Invoice approve reject |
| Add a PHP MVC route | scafkit make:route GET /invoices InvoiceController@index |
| Build a Laravel app for deployment | scafkit laravel:build |
| Inspect the current project | scafkit inspect |
| Check local tooling | scafkit doctor |
| Start a local dev server | scafkit run |
| Check for CLI updates | scafkit update --check |
Project Starters
React
scafkit react client-app
scafkit react client-app --tw
scafkit react client-app --js --no-install
scafkit react client-app --serverless --tw --pm pnpmCreates a Vite React project with a scalable src layout. TypeScript is the default, JavaScript is available with --js, and Tailwind or Netlify Functions can be added with flags.
PERN
scafkit pern inventory --sq-pg --tw
scafkit pern inventory --sq-mysql --js
scafkit create pern inventory --sq-pg --dir ../projects --yesCreates a separated React client and Express API. Sequelize dialect flags are available for PostgreSQL, MySQL, SQLite, MariaDB, and Microsoft SQL Server.
PHP MVC
scafkit php auth-app
scafkit php auth-app --tw
scafkit php auth-app --bsCreates a PHP MVC authentication starter with controllers, models, routes, sessions, .env.example, and SQL schema.
Laravel Build
Run this from the root of an existing Laravel app:
scafkit laravel:buildInside the interactive shell, use:
laravel:buildScafkit checks that the current folder is a Laravel project, then quietly verifies Composer and Laravel before building.
It runs the production build sequence:
composer install --no-dev --optimize-autoloader
npm install
npm run build
php artisan config:clear
php artisan route:clear
php artisan view:clear
php artisan cache:clear
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan event:cacheIt creates the deployment folder inside the current Laravel project root. The folder name comes from APP_NAME and uses a -build suffix, such as e-docs-build or edocs-build. If the target already exists, Scafkit picks the next available suffix such as e-docs-build-1.
Generated layout:
your-app-build/
├─ .htaccess
├─ your_database_name.sql
├─ public/
│ └─ index.php
└─ laravel-app/
├─ app/
├─ bootstrap/
├─ config/
├─ database/
├─ resources/
├─ routes/
├─ storage/
├─ vendor/
└─ .envThe build excludes local development files such as node_modules, tests, public source maps, debug logs, package files, and Vite/Tailwind config files.
For Laravel storage, Scafkit keeps the normal Laravel folder structure and .gitignore files. It only excludes these generated runtime files:
storage/logs/laravel.log
storage/framework/views/*.phpFor Laravel bootstrap cache, Scafkit keeps bootstrap/cache/.gitignore and excludes generated PHP cache files:
bootstrap/cache/*.phpScafkit also updates laravel-app/.env for deployment defaults:
APP_ENV=production
APP_DEBUG=false
APP_URL=https://your.domain.example
DB_CONNECTION=mysql
SESSION_DRIVER=database
CACHE_STORE=databaseBefore exporting SQL, Scafkit checks Laravel migrations for the cache, cache_locks, and sessions tables. It detects existing tables from migration contents and filenames, including nested migration folders, so it does not duplicate Laravel's database cache or session migrations. If any of those tables are missing, Scafkit writes unique scafkit_create_*_table migrations, then refreshes the local database with:
php artisan migrate:freshIf database seeders are present, Scafkit uses:
php artisan migrate:fresh --seedScafkit then exports the current MySQL/MariaDB database with mysqldump. The SQL dump is stored in the build root beside .htaccess, and its filename is the exact DB_DATABASE value from .env. Generated SQL is sanitized for shared hosting by removing binlog and GTID statements such as SQL_LOG_BIN and GTID_PURGED, which can cause #1227 Access denied import errors on hosts without MySQL admin privileges.
After upload, edit laravel-app/.env with the real production domain and database credentials.
Common Flags
| Flag | Description |
| --------------- | ------------------------------------------------------- | ---- | ----- | -------------------------- |
| --dir <path> | Create a generated starter inside another directory |
| --dry-run | Preview generated files without writing them |
| --force, -f | Overwrite existing generated files |
| --yes, -y | Use defaults and install dependencies without prompting |
| --no-install | Skip dependency installation |
| --pm <npm/pnpm/yarn/bun> | Choose the package manager |
| --help, -h | Show help |
React flags:
| Flag | Description |
| ---------------------- | ----------------------------------- |
| --tw, --tailwind | Include Tailwind CSS |
| --serverless | Include Netlify Functions endpoints |
| --ts, --typescript | Generate TypeScript files |
| --js, --javascript | Generate JavaScript files |
PERN flags:
| Flag | Description |
| -------------------------- | ---------------------------------------- |
| --sq-pg, --sq-postgres | Use Sequelize with PostgreSQL |
| --sq-mysql | Use Sequelize with MySQL |
| --sq-sqlite | Use Sequelize with SQLite |
| --sq-mariadb | Use Sequelize with MariaDB |
| --sq-mssql | Use Sequelize with Microsoft SQL Server |
| --tw, --tailwind | Include Tailwind CSS in the React client |
| --ts, --typescript | Generate TypeScript files |
| --js, --javascript | Generate JavaScript files |
PHP MVC Helpers
Create a controller:
scafkit make:controller Invoice approve rejectCreate a route:
scafkit make:route GET /invoices InvoiceController@index
scafkit make:route POST /invoices InvoiceController@storemake:route creates missing controller, model, and page view files only when needed. If the controller exists but the action is missing, Scafkit adds only that method and leaves existing code untouched.
Utility Commands
| Command | Description |
| ---------------------- | ------------------------------------------------------------------ |
| scafkit help | Show command help |
| scafkit help react | Show React help |
| scafkit help pern | Show PERN help |
| scafkit help php | Show PHP MVC help |
| scafkit help laravel | Show Laravel builder help |
| scafkit list | List starter templates |
| scafkit run | Start the detected React/Vite app |
| scafkit run pern | Start PERN client and API servers |
| scafkit run php | Start or link a PHP project |
| scafkit inspect | Detect the current project and list scripts/package manager |
| scafkit doctor | Check Scafkit, Node, npm, Git, PHP, Composer, and package managers |
| scafkit status | Show managed dev-server status |
| scafkit stop all | Stop tracked dev servers |
| scafkit update | Check npm for a newer CLI version and install after confirmation |
Maintenance
Release checks:
npm run check
npm run security:audit
npm run security:prod
npm run pack:dry-runStrict release gate:
npm run prepublishOnlyLicense
MIT
