CLI Command Reference
Complete reference for all WDG CLI commands.
Basic Usage
wdg <command> [options]Or if installed globally:
wdg <command> [options]Core Commands
create
Create a new WordPress project.
wdg create <project-name> [options]Options:
project-name: Name of your project (required)--init-wikit: Initialize new Wikit repository structure (creates managed wp-content repo)--clone-repo=<url>: Clone existing wp-content repo to project--remote[=org]: Add GitHub remote and push initial commit (use with --init-wikit)--php=<version>: Set PHP version (8.0, 8.1, 8.2, 8.3, 8.4, 8.5) - default: 8.2--no-start: Create project but don't start it
Examples:
# Create with Wikit theme only (default)
wdg create my-site
# Create with managed wp-content repository
wdg create my-site --init-wikit
# Create with GitHub integration
wdg create my-site --init-wikit --remote
# Clone existing client repository
wdg create my-site --clone-repo=https://github.com/client/wp-content
# Create with specific PHP version
wdg create my-site --php=8.1 --init-wikit
# Create multiple projects without starting
wdg create site1 --no-start
wdg create site2 --no-start
wdg create site3 --no-startWhat it does:
- Creates project directory structure
- Sets up WordPress container with specified PHP version
- Configures MySQL database
- Configures nginx routing
- Creates custom theme named after project
- (With --init-wikit) Creates complete wp-content repository with:
- Project-specific theme
- wikit-app plugin
- Git repository with hooks
- Auto-indexing for AI search
- (With --clone-repo) Clones client's existing codebase
- (With --remote) Connects to GitHub and pushes initial commit
start
Start services or a specific project.
wdg start [project-name]Examples:
# Start all core services
wdg start
# Start specific project
wdg start my-siteServices started:
- Qdrant (vector database)
- MySQL
- Nginx proxy
- MCP server
- Project WordPress container (if specified)
stop
Stop services or a specific project.
wdg stop [project-name]Examples:
# Stop all services
wdg stop
# Stop specific project
wdg stop my-sitedelete
Delete a project and all its data.
wdg delete <project-name> [--force]Options:
--force: Skip confirmation prompt
What it removes:
- Project files
- Database
- SSL certificates
- Nginx configuration
- Vector collection
Example:
# With confirmation
wdg delete my-site
# Without confirmation
wdg delete my-site --force🚨 DANGER
This action cannot be undone! All project data will be permanently deleted.
list
List all projects and their status.
wdg listOutput example:
WDG AI Projects
● my-site (running)
URL: https://my-site.localhost:8443
Repositories: 2
○ another-site (stopped)
Repositories: 1status
Show status of all services.
wdg statusOutput example:
Service Status:
● MySQL [running]
● Qdrant [running]
● Nginx [running]
● MCP Server [running]<project> build
Build production assets for a project (runs npm run build).
wdg my-site build<project> rebuild
Rebuild project Docker containers.
wdg my-site rebuildlogs
View logs for services or projects.
wdg logs [service-or-project]Examples:
# All logs
wdg logs
# Specific service
wdg logs mysql
wdg logs qdrant
# Project logs
wdg logs my-siteProject-Specific Development Commands
<project> dev
Start development mode with file watching and hot reload.
wdg <project> devWhat it does:
- Runs
npm startin theme or app directory - Automatically detects package.json location
- Prioritizes theme if both have package.json
- Watches for file changes and rebuilds automatically
Example:
wdg my-site dev<project> build
Build production assets for deployment.
wdg <project> buildWhat it does:
- Runs
npm run buildin theme and app directories - Optimizes and minifies assets
- Prepares code for production
Example:
wdg my-site build<project> php
Manage PHP version for a project.
wdg <project> php [subcommand]Subcommands:
- (none): Show current PHP version
set <version>: Change PHP version (rebuilds container)available: List available PHP versions
Examples:
# Check current version
wdg my-site php
# Change to PHP 8.3
wdg my-site php set 8.3
# List available versions
wdg my-site php availableAvailable PHP Versions:
- 8.0
- 8.1
- 8.2 (default)
- 8.3
<project> repo add
Add a repository to a project (project-local).
wdg <project> repo add <url> [branch]Options:
url: Git repository URLbranch: Branch to clone (default: main)
What it does:
- Clones repository to project's repositories directory
- Installs git hooks automatically
- Indexes code for AI search
Example:
wdg my-site repo add https://github.com/client/custom-plugin<project> repo list
List all repositories in a project.
wdg <project> repo listShows:
- Repository names
- Git status
- Branch information
AI & Indexing Commands
index
Index code into vector database for AI search.
wdg index [project-name] [--update]Options:
project-name: Index specific project (optional)--update: Update repositories before indexing
Examples:
# Index Wikit framework
wdg index
# Index specific project
wdg index my-site
# Update and index
wdg index --updateWhat it indexes:
- PHP files (functions, classes, hooks)
- JavaScript (functions, React components)
- CSS/SCSS files
- JSON configurations
- Markdown documentation
update
Update WDG repositories and re-index.
wdg updateWhat it does:
- Pulls latest changes from all WDG repos
- Shows commit history
- Re-indexes if changes found
collections
Manage vector database collections.
wdg collections [list|delete] [collection-name]Examples:
# List all collections
wdg collections list
# Delete a collection
wdg collections delete project_my_siteCollection naming:
- Framework:
wdg_framework - Projects:
project_<name>
Repository Management
All repository commands are project subcommands: wdg <project> repo <action>.
<project> repo add
Clone a git repository into a project.
wdg my-site repo add https://github.com/client/wp-content [branch]<project> repo attach
Mount an external repository to a project.
wdg my-site repo attach /path/to/repo --type=wp-content
wdg my-site repo attach /path/to/repo --type=pluginrepo list
List all repositories in a project.
wdg repo list <project>repo sync
Sync repositories with git remotes.
wdg repo sync <project> [repo-name]Database Commands
db export
Export project database.
wdg db export <project> [output-file]Example:
wdg db export my-site backup.sqldb import
Import database into project.
wdg db import <project> <sql-file>Example:
wdg db import my-site backup.sqldb reset
Reset project database to fresh WordPress.
wdg db reset <project>⚠️ WARNING
This will delete all content and reset to a fresh WordPress installation!
db search-replace
Search and replace in database.
wdg db search-replace <project> <search> <replace>Example:
wdg db search-replace my-site "old-domain.com" "new-domain.com"WordPress CLI
<project> wp
Run WP-CLI commands in a project.
wdg <project> wp <wp-cli-command>Examples:
# List plugins
wdg my-site wp plugin list
# Create user
wdg my-site wp user create john john@example.com --role=editor
# Clear cache
wdg my-site wp cache flush
# Install plugin
wdg my-site wp plugin install akismet --activateAdvanced Usage
Environment Variables
Set these in .env file:
# Local embedding model (completely free - no API keys!)
EMBEDDING_MODEL=all-mpnet-base-v2
# Database credentials
MYSQL_ROOT_PASSWORD=root
WP_DB_USER=wordpress
WP_DB_PASSWORD=wordpress
# Optional: Claude Desktop integration
ANTHROPIC_API_KEY=sk-ant-...
# Optional: Custom features only (NOT needed for indexing)
OPENAI_API_KEY=sk-...Services Running:
- Qdrant (Vector DB):
http://localhost:6333 - MySQL Database:
localhost:3307 - Nginx Proxy:
http://localhost:8880 - MCP Server:
http://localhost:8765 - WordPress Projects:
http://localhost:8880- Admin:
http://localhost:8880/wp-admin - Default login:
admin/admin
- Admin:
- Dashboard (optional):
- Frontend:
http://localhost:3000 - Backend API:
http://localhost:8000
- Frontend:
### Global Installation
Install WDG command globally:
```bash
sudo ln -s $(pwd)/cli/wdg /usr/local/bin/wdgNow use from anywhere:
wdg create my-new-siteBash Completion
Add to your .bashrc or .zshrc:
# WDG CLI completion
_wdg_completion() {
local commands="create start stop delete list status logs index update self-update collections mcp cd doctor ports bugherd playwright help"
COMPREPLY=($(compgen -W "$commands" -- "${COMP_WORDS[1]}"))
}
complete -F _wdg_completion wdgDocker Commands
Behind the scenes, WDG uses Docker:
# See all WDG containers
docker ps | grep wdg
# Access MySQL
docker exec -it wdg-mysql mysql -uroot -proot
# Access project WordPress
docker exec -it wdg-wp-my-site bash
# View Qdrant dashboard
open http://localhost:6333/dashboardTroubleshooting Commands
Check Services
# Full diagnostic
wdg status
docker ps
docker network ls
# Check specific service
docker logs wdg-mysql
docker logs wdg-qdrantReset Everything
# Stop all
wdg stop
# Remove all projects
for project in $(ls projects/); do
wdg delete $project --force
done
# Rebuild
wdg build
wdg startFix SSL Issues
# Regenerate certificates
wdg delete my-site --force
wdg create my-siteFix Port Conflicts
# Find what's using a port
lsof -i :8443
lsof -i :3306
lsof -i :6333
# Kill process using port
kill -9 <PID>Getting Help
# Show help
wdg help
# Show version
wdg --versionNeed more help? Run wdg help for the full command reference.