Handy DDEV aliases and tricks

By Bill Seremetis, 17 November, 2023

Below is a list of bash_aliases and other tricks to make your interaction with DDEV even better:

alias dcr='ddev drush cr'
alias duli='ddev drush uli'
alias composer='ddev composer'
alias drush='ddev drush'
alias robo='ddev robo' # Expect a robo command defined in your global or project settings.
alias xe='ddev xdebug enable'
alias xd='ddev xdebug disable'
alias xt='status=$(ddev xdebug status) &&  if [ "$status" == "xdebug enabled" ]; then ddev xdebug off; else ddev xdebug on; fi'

For the robo command to work add the following under ~/.ddev/commands/web/robo or in your projects .ddev folder, under the same path.

commands/web/robo -p
## Description: Run robo inside the web container
## Usage: robo [flags] [args]
## Example: "ddev robo init"

robo "$@

To run robo tasks from inside PHPStorm (you can even run them from inside your README.md files!) use https://plugins.jetbrains.com/plugin/18813-ddev-integration and things like:

Proper configuration for Robo tasks with DDEV and PHPStorm


And finally, to have a similar experience in and out of DDEV containers, symlink your .gitconfig to ~/.ddev/homeadditions. Also consider adding a .bash_aliases with the following:

alias ll="ls -lhA"
alias groot='cd $(git rev-parse --show-cdup)'
alias mkdir='mkdir -p -v'

# Make Bash error tolerant
alias ..='cd ..'
alias cd..='cd ..'

# Automatically prepend cd when entering just a path in the shell
shopt -s autocd

# XDebug
alias xe='enable_xdebug'
alias xd='disable_xdebug'