Skip to main content
< All Topics

WP-CLI Support

Deployer for Git includes full WP-CLI support, letting you list, update, and install packages directly from your terminal – no browser required.

Requirements

  • WP-CLI 2.0 or higher
  • WordPress 4.4 or higher
  • Deployer for Git installed and activated

Commands

List packages

List all plugins and themes currently tracked by Deployer for Git.

wp dfg list

Options

OptionDescriptionDefault
–type=<type>Filter by plugin or themeall
–format=<format>Output as table, csv, json, or counttable

Examples

# List everything
wp dfg list

# List only plugins
wp dfg list --type=plugin

# Output as JSON (useful for scripting)
wp dfg list --format=json

Update a package

Redeploy a registered package from its git repository. This is the CLI equivalent of clicking “Update” on the dashboard.

wp dfg update <slug> [--type=<type>]

Arguments

ArgumentDescription
<slug>The package slug (e.g. my-plugin)

Options

OptionDescriptionDefault
–type=<type>plugin or themeplugin

Examples

# Update a plugin
wp dfg update my-plugin

# Update a theme
wp dfg update my-theme --type=theme

Install a package

Install a plugin or theme from a git repository and register it with Deployer for Git in one step. After installation, the package appears on your dashboard and can be updated via webhook or CLI.

wp dfg install <repo-url> --provider=<provider> --type=<type> [options]

Arguments

ArgumentDescription
<repo-url>Full URL of the repository

Required options

OptionDescription
–provider=<provider>github, gitlab, bitbucket, or gitea
–type=<type>plugin or theme

Optional options

OptionDescriptionDefault
–branch=<branch>Branch to deploymaster
–privateMark the repository as private (PRO)
–token=<token>Access token for GitHub, GitLab, or Gitea private repos (PRO)
–username=<username>Username for Bitbucket private repos (PRO)
–password=<password>App password for Bitbucket private repos (PRO)

Examples

# Install a public plugin from GitHub
wp dfg install https://github.com/user/my-plugin --provider=github --type=plugin

# Install from a specific branch
wp dfg install https://github.com/user/my-theme --provider=github --type=theme --branch=main

# Install a private plugin using a GitHub token (PRO)
wp dfg install https://github.com/user/private-plugin --provider=github --type=plugin --private --token=ghp_xxxxxxxxxxxx

# Install from GitLab
wp dfg install https://gitlab.com/user/my-plugin --provider=gitlab --type=plugin

# Install from a self-hosted Gitea instance
wp dfg install https://git.example.com/user/my-plugin --provider=gitea --type=plugin --branch=main --private --token=your_token

Use in deployment scripts

The install and update commands bypass the normal WordPress capability check (the same way the webhook does), so they work reliably in CI/CD pipelines and cron-based deploy scripts without needing a logged-in admin user.

# Example deploy script snippet
wp dfg update my-plugin
wp dfg update my-theme --type=theme

Cache flushing

If you have cache flushing enabled in Deployer for Git settings (Miscellaneous → Flush cache on update), it also fires after a successful wp dfg update or wp dfg install.