Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Console][UX][DX] shell completion support directly in the Console component #38275

Copy link
Copy link
Closed
@dkarlovi

Description

@dkarlovi
Issue body actions

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConsoleDXDX = Developer eXperience (anything that improves the experience of using Symfony)DX = Developer eXperience (anything that improves the experience of using Symfony)FeatureKeep open

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.