To create a custom ddev command for running php bin/magento in a Magento project, follow these steps:
1. Open the .ddev/commands/web or .ddev/commands/host directory
This is where custom commands for ddev are stored.
2. Create a new file for the command
Create a file named .ddev/commands/web/magento (no file extension) and add the following content: