ddev icon indicating copy to clipboard operation
ddev copied to clipboard

feat: add shell completion for `ddev config` and `ddev config global`

Open stasadev opened this issue 9 months ago • 3 comments

The Issue

ddev config and ddev config global should have autocompletion.

How This PR Solves The Issue

  • Adds autocompletion for ddev config and ddev config global with tests.
  • Updates description for some flags.

Manual Testing Instructions

ddev config --help
ddev config global --help

Press <TAB><TAB> with:

ddev config --project-type=
ddev config --php-version=
ddev config --router-http-port=
ddev config --router-https-port=
ddev config --xdebug-enabled=
ddev config --no-project-mount=
ddev config --omit-containers=
ddev config --omit-containers=db,
ddev config --omit-containers=ddev-ssh-agent,
ddev config --webserver-type=
ddev config --performance-mode=
ddev config --xhprof-mode=
ddev config --fail-on-hook-fail=
ddev config --mailpit-http-port=
ddev config --mailpit-https-port=
ddev config --project-tld=
ddev config --use-dns-when-possible=
ddev config --disable-settings-management=
ddev config --composer-version=
ddev config --bind-all-interfaces=
ddev config --database=
ddev config --nodejs-version=
ddev config --default-container-timeout=
ddev config --disable-upload-dirs-warning=
ddev config --corepack-enable=

Press <TAB><TAB> with:

ddev config global --omit-containers=
ddev config global --omit-containers=ddev-router,
ddev config global --omit-containers=ddev-ssh-agent,
ddev config global --instrumentation-opt-in=
ddev config global --router-bind-all-interfaces=
ddev config global --internet-detection-timeout-ms=
ddev config global --use-letsencrypt=
ddev config global --simple-formatting=
ddev config global --use-hardened-images=
ddev config global --fail-on-hook-fail=
ddev config global --performance-mode=
ddev config global --xhprof-mode=
ddev config global --table-style=
ddev config global --project-tld=
ddev config global --no-bind-mounts=
ddev config global --router-http-port=
ddev config global --router-https-port=
ddev config global --mailpit-http-port=
ddev config global --mailpit-https-port=
ddev config global --traefik-monitor-port=

Automated Testing Overview

Release/Deployment Notes

stasadev avatar Jun 06 '25 14:06 stasadev

Moving to draft until I understand how DDEV handles default config values.

If it doesn't work as I expected, it's not a big deal to partially revert my last commit here.

stasadev avatar Jun 09 '25 17:06 stasadev

But it did not work with global on my setup:

$ ddev config global --database=<tab>
# alert signal.
$ ddev config global --database <tab>
-- file --
README.md          artisan*           composer.json      config/

Probably something in my setup though. 🤷

@tyler36, there is no such flag in global.

Thanks for testing!

stasadev avatar Jun 13 '25 05:06 stasadev