Generate an interactive, autocompleting shell for any Cobra CLI
APACHE-2.0 License
Leverages the Cobra completion API to generate an interactive shell for any Cobra CLI, powered by go-prompt.
go get github.com/brianstrauch/cobra-shell
package main
import (
shell "github.com/brianstrauch/cobra-shell"
"github.com/spf13/cobra"
)
func main() {
cmd := &cobra.Command{Use: "example"}
cmd.AddCommand(shell.New())
_ = cmd.Execute()
}