Skip to content

CLI Command Reference

Complete reference for all WDG CLI commands.

Basic Usage

bash
wdg <command> [options]

Or if installed globally:

bash
wdg <command> [options]

Core Commands

create

Create a new WordPress project.

bash
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:

bash
# 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-start

What it does:

  1. Creates project directory structure
  2. Sets up WordPress container with specified PHP version
  3. Configures MySQL database
  4. Configures nginx routing
  5. Creates custom theme named after project
  6. (With --init-wikit) Creates complete wp-content repository with:
    • Project-specific theme
    • wikit-app plugin
    • Git repository with hooks
    • Auto-indexing for AI search
  7. (With --clone-repo) Clones client's existing codebase
  8. (With --remote) Connects to GitHub and pushes initial commit

start

Start services or a specific project.

bash
wdg start [project-name]

Examples:

bash
# Start all core services
wdg start

# Start specific project
wdg start my-site

Services started:

  • Qdrant (vector database)
  • MySQL
  • Nginx proxy
  • MCP server
  • Project WordPress container (if specified)

stop

Stop services or a specific project.

bash
wdg stop [project-name]

Examples:

bash
# Stop all services
wdg stop

# Stop specific project
wdg stop my-site

delete

Delete a project and all its data.

bash
wdg delete <project-name> [--force]

Options:

  • --force: Skip confirmation prompt

What it removes:

  • Project files
  • Database
  • SSL certificates
  • Nginx configuration
  • Vector collection

Example:

bash
# 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.

bash
wdg list

Output example:

WDG AI Projects
  ● my-site (running)
     URL: https://my-site.localhost:8443
     Repositories: 2
  ○ another-site (stopped)
     Repositories: 1

status

Show status of all services.

bash
wdg status

Output example:

Service Status:
  ● MySQL         [running]
  ● Qdrant        [running]
  ● Nginx         [running]
  ● MCP Server    [running]

<project> build

Build production assets for a project (runs npm run build).

bash
wdg my-site build

<project> rebuild

Rebuild project Docker containers.

bash
wdg my-site rebuild

logs

View logs for services or projects.

bash
wdg logs [service-or-project]

Examples:

bash
# All logs
wdg logs

# Specific service
wdg logs mysql
wdg logs qdrant

# Project logs
wdg logs my-site

Project-Specific Development Commands

<project> dev

Start development mode with file watching and hot reload.

bash
wdg <project> dev

What it does:

  • Runs npm start in theme or app directory
  • Automatically detects package.json location
  • Prioritizes theme if both have package.json
  • Watches for file changes and rebuilds automatically

Example:

bash
wdg my-site dev

<project> build

Build production assets for deployment.

bash
wdg <project> build

What it does:

  • Runs npm run build in theme and app directories
  • Optimizes and minifies assets
  • Prepares code for production

Example:

bash
wdg my-site build

<project> php

Manage PHP version for a project.

bash
wdg <project> php [subcommand]

Subcommands:

  • (none): Show current PHP version
  • set <version>: Change PHP version (rebuilds container)
  • available: List available PHP versions

Examples:

bash
# 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 available

Available PHP Versions:

  • 8.0
  • 8.1
  • 8.2 (default)
  • 8.3

<project> repo add

Add a repository to a project (project-local).

bash
wdg <project> repo add <url> [branch]

Options:

  • url: Git repository URL
  • branch: 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:

bash
wdg my-site repo add https://github.com/client/custom-plugin

<project> repo list

List all repositories in a project.

bash
wdg <project> repo list

Shows:

  • Repository names
  • Git status
  • Branch information

AI & Indexing Commands

index

Index code into vector database for AI search.

bash
wdg index [project-name] [--update]

Options:

  • project-name: Index specific project (optional)
  • --update: Update repositories before indexing

Examples:

bash
# Index Wikit framework
wdg index

# Index specific project
wdg index my-site

# Update and index
wdg index --update

What 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.

bash
wdg update

What it does:

  1. Pulls latest changes from all WDG repos
  2. Shows commit history
  3. Re-indexes if changes found

collections

Manage vector database collections.

bash
wdg collections [list|delete] [collection-name]

Examples:

bash
# List all collections
wdg collections list

# Delete a collection
wdg collections delete project_my_site

Collection 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.

bash
wdg my-site repo add https://github.com/client/wp-content [branch]

<project> repo attach

Mount an external repository to a project.

bash
wdg my-site repo attach /path/to/repo --type=wp-content
wdg my-site repo attach /path/to/repo --type=plugin

repo list

List all repositories in a project.

bash
wdg repo list <project>

repo sync

Sync repositories with git remotes.

bash
wdg repo sync <project> [repo-name]

Database Commands

db export

Export project database.

bash
wdg db export <project> [output-file]

Example:

bash
wdg db export my-site backup.sql

db import

Import database into project.

bash
wdg db import <project> <sql-file>

Example:

bash
wdg db import my-site backup.sql

db reset

Reset project database to fresh WordPress.

bash
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.

bash
wdg db search-replace <project> <search> <replace>

Example:

bash
wdg db search-replace my-site "old-domain.com" "new-domain.com"

WordPress CLI

<project> wp

Run WP-CLI commands in a project.

bash
wdg <project> wp <wp-cli-command>

Examples:

bash
# 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 --activate

Advanced Usage

Environment Variables

Set these in .env file:

bash
# 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
  • Dashboard (optional):
    • Frontend: http://localhost:3000
    • Backend API: http://localhost:8000

### Global Installation

Install WDG command globally:

```bash
sudo ln -s $(pwd)/cli/wdg /usr/local/bin/wdg

Now use from anywhere:

bash
wdg create my-new-site

Bash Completion

Add to your .bashrc or .zshrc:

bash
# 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 wdg

Docker Commands

Behind the scenes, WDG uses Docker:

bash
# 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/dashboard

Troubleshooting Commands

Check Services

bash
# Full diagnostic
wdg status
docker ps
docker network ls

# Check specific service
docker logs wdg-mysql
docker logs wdg-qdrant

Reset Everything

bash
# Stop all
wdg stop

# Remove all projects
for project in $(ls projects/); do
    wdg delete $project --force
done

# Rebuild
wdg build
wdg start

Fix SSL Issues

bash
# Regenerate certificates
wdg delete my-site --force
wdg create my-site

Fix Port Conflicts

bash
# Find what's using a port
lsof -i :8443
lsof -i :3306
lsof -i :6333

# Kill process using port
kill -9 <PID>

Getting Help

bash
# Show help
wdg help

# Show version
wdg --version

Need more help? Run wdg help for the full command reference.

Released under the MIT License.