nettt/nettt-tools

Deployment scripts and AI skills for Laravel and Statamic projects

Maintainers

Package info

bitbucket.org/nettt/nettt-tools

pkg:composer/nettt/nettt-tools

Statistics

Installs: 225

Dependents: 0

Suggesters: 0

1.33.0 2026-04-03 14:45 UTC

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:install as 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:

  1. composer update - Updates PHP dependencies (also triggers boost:update via post-update hook)
  2. npm update - Updates Node.js dependencies
  3. npm 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):

  • content
  • public/assets
  • resources/blueprints/forms
  • resources/forms
  • resources/users
  • users

Statamic Storage (current release):

  • storage/form_data
  • storage/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:

  1. The NETTT_PROJECT_TYPE environment variable
  2. The presence of statamic/cms in composer.json
  3. The Statamic\Statamic class

Legacy Files Removed (Statamic)

The following files are replaced by nettt-tools functionality:

Legacy FileReplaced By
scripts/deploy.shDeploymentService
scripts/pullcontent.shSyncService::pull()
scripts/pushcontent.shSyncService::push()
scripts/commit.shRemoved (no replacement)
scripts/dev.shnettt:start dev option
netttphp artisan nettt:start

License

MIT