Skip to content

Commit

Permalink
Add ask and config command descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ThiagoSousaSantana committed Apr 3, 2024
1 parent 91d2f05 commit 926bb57
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
5 changes: 4 additions & 1 deletion cmd/ask.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ var (
var askCmd = &cobra.Command{
Use: "ask",
Short: "Ask a question to Gemini",
Long: ``,
Long: `The ask command allows you to ask a question to Gemini, a generative AI model.
You can provide a query using the --query flag and receive a response from the model.
If you want the response to be streamed to the console, you can use the --stream flag.
Please make sure to configure your API Key before using this command by running 'go-gemini-cli config'.`,
Run: func(cmd *cobra.Command, args []string) {
ctx := cmd.Context()

Expand Down
4 changes: 3 additions & 1 deletion cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ var (
var configCmd = &cobra.Command{
Use: "config",
Short: "Config command is used to configure the Gemini API Key",
Long: ``,
Long: `The config command is used to configure the Gemini API Key. It allows you to set the API key that will be used for making requests to the Gemini API.
You can provide the API key using the --api-key flag. If the API key is provided, it will be stored in the configuration file.
Subsequent requests to the Gemini API will use this stored API key. If no API key is provided, an error message will be displayed.`,
Run: func(cmd *cobra.Command, args []string) {
if apiKey != "" {
viper.Set("gemini.api-key", apiKey)
Expand Down
14 changes: 3 additions & 11 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,9 @@ var cfgFile string

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "go-gemini",
Short: "A brief description of your application",
Long: `A longer description that spans multiple lines and likely contains
examples and usage of using your application. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
// Uncomment the following line if your bare application
// has an action associated with it:
// Run: func(cmd *cobra.Command, args []string) { },
Use: "go-gemini-cli",
Short: "A CLI tool for interacting with the OpenAI Gemini API.",
Long: `go-gemini-cli is a command-line interface tool for interacting with the OpenAI Gemini API. It provides a convenient way to access and utilize the powerful capabilities of the Gemini API, allowing you to generate natural language text, answer questions, create conversational agents, and much more.`,
}

// Execute adds all child commands to the root command and sets flags appropriately.
Expand Down

0 comments on commit 926bb57

Please sign in to comment.