The Unofficial WP Engine (WPE) CLI
The unofficial WP Engine CLI based off their API.
Setup
The config location defaults to $HOME/.config/wpe/config.yaml but you can also provide the --config flag:
wpe sites list --config path/to/config.yaml
The default contents are:
base_url: https://api.wpengineapi.com/v1
auth_username: <username>
auth_password: <password>
cache_type: "object"
backup_description: "Plugin Updates"
backup_emails:
- 1@example.com
- 2@example.com
- 3@example.com
Examples of use
List your sites
wpe sites list
Formatted as JSON and piped into jq
wpe sites list --format json | \
jq '.Results[] | "\(.id) \(.group_name) \(.name)"' -r
Create a site
wpe sites create <account_id> "A new site"
Backup an install
wpe install list --ui | wpe install backup create -i -
wpe install list | fzf | grep -oE "^([a-zA-Z0-9-]+)" | wpe install backup create -i -
wpe sites list | fzf --bind 'enter:become(echo {1})' | wpe install backup create -i -
Purge an installs cache
Purge an installs page cache:
wpe installs purge 912d4b68-6a7e-4b85-8a3e-95524b63ff41 page
Purge an installs object cache:
wpe installs list --ui | wpe installs purge -
Purge an installs CDN cache:
wpe installs list --ui | wpe installs purge - cdn
Build Instructions
The standard go build should work but there is also a GNU
Make Makefile. It has the following usage:
Usage:
help print this help message
tidy format code and tidy modfile
audit run quality control checks
test run all tests
test/cover run all tests and display coverage
build build the application
run run the application
To build just run:
make build
TODO
- GET /status
- GET /swagger
- GET /accounts
- GET /accounts/{account_id}
- GET /accounts/{account_id}/account_users
- POST /accounts/{account_id}/account_users
- GET /accounts/{account_id}/account_users/{user_id}
- PATCH /accounts/{account_id}/account_users/{user_id}
- DELETE /accounts/{account_id}/account_users/{user_id}
- GET /sites
- POST /sites
- GET /sites/{site_id}
- PATCH /sites/{site_id}
- DELETE /sites/{site_id}
- GET /installs
- POST /installs
- GET /installs/{install_id}
- DELETE /installs/{install_id}
- PATCH /installs/{install_id}
- GET /installs/{install_id}/domains
- POST /installs/{install_id}/domains
- POST /installs/{install_id}/domains/bulk
- GET /installs/{install_id}/domains/{domain_id}
- PATCH /installs/{install_id}/domains/{domain_id}
- DELETE /installs/{install_id}/domains/{domain_id}
- POST /installs/{install_id}/domains/{domain_id}/check_status
- POST /installs/{install_id}/backups
- GET /installs/{install_id}/backups/{backup_id}
- POST /installs/{install_id}/purge_cache
- GET /user
- GET /ssh_keys
- POST /ssh_keys
- DELETE /ssh_keys