diff --git a/LICENSE b/LICENSE index 74b81ad..f873753 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,22 @@ -MIT License - -Copyright (c) 2021 Deepgram Devs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +MIT License + +Copyright (c) 2021 Deepgram Devs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/cmd/analyze/analyze.go b/cmd/analyze/analyze.go new file mode 100644 index 0000000..a019c94 --- /dev/null +++ b/cmd/analyze/analyze.go @@ -0,0 +1,42 @@ +// Copyright 2024 Deepgram CLI contributors. All Rights Reserved. +// Use of this source code is governed by a MIT license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT + +package analyze + +import ( + "fmt" + + "github.com/spf13/cobra" + + "github.com/deepgram-devs/deepgram-cli/cmd" +) + +// analyzeCmd represents the analyze command +var analyzeCmd = &cobra.Command{ + Use: "analyze", + Short: "A brief description of your command", + Long: `A longer description that spans multiple lines and likely contains examples +and usage of using your command. 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.`, + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("analyze called") + }, +} + +func init() { + cmd.RootCmd.AddCommand(analyzeCmd) + + // Here you will define your flags and configuration settings. + + // Cobra supports Persistent Flags which will work for this command + // and all subcommands, e.g.: + // analyzeCmd.PersistentFlags().String("foo", "", "A help for foo") + + // Cobra supports local flags which will only run when this command + // is called directly, e.g.: + // analyzeCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") +} diff --git a/cmd/listen/listen.go b/cmd/listen/listen.go new file mode 100644 index 0000000..4f0e6a5 --- /dev/null +++ b/cmd/listen/listen.go @@ -0,0 +1,51 @@ +// Copyright 2024 Deepgram CLI contributors. All Rights Reserved. +// Use of this source code is governed by a MIT license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT + +package listen + +import ( + "fmt" + + "github.com/spf13/cobra" + + "github.com/deepgram-devs/deepgram-cli/cmd" + rest "github.com/deepgram-devs/deepgram-cli/cmd/listen/rest" +) + +// listenCmd represents the listen command +var ListenCmd = &cobra.Command{ + Use: "listen", + Short: "A brief description of your command", + Long: `A longer description that spans multiple lines and likely contains examples +and usage of using your command. 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.`, + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("listen (Speech-to-Text) called") + fmt.Println("Available subcommands:") + if len(args) == 0 { + for _, subCmd := range cmd.Commands() { + fmt.Printf("- %s: %s\n", subCmd.Use, subCmd.Short) + } + } + }, +} + +func init() { + ListenCmd.AddCommand(rest.SttRestCmd) + + cmd.RootCmd.AddCommand(ListenCmd) + + // Here you will define your flags and configuration settings. + + // Cobra supports Persistent Flags which will work for this command + // and all subcommands, e.g.: + // listenCmd.PersistentFlags().String("foo", "", "A help for foo") + + // Cobra supports local flags which will only run when this command + // is called directly, e.g.: + // listenCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") +} diff --git a/cmd/listen/rest/rest.go b/cmd/listen/rest/rest.go new file mode 100644 index 0000000..9667bf1 --- /dev/null +++ b/cmd/listen/rest/rest.go @@ -0,0 +1,27 @@ +// Copyright 2024 Deepgram CLI contributors. All Rights Reserved. +// Use of this source code is governed by a MIT license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT + +package rest + +import ( + "fmt" + + "github.com/spf13/cobra" +) + +// sttRestCmd represents the sttRest command +var SttRestCmd = &cobra.Command{ + Use: "rest", + Aliases: []string{"sttrest", "stt-rest", "speech-to-text-rest"}, + Short: "A brief description of your command", + Long: `A longer description that spans multiple lines and likely contains examples +and usage of using your command. 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.`, + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("Speech-to-Text Rest called") + }, +} diff --git a/cmd/manage/manage.go b/cmd/manage/manage.go new file mode 100644 index 0000000..ea7d563 --- /dev/null +++ b/cmd/manage/manage.go @@ -0,0 +1,42 @@ +// Copyright 2024 Deepgram CLI contributors. All Rights Reserved. +// Use of this source code is governed by a MIT license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT + +package manage + +import ( + "fmt" + + "github.com/spf13/cobra" + + "github.com/deepgram-devs/deepgram-cli/cmd" +) + +// manageCmd represents the manage command +var manageCmd = &cobra.Command{ + Use: "manage", + Short: "A brief description of your command", + Long: `A longer description that spans multiple lines and likely contains examples +and usage of using your command. 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.`, + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("manage called") + }, +} + +func init() { + cmd.RootCmd.AddCommand(manageCmd) + + // Here you will define your flags and configuration settings. + + // Cobra supports Persistent Flags which will work for this command + // and all subcommands, e.g.: + // manageCmd.PersistentFlags().String("foo", "", "A help for foo") + + // Cobra supports local flags which will only run when this command + // is called directly, e.g.: + // manageCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") +} diff --git a/cmd/root.go b/cmd/root.go new file mode 100644 index 0000000..4ef5002 --- /dev/null +++ b/cmd/root.go @@ -0,0 +1,47 @@ +// Copyright 2024 Deepgram CLI contributors. All Rights Reserved. +// Use of this source code is governed by a MIT license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT + +package cmd + +import ( + "os" + + "github.com/spf13/cobra" +) + +// rootCmd represents the base command when called without any subcommands +var RootCmd = &cobra.Command{ + Use: "cli", + 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) { }, +} + +// Execute adds all child commands to the root command and sets flags appropriately. +// This is called by main.main(). It only needs to happen once to the rootCmd. +func Execute() { + err := RootCmd.Execute() + if err != nil { + os.Exit(1) + } +} + +func init() { + // Here you will define your flags and configuration settings. + // Cobra supports persistent flags, which, if defined here, + // will be global for your application. + + // rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.cli.yaml)") + + // Cobra also supports local flags, which will only run + // when this action is called directly. + RootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") +} diff --git a/cmd/selfhosted/selfHosted.go b/cmd/selfhosted/selfHosted.go new file mode 100644 index 0000000..afd95b1 --- /dev/null +++ b/cmd/selfhosted/selfHosted.go @@ -0,0 +1,43 @@ +// Copyright 2024 Deepgram CLI contributors. All Rights Reserved. +// Use of this source code is governed by a MIT license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT + +package selfhosted + +import ( + "fmt" + + "github.com/spf13/cobra" + + "github.com/deepgram-devs/deepgram-cli/cmd" +) + +// selfHostedCmd represents the selfHosted command +var selfHostedCmd = &cobra.Command{ + Use: "selfhosted", + Aliases: []string{"sh"}, + Short: "A brief description of your command", + Long: `A longer description that spans multiple lines and likely contains examples +and usage of using your command. 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.`, + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("selfHosted called") + }, +} + +func init() { + cmd.RootCmd.AddCommand(selfHostedCmd) + + // Here you will define your flags and configuration settings. + + // Cobra supports Persistent Flags which will work for this command + // and all subcommands, e.g.: + // selfHostedCmd.PersistentFlags().String("foo", "", "A help for foo") + + // Cobra supports local flags which will only run when this command + // is called directly, e.g.: + // selfHostedCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") +} diff --git a/cmd/speak/rest/rest.go b/cmd/speak/rest/rest.go new file mode 100644 index 0000000..9dc04da --- /dev/null +++ b/cmd/speak/rest/rest.go @@ -0,0 +1,27 @@ +// Copyright 2024 Deepgram CLI contributors. All Rights Reserved. +// Use of this source code is governed by a MIT license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT + +package rest + +import ( + "fmt" + + "github.com/spf13/cobra" +) + +// ttsRestCmd represents the ttsRest command +var TtsRestCmd = &cobra.Command{ + Use: "rest", + Aliases: []string{"ttsrest", "tts-rest", "text-to-speech-rest"}, + Short: "A brief description of your command", + Long: `A longer description that spans multiple lines and likely contains examples +and usage of using your command. 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.`, + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("Text-to-Speech REST called") + }, +} diff --git a/cmd/speak/speak.go b/cmd/speak/speak.go new file mode 100644 index 0000000..0d63bea --- /dev/null +++ b/cmd/speak/speak.go @@ -0,0 +1,51 @@ +// Copyright 2024 Deepgram CLI contributors. All Rights Reserved. +// Use of this source code is governed by a MIT license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT + +package speak + +import ( + "fmt" + + "github.com/spf13/cobra" + + "github.com/deepgram-devs/deepgram-cli/cmd" + "github.com/deepgram-devs/deepgram-cli/cmd/speak/rest" +) + +// speakCmd represents the speak command +var SpeakCmd = &cobra.Command{ + Use: "speak", + Short: "A brief description of your command", + Long: `A longer description that spans multiple lines and likely contains examples +and usage of using your command. 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.`, + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("speak (Text-to-Speech) called") + fmt.Println("Available subcommands:") + if len(args) == 0 { + for _, subCmd := range cmd.Commands() { + fmt.Printf("- %s: %s\n", subCmd.Use, subCmd.Short) + } + } + }, +} + +func init() { + SpeakCmd.AddCommand(rest.TtsRestCmd) + + cmd.RootCmd.AddCommand(SpeakCmd) + + // Here you will define your flags and configuration settings. + + // Cobra supports Persistent Flags which will work for this command + // and all subcommands, e.g.: + // speakCmd.PersistentFlags().String("foo", "", "A help for foo") + + // Cobra supports local flags which will only run when this command + // is called directly, e.g.: + // speakCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..a3b6d39 --- /dev/null +++ b/go.mod @@ -0,0 +1,9 @@ +module github.com/deepgram-devs/deepgram-cli + +go 1.19 + +require ( + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/spf13/cobra v1.8.1 // indirect + github.com/spf13/pflag v1.0.5 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..912390a --- /dev/null +++ b/go.sum @@ -0,0 +1,10 @@ +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/main.go b/main.go new file mode 100644 index 0000000..3757b9d --- /dev/null +++ b/main.go @@ -0,0 +1,19 @@ +// Copyright 2024 Deepgram CLI contributors. All Rights Reserved. +// Use of this source code is governed by a MIT license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT + +package main + +import ( + "github.com/deepgram-devs/deepgram-cli/cmd" + + _ "github.com/deepgram-devs/deepgram-cli/cmd/analyze" + _ "github.com/deepgram-devs/deepgram-cli/cmd/listen" + _ "github.com/deepgram-devs/deepgram-cli/cmd/manage" + _ "github.com/deepgram-devs/deepgram-cli/cmd/selfhosted" + _ "github.com/deepgram-devs/deepgram-cli/cmd/speak" +) + +func main() { + cmd.Execute() +} diff --git a/pkg/analyze/analyze.go b/pkg/analyze/analyze.go new file mode 100644 index 0000000..8c5b741 --- /dev/null +++ b/pkg/analyze/analyze.go @@ -0,0 +1,11 @@ +// Copyright 2024 Deepgram CLI contributors. All Rights Reserved. +// Use of this source code is governed by a MIT license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT + +package analyze + +// import ( +// "context" +// ) + +// TODO: the "stuff" this module does diff --git a/pkg/listen/rest/rest.go b/pkg/listen/rest/rest.go new file mode 100644 index 0000000..be257c1 --- /dev/null +++ b/pkg/listen/rest/rest.go @@ -0,0 +1,11 @@ +// Copyright 2024 Deepgram CLI contributors. All Rights Reserved. +// Use of this source code is governed by a MIT license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT + +package rest + +// import ( +// "context" +// ) + +// TODO: the "stuff" this module does diff --git a/pkg/manage/manage.go b/pkg/manage/manage.go new file mode 100644 index 0000000..0b01d06 --- /dev/null +++ b/pkg/manage/manage.go @@ -0,0 +1,11 @@ +// Copyright 2024 Deepgram CLI contributors. All Rights Reserved. +// Use of this source code is governed by a MIT license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT + +package manage + +// import ( +// "context" +// ) + +// TODO: the "stuff" this module does diff --git a/pkg/selfhosted/selfhosted.go b/pkg/selfhosted/selfhosted.go new file mode 100644 index 0000000..3c36999 --- /dev/null +++ b/pkg/selfhosted/selfhosted.go @@ -0,0 +1,11 @@ +// Copyright 2024 Deepgram CLI contributors. All Rights Reserved. +// Use of this source code is governed by a MIT license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT + +package selfhosted + +// import ( +// "context" +// ) + +// TODO: the "stuff" this module does diff --git a/pkg/speak/rest/rest.go b/pkg/speak/rest/rest.go new file mode 100644 index 0000000..be257c1 --- /dev/null +++ b/pkg/speak/rest/rest.go @@ -0,0 +1,11 @@ +// Copyright 2024 Deepgram CLI contributors. All Rights Reserved. +// Use of this source code is governed by a MIT license that can be found in the LICENSE file. +// SPDX-License-Identifier: MIT + +package rest + +// import ( +// "context" +// ) + +// TODO: the "stuff" this module does