cli/cmd/ghcs/main.go
Issy Long 69865fa762 cmd/ghcs/main: Better description of ghcs as a whole
Co-authored-by: Camilo Garcia La Rotta <camilogarcialarotta@github.com>
2021-07-22 14:08:20 +01:00

31 lines
690 B
Go

package main
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
func main() {
Execute()
}
var rootCmd = &cobra.Command{
Use: "ghcs",
Short: "Unofficial GitHub Codespaces CLI.",
Long: "Unofficial CLI tool to manage and interact with GitHub Codespaces.",
Version: "0.6.0",
}
func Execute() {
if os.Getenv("GITHUB_TOKEN") == "" {
fmt.Println("The GITHUB_TOKEN environment variable is required. Create a Personal Access Token at https://github.com/settings/tokens/new?scopes=repo and make sure to enable SSO for the GitHub organization after creating the token.")
os.Exit(1)
}
if err := rootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}