glint icon indicating copy to clipboard operation
glint copied to clipboard

Add Support for Shell Completion

Open erikareads opened this issue 1 year ago • 2 comments

In order to support shell completion, we'll need something like a subcommand:

$ glint_cli __complete list of arguments h
completion1  description1
completion2  description2

Then we can use a version of cobras shell completion logic: https://github.com/spf13/cobra/blob/main/bash_completionsV2.go

I'm happy to do the PR that ports the completion logic for each shell from cobra, but glint will need to support the hidden subcommand to make that work.

erikareads avatar Dec 30 '23 21:12 erikareads

Having a way to dump the list of subcommands would be nice too; I was just looking to make a shallow FZF wrapper with my CLI but I can't find a way to list all the subcommands to pass to FZF. +1 on this issue.

tankorsmash avatar Aug 05 '24 02:08 tankorsmash

I think a nice way to help with shell completion is to create a carapace spec file (https://github.com/carapace-sh/carapace-spec)

oderwat avatar May 26 '25 21:05 oderwat