Description
Description
Modern CLI apps today in general come with completion support (meaning they know how to generate their own completion shell scripts) for quite some time now. Some examples are kubectl
, docker
, many other (Golang and other) apps. This is facilitated by common Golang options libraries shipping with the support for it built in, so apps just enable it.
Symfony currently offers completion once the app is already running, which is nice, but in practice doesn't provide as much value, in many cases both users and developers will run command in non-interactive ways, only passing params and arguments. This applies to users using the apps or developers while developing (using Symfony's own commands).
There exists a project which does basic completion, with the information available from the outside:
- it's an external tool required to get this common functionality running
- it can only auto-complete so much with the "public" information
The desired direction here would be to be able to complete:
- command names
- command params
- command arguments
- do so in a dynamic context (where you take into account other already set options)
Example
$ bin/console --<TAB><TAB> # completes params
$ bin/console <TAB><TAB> # completes commands and params
$ bin/console user:disable <TAB><TAB> # completes the first argument "username" (only usernames of enabled users)
$ bin/console user:disable --force <TAB><TAB> # completes the first argument "username"
Example of common command
$ docker rm <TAB><TAB> # completes only stopped containers
$ docker rm --force <TAB><TAB> # completes all containers
$ kubectl -n <TAB><TAB> # completes namespaces
$ kubectl -n some get p<TAB><TAB> # completes "od"
$ kubectl -n some get pods <TAB><TAB> # completes pod names in the "some" namespace