Skip to content

Bash completion for RPC names #544

Description

@SapiensAnatis

It would be a really nice enhancement to the usability of the tool if you could auto-complete the names of RPCs. I often find it difficult to type out the <package name>.<service name>.<rpc name> fully from memory and end up having to use several list commands to jog my memory before my actual intended command. I'm imagining this would look like:

$ grpcurl -plaintext localhost:50051
# when the user presses tab, shows a list of service names
myapp.LogsService
myapp.UsersService

$ grpcurl -plaintext localhost:50051 myapp.LogsService
# when the user presses tab, shows a list of RPC names
myapp.LogsService.ListLogs
myapp.LogsService.DownloadLogs

$ grpcurl -plaintext locaclhost:50051 myapp.LogsService.List
# when the user presses tab, auto-completes to myapp.LogsService.ListLogs

I did a quick search and haven't seen this proposed before but apologies if I missed any duplicates.

The main challenge as far as I can see is populating the available entries for completion -- the scenario I've described above would require server reflection, and even then it could be slow if you make a reflection request on every tab so there might be some tricks needed.

Is this something that would be appreciated as an addition to the tool? I'm happy to attempt making a PR (with my sharply limited Go expertise) if so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions