Managing GravityKit Products and Licenses via WP-CLI
GravityKit includes built-in WP-CLI commands for managing products and licenses from the command line. This is useful for automated deployments, scripted updates, CI/CD pipelines, or managing sites without browser access.
All commands use the wp gk prefix and are available as long as WP-CLI is installed and a GravityKit plugin (like GravityView) is active on the site.
Note: GravityKit does not currently support installation via Composer. WP-CLI is the recommended approach for command-line management of GravityKit products.
Prerequisites
- WP-CLI installed on your server
- At least one GravityKit plugin active (this loads the GravityKit Foundation, which registers the CLI commands)
- An active GravityKit license (required for installing and updating paid products)
Quick Start
Here are the most common commands you'll need:
# Check Foundation version
wp gk version
# List your licensed products and their status
wp gk products list
# Update all installed products
wp gk products update --all
# Install and activate a specific product
wp gk products install gk-gravityexport --activate
Product Text Domains
Most commands require a text domain to identify the product. The text domain is a unique slug for each plugin. You can find it by running wp gk products list and looking at the "Text Domain" column.
Here are the text domains for GravityKit products:
|
Product |
Text Domain |
|---|---|
|
GravityView |
|
|
GravityExport |
|
|
GravityImport |
|
|
GravityCalendar |
|
|
GravityCharts |
|
|
GravityEdit |
|
|
GravityMath |
|
|
GravityMigrate |
|
|
GravityRevisions |
|
|
GravityBoard |
|
|
GravityMaps |
|
|
Dashboard Views |
|
|
Multiple Forms |
|
|
Advanced Filter |
|
|
DIY Layout |
|
|
A-Z Filters |
|
|
Magic Links |
|
|
Gravity Forms Zero Spam |
|
|
Entry Tags |
|
|
Event Field |
|
|
Dynamic Lookup |
|
You can specify multiple products by separating text domains with commas (no spaces):
wp gk products install gk-gravityview,gk-gravitycharts,gk-gravityexport --activate
Product Commands
List products
Shows all available GravityKit products with their installation and license status.
# List all products (licensed and unlicensed)
wp gk products list
# Only show installed products
wp gk products list --only-installed
# Exclude unlicensed products
wp gk products list --exclude-unlicensed
# Output as JSON (useful for scripting)
wp gk products list --format=json
# Refresh the product list from the server (bypasses 24-hour cache)
wp gk products list --skip-cache
The table output includes columns for Name, Description, Text Domain, Version, Update Available, Licensed, Installed, Active, and Network Active.
Search products
Search for a product by name, text domain, or description.
wp gk products search "import"
wp gk products search gravity --format=json
Install products
Downloads and installs products from GravityKit. Requires an active license for paid products. Free products (like Gravity Forms Zero Spam) can be installed without a license.
# Install a single product
wp gk products install gk-gravityexport
# Install and activate immediately
wp gk products install gk-gravityexport --activate
# Install multiple products at once
wp gk products install gk-gravityimport,gk-gravitycharts --activate
# Install all available licensed products
wp gk products install --all --activate
# Skip dependency checks (PHP version, WordPress version, required plugins)
wp gk products install gk-gravityexport --skip-dependency-check
About dependency checks: Before installing, the command verifies that your server meets the product's requirements (PHP version, WordPress version, required plugins). If a dependency is not met, installation is blocked and the unmet requirements are displayed.
Use --skip-dependency-check to override this, but be aware the product may not function correctly.
Update products
Updates installed products to the latest version.
# Update a specific product
wp gk products update gk-gravityview
# Update multiple products
wp gk products update gk-gravityview,gk-gravitymaps
# Update all installed products that have available updates
wp gk products update --all
# Skip dependency checks for the new version
wp gk products update gk-gravityview --skip-dependency-check
Activate and deactivate products
# Activate a product
wp gk products activate gk-gravityview
# Activate all inactive products
wp gk products activate --all
# Deactivate a product
wp gk products deactivate gk-gravitycalendar
# Deactivate even if other products depend on it
wp gk products deactivate gk-gravityview --skip-dependency-check
Note: When deactivating, --skip-dependency-check skips checking whether other active products depend on the one you're deactivating. Without this flag, the command will warn you and block deactivation if the product is required by others.
Delete products
# Delete a product (must be deactivated first)
wp gk products delete gk-gravityimport
# Deactivate and delete in one step
wp gk products delete gk-gravityimport --deactivate-before-deletion
# Delete all installed products
wp gk products delete --all --deactivate-before-deletion
License Commands
List activated licenses
# Show all activated licenses
wp gk licenses list
# Refresh license data from the server
wp gk licenses list --skip-cache
# Output as JSON
wp gk licenses list --format=json
The table shows: Name, Email, Type, Key, Expiry, Limit, Site Count, and Activations Left.
Check license status
Validates one or more license keys against the GravityKit server.
# Check a single key
wp gk licenses check YOUR_LICENSE_KEY
# Check multiple keys
wp gk licenses check KEY1,KEY2 --format=json
Activate and deactivate licenses
These commands require the --url flag to specify which site the license should be activated or deactivated for.
# Activate a license for a site
wp gk licenses activate YOUR_LICENSE_KEY --url=https://example.com
# Activate multiple licenses
wp gk licenses activate KEY1,KEY2 --url=https://example.com
# Deactivate a license
wp gk licenses deactivate YOUR_LICENSE_KEY --url=https://example.com
Automation Examples
Cron job: update all products nightly
Add this to your server's crontab to keep GravityKit products up to date automatically:
# Update all GravityKit products every night at 3 AM
# Use the full path to wp-cli (find it with: which wp)
0 3 * * * cd /path/to/wordpress && /usr/local/bin/wp gk products update --all
Deployment script: install and activate all licensed products
#!/bin/bash
# Activate the license on this site
wp gk licenses activate YOUR_LICENSE_KEY --url=https://yoursite.com
# Install and activate all licensed products
wp gk products install --all --activate
Check for available updates (CI/CD)
# List installed products as JSON, pipe to jq to find updates
# tail -n1 skips the "Found N products:" header line
wp gk products list --only-installed --format=json | tail -n1 | jq '.[] | select(.update_available != "") | {name, version, update_available}'
Output Formats
Commands that display data support two output formats via the --format flag:
--format=table(default): Human-readable table--format=json: Machine-readable JSON, useful for scripting and piping to tools likejq.
Note: a summary line (e.g., "Found 29 products:") is printed before the JSON array. When piping tojq, usetail -n1to skip it
Troubleshooting
"No licenses found": Make sure you've activated your license through the WordPress admin or via wp gk licenses activate .
Product shows as "not licensed": Your license may not cover that product, or it may have expired.
Run wp gk licenses list --skip-cache to refresh license data from the server.
Dependency check blocking installation: The product requires a newer version of PHP, WordPress, or another plugin.
Update the dependency first, or use --skip-dependency-check (not recommended for production).
Command not found: Make sure at least one GravityKit plugin is active. The CLI commands are registered by GravityKit Foundation, which is bundled with all GravityKit plugins.