diff --git a/cmd/devstream/completion.go b/cmd/devstream/completion.go index 54ff064f9..c7ea6a49e 100644 --- a/cmd/devstream/completion.go +++ b/cmd/devstream/completion.go @@ -7,6 +7,8 @@ import ( "github.com/spf13/cobra" + cobracompletefig "github.com/withfig/autocomplete-tools/integrations/cobra" + "github.com/devstream-io/devstream/internal/pkg/completion" ) @@ -55,7 +57,8 @@ func completionCMD(out io.Writer) *cobra.Command { return cmd.Root().GenPowerShellCompletionWithDesc(out) }, } - cmd.AddCommand(bash, zsh, fish, powershell) + + cmd.AddCommand(bash, zsh, fish, powershell, cobracompletefig.CreateCompletionSpecCommand(cobracompletefig.Opts{Use: "fig"})) return cmd } diff --git a/go.mod b/go.mod index 5034964b3..293f4625e 100644 --- a/go.mod +++ b/go.mod @@ -25,6 +25,7 @@ require ( github.com/spf13/viper v1.8.1 github.com/stretchr/testify v1.7.0 github.com/tcnksm/go-input v0.0.0-20180404061846-548a7d7a8ee8 + github.com/withfig/autocomplete-tools/integrations/cobra v0.0.0-20220705165518-2761d7f4b8bc github.com/xanzy/go-gitlab v0.55.1 golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 diff --git a/go.sum b/go.sum index 32bf21078..1ed3a3b0a 100644 --- a/go.sum +++ b/go.sum @@ -1265,6 +1265,8 @@ github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= +github.com/withfig/autocomplete-tools/integrations/cobra v0.0.0-20220705165518-2761d7f4b8bc h1:2pGkMttK5jQ8+6YhdyeQIHyVa84HMdJhILozImSWX6c= +github.com/withfig/autocomplete-tools/integrations/cobra v0.0.0-20220705165518-2761d7f4b8bc/go.mod h1:nmuySobZb4kFgFy6BptpXp/BBw+xFSyvVPP6auoJB4k= github.com/xanzy/go-gitlab v0.55.1 h1:IgX/DS9buV0AUz8fuJPQkdl0fQGfBiAsAHxpun8sNhg= github.com/xanzy/go-gitlab v0.55.1/go.mod h1:F0QEXwmqiBUxCgJm8fE9S+1veX4XC9Z4cfaAbqwk4YM= github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70=