nettt / nettt-tools
Deployment scripts and AI skills for Laravel and Statamic projects
Requires
- php: ^8.2
- illuminate/console: ^11.0 || ^12.0 || ^13.0
- illuminate/support: ^11.0 || ^12.0 || ^13.0
- laravel/prompts: ^0.3
Requires (Dev)
- laravel/pint: ^1.18
- orchestra/testbench: ^9.0 || ^10.0 || ^11.0
- pestphp/pest: ^3.0
Suggests
- aws/aws-sdk-php: Required for Laravel Cloud bucket sync (^3.0)
README
Deployment scripts and AI skills for Laravel and Statamic projects.
Requirements
- PHP 8.2+
- Laravel 12+
- Laravel Prompts 0.3+
Installation
Step 1: Require Package
composer require nettt/nettt-tools
Step 2: Configure Site Folder
Add the required environment variable to your .env file:
REMOTE_SITE_FOLDER=your-site-folder
Step 3: Run Install Command
Always run the install command after requiring the package:
php artisan nettt:install
This command will:
- Offer to install Laravel Boost for AI-assisted development
- Remove legacy shell scripts (Statamic projects only)
- Publish the configuration file
- Add automatic post-update hook to composer scripts
- Run
boost:installas the final step
Options
# Skip confirmation prompts
php artisan nettt:install --force
# Keep backup copies of removed files
php artisan nettt:install --keep-backups
Usage
Interactive Mode
php artisan nettt:start
This will show a menu based on your environment:
Local Environment:
- Start development (update dependencies & run build)
- Pull content/database from production
- Push content/database to production
- Publish AI skills
Production Environment:
- Run deployment tasks
- Run optimization tasks
Command Options
# Run development tasks directly
php artisan nettt:start --dev
# Run deployment tasks (production only)
php artisan nettt:start --deploy
# Run optimization tasks (production only)
php artisan nettt:start --optimize
# Publish AI skills to .ai/skills
php artisan nettt:start --install-skills
Features
Start Development (Local Only)
Quickly starts your development environment by running:
composer update- Updates PHP dependencies (also triggersboost:updatevia post-update hook)npm update- Updates Node.js dependenciesnpm run build- Builds frontend assets
Pull Content (Local Only)
Syncs content from production to your local environment using SSH/rsync:
- Statamic: Syncs content, assets, forms, blueprints, users, and storage
- Laravel: Syncs storage and optionally imports the database
A backup is created before syncing.
Push Content (Local Only)
Pushes local content to production using SSH/rsync.
- Statamic: Pushes shared content directories, clears remote stache and static cache
- Laravel: Pushes shared storage directories, optionally pushes the database
Warning: This is a destructive operation that overwrites production content!
- Creates a remote backup before pushing
- Requires double confirmation to proceed
- Database push requires an additional final confirmation
Deployment (Production Only)
Handles deployment tasks based on project type:
Statamic:
- Links shared directories (content, assets, forms, users)
- Fixes permissions
- Ensures public symlink
- Runs npm install and build
- Runs deployment tests
Laravel:
- Links shared directories (storage/app/public)
- Fixes permissions
- Runs database migrations
- Runs npm install and build
- Runs deployment tests
Optimization (Production Only)
Caches configuration, routes, and views. For Statamic projects with static caching enabled, it also warms the cache.
Publish AI Skills
Publishes AI skills to your project's .ai/skills/ directory for use with Claude Code or similar tools.
Configuration
Add the following environment variables to your .env file:
# Required
REMOTE_SITE_FOLDER=your-site-folder
# Optional: Remote server (defaults shown)
NETTT_REMOTE_HOST=vm06.nettt.nl
NETTT_REMOTE_USER=nettt
NETTT_REMOTE_PORT=22222
NETTT_REMOTE_BASE=/srv/www/sites
# Optional: Override auto-detection
NETTT_PROJECT_TYPE=statamic # or 'laravel'
# Optional: Git branches (defaults shown)
NETTT_MAIN_BRANCH=main
NETTT_DEVELOP_BRANCH=develop
Automatic Post-Update Hook
After running nettt:install or nettt:start --dev, your project's composer.json will include a post-update hook that automatically runs nettt:update after each composer update.
The nettt:update command runs boost:update to keep your AI tooling in sync. It skips this if boost:update is already in your post-update-cmd scripts.
Shared Paths Configuration
The following paths are synced/shared by default:
Statamic (shared directory):
contentpublic/assetsresources/blueprints/formsresources/formsresources/usersusers
Statamic Storage (current release):
storage/form_datastorage/forms
Laravel (shared directory):
storage/app/public
You can add additional paths in the config file under shared.statamic_paths, shared.statamic_storage_paths, and shared.laravel_paths.
Project Type Detection
The package automatically detects whether your project is Laravel or Statamic by checking:
- The
NETTT_PROJECT_TYPEenvironment variable - The presence of
statamic/cmsincomposer.json - The
Statamic\Statamicclass
Legacy Files Removed (Statamic)
The following files are replaced by nettt-tools functionality:
| Legacy File | Replaced By |
|---|---|
scripts/deploy.sh | DeploymentService |
scripts/pullcontent.sh | SyncService::pull() |
scripts/pushcontent.sh | SyncService::push() |
scripts/commit.sh | Removed (no replacement) |
scripts/dev.sh | nettt:start dev option |
nettt | php artisan nettt:start |
License
MIT