mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-09-02 15:55:35 +00:00
feat: initial impl of integration
Signed-off-by: AlexsJones <alexsimonjones@gmail.com> Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
This commit is contained in:
31
cmd/integration/list.go
Normal file
31
cmd/integration/list.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package integration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/fatih/color"
|
||||
"github.com/k8sgpt-ai/k8sgpt/pkg/integration"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
// listCmd represents the list command
|
||||
var listCmd = &cobra.Command{
|
||||
Use: "list",
|
||||
Short: "Lists built-in integrations",
|
||||
Long: ``,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
||||
integration := viper.Get("integration").(*integration.Integration)
|
||||
integrations := integration.List()
|
||||
|
||||
for _, integration := range integrations {
|
||||
fmt.Printf("> %s\n", color.GreenString(integration))
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
IntegrationCmd.AddCommand(listCmd)
|
||||
|
||||
}
|
Reference in New Issue
Block a user