diff --git a/completers/gh-copilot_completer/cmd/config.go b/completers/gh-copilot_completer/cmd/config.go new file mode 100644 index 0000000000..5eb79498e1 --- /dev/null +++ b/completers/gh-copilot_completer/cmd/config.go @@ -0,0 +1,19 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var configCmd = &cobra.Command{ + Use: "config", + Short: "Change configuration options, such as sending of optional analytics data", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(configCmd).Standalone() + + configCmd.Flags().BoolP("help", "h", false, "help for config") + rootCmd.AddCommand(configCmd) +} diff --git a/completers/gh-copilot_completer/cmd/explain.go b/completers/gh-copilot_completer/cmd/explain.go new file mode 100644 index 0000000000..5109dad93d --- /dev/null +++ b/completers/gh-copilot_completer/cmd/explain.go @@ -0,0 +1,24 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/rsteube/carapace-bridge/pkg/actions/bridge" + "github.com/spf13/cobra" +) + +var explainCmd = &cobra.Command{ + Use: "explain", + Short: "Explain a given input command in natural language", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(explainCmd).Standalone() + + explainCmd.Flags().BoolP("help", "h", false, "help for explain") + rootCmd.AddCommand(explainCmd) + + carapace.Gen(explainCmd).PositionalCompletion( + bridge.ActionCarapaceBin().SplitP(), + ) +} diff --git a/completers/gh-copilot_completer/cmd/root.go b/completers/gh-copilot_completer/cmd/root.go new file mode 100644 index 0000000000..5eb74ed4f1 --- /dev/null +++ b/completers/gh-copilot_completer/cmd/root.go @@ -0,0 +1,22 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var rootCmd = &cobra.Command{ + Use: "gh-copilot", + Short: "Your AI command line copilot", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func Execute() error { + return rootCmd.Execute() +} +func init() { + carapace.Gen(rootCmd).Standalone() + + rootCmd.Flags().BoolP("help", "h", false, "help for copilot") + rootCmd.Flags().BoolP("version", "v", false, "version for copilot") +} diff --git a/completers/gh-copilot_completer/cmd/suggest.go b/completers/gh-copilot_completer/cmd/suggest.go new file mode 100644 index 0000000000..30377df9a9 --- /dev/null +++ b/completers/gh-copilot_completer/cmd/suggest.go @@ -0,0 +1,24 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var suggestCmd = &cobra.Command{ + Use: "suggest", + Short: "Suggest a command based on a natural language description of the desired output effect", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(suggestCmd).Standalone() + + suggestCmd.Flags().BoolP("help", "h", false, "help for suggest") + suggestCmd.Flags().StringP("target", "t", "", "Target for suggestion; must be shell, gh, git") + rootCmd.AddCommand(suggestCmd) + + carapace.Gen(suggestCmd).FlagCompletion(carapace.ActionMap{ + "target": carapace.ActionValues("shell", "gh", "git"), + }) +} diff --git a/completers/gh-copilot_completer/main.go b/completers/gh-copilot_completer/main.go new file mode 100644 index 0000000000..3e24b15dbd --- /dev/null +++ b/completers/gh-copilot_completer/main.go @@ -0,0 +1,7 @@ +package main + +import "github.com/rsteube/carapace-bin/completers/gh-copilot_completer/cmd" + +func main() { + cmd.Execute() +}