cmd

package
v0.0.0-...-a8b465f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "application-ai",
	Short: "Application AI is an application generator that uses OpenAI",
	Long: `A command line app that receives a natural language instruction
		and simulates a conversation with OpenAI and in result, generates 
		the files defined`,
	Version:      version,
	SilenceUsage: true,
	RunE: func(cmd *cobra.Command, args []string) error {

		if len(args) == 0 {
			return fmt.Errorf("prompt must be provided")
		}

		err := appConfig.Initialize(viperConfig)
		if err != nil {
			return err
		}

		client, err := openai.NewAIClient(appConfig)
		if err != nil {
			return err
		}

		fileFactory := fileSystem.NewFileFactory()

		generator, err := appai.NewGenerator(appConfig, client, fileFactory)
		if err != nil {
			return err
		}

		err = generator.Run(args)
		return err
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL