tpt-local-wp-assistant
JavaScriptLocal WordPress development assistant — AI-powered content generation, theme helpers, plugin scaffolding & workflow automation that run entirely on your own machine. No cloud dependency. JavaScript. MIT.
Languages
TPT Local WP Assistant
🚀 One-click WordPress plugin development environment with hot reload!
Point to your plugin folder and get instant updates in the browser. Perfect for Windows users - no complex setup required!
⚡ Quick Start (Windows)
- Download Node.js (if you don't have it): https://nodejs.org/
- Download this project as a ZIP file
- Extract the ZIP to any folder
- Double-click
install.bator runinstall.ps1in PowerShell - Double-click the desktop shortcut that gets created!
That's it! Your WordPress development environment is ready.
🎯 What You Get
- Beautiful GUI App - Point-and-click interface
- Hot Reload - See changes instantly in browser
- TypeScript Support - Auto-compilation included
- SQLite Database - No MySQL setup needed
- WordPress Auto-Setup - Everything installed automatically
- BrowserSync - Live reloading across devices
📋 Features
- 🔥 Instant Hot Reload for PHP, JS, CSS, and TypeScript
- 🖥️ Professional GUI - Modern desktop application
- 🗄️ SQLite Database - Works perfectly in production
- 🎨 BrowserSync - Live reload with device sync
- 📝 TypeScript Ready - Automatic compilation
- 🛠️ WP-CLI Integration - Automated WordPress setup
- ⚙️ Auto PHP Installation - Downloads PHP automatically on Windows
🖥️ GUI Mode (Recommended)
npm run gui
Features a beautiful interface with:
- System dependency checking
- Plugin folder selection
- Real-time status and logs
- One-click start/stop
- Direct browser launch
💻 CLI Mode (Advanced)
npx tpt-wp-dev start /path/to/plugin
📦 Installation Options
Option 1: One-Click Installer (Windows)
- Download the ZIP
- Extract anywhere
- Run
install.batorinstall.ps1 - Use the desktop shortcut!
Option 2: Manual Installation
npm install
npm run gui # Start GUI
Option 3: Build Standalone App
npm run build-win # Creates installer
🔧 System Requirements
- Windows 10/11 (primary), macOS, or Linux
- Node.js 16+ (installer checks for this)
- PHP (automatically installed on Windows)
Installation
GUI Version (Recommended)
npm install
npm run gui
This opens the graphical interface for easy plugin development.
CLI Version
npm install -g .
Or run locally:
npm install
npm link
Quick Start
GUI Mode
- Install PHP (7.4+) if not already installed
- Run:
npm run gui - Select plugin folder using the browse button
- Click "Start Development"
- Open browser at http://localhost:3000
CLI Mode
- Install PHP (7.4+) if not already installed
- Clone or create a WordPress plugin in a folder
- Run the assistant:
tpt-wp-dev start /path/to/your/plugin/folder
- Start developing - changes will appear instantly in your browser!
Example Plugin
Try the included example plugin:
GUI: Click "Use Example" button
CLI: tpt-wp-dev start example-plugin
This creates a WordPress site with a simple plugin that demonstrates:
- PHP shortcode functionality
- JavaScript interactions
- CSS styling
- Hot reload for all file types
Usage
Basic Usage
tpt-wp-dev start /path/to/your/plugin/folder
Advanced Options
# Custom ports
tpt-wp-dev start /path/to/plugin --port 3001 --wp-port 8081
# Help
tpt-wp-dev --help
How It Works
- Environment Setup: Downloads WordPress core and sets up SQLite database
- Plugin Integration: Copies your plugin to the WordPress environment and activates it
- Servers: Starts PHP development server and BrowserSync proxy
- File Watching: Monitors your plugin files for changes
- Hot Reload: Automatically syncs changes and refreshes the browser
TypeScript Support
If your plugin contains .ts files, the assistant will:
- Create a
tsconfig.jsonif one doesn't exist - Compile TypeScript files on change
- Sync compiled JavaScript to WordPress
- Provide hot reload for both source and compiled files
Development Workflow
- Create/edit your plugin files (PHP, JS, CSS, TS)
- Changes are automatically detected
- TypeScript files are compiled (if applicable)
- Files are synced to the WordPress environment
- Browser automatically refreshes
File Structure
wordpress-dev-env/ # Auto-generated WordPress installation
├── wp-content/
│ ├── plugins/
│ │ └── your-plugin/ # Your plugin files are copied here
│ └── database/ # SQLite database files
├── wp-config.php
└── ... # WordPress core files
Accessing WordPress
- Site: http://localhost:3000
- Admin: http://localhost:3000/wp-admin
- Login: admin / password
Troubleshooting
PHP Not Found
Install PHP 7.4+ and ensure it's in your PATH.
Permission Issues
Make sure you have write permissions in the current directory.
Port Conflicts
Use --port and --wp-port options to specify different ports.
Production Deployment
Your plugin code remains unchanged and works with MySQL in production. The SQLite setup is only for local development.
License
MIT