Skip to content

Instantly share code, notes, and snippets.

@anthonyhartnell
Last active August 8, 2019 09:06
Show Gist options
  • Save anthonyhartnell/443c4ab7524d257d746750fa80ef2ba7 to your computer and use it in GitHub Desktop.
Save anthonyhartnell/443c4ab7524d257d746750fa80ef2ba7 to your computer and use it in GitHub Desktop.
WP CLI command shortcut for Docker
# Docker WP CLI command shortcut
# Step 1. Put this in your ~/.bashrc or ~/.zshrc file
wp() {
docker-compose exec php wp "$@" --allow-root
}
# Step 2. Open up a new shell to reload the config
# Step 3. Usage - type `wp post list` or any other standard wp cli command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment