github.com/supabase/cli@v1.168.1/cmd/orgs.go (about)

     1  package cmd
     2  
     3  import (
     4  	"github.com/spf13/cobra"
     5  	"github.com/supabase/cli/internal/orgs/create"
     6  	"github.com/supabase/cli/internal/orgs/list"
     7  )
     8  
     9  var (
    10  	orgsCmd = &cobra.Command{
    11  		GroupID: groupManagementAPI,
    12  		Use:     "orgs",
    13  		Short:   "Manage Supabase organizations",
    14  	}
    15  
    16  	orgsListCmd = &cobra.Command{
    17  		Use:   "list",
    18  		Short: "List all organizations",
    19  		Long:  "List all organizations the logged-in user belongs.",
    20  		RunE: func(cmd *cobra.Command, args []string) error {
    21  			return list.Run(cmd.Context())
    22  		},
    23  	}
    24  
    25  	orgsCreateCmd = &cobra.Command{
    26  		Use:   "create",
    27  		Short: "Create an organization",
    28  		Long:  "Create an organization for the logged-in user.",
    29  		Args:  cobra.ExactArgs(1),
    30  		RunE: func(cmd *cobra.Command, args []string) error {
    31  			return create.Run(cmd.Context(), args[0])
    32  		},
    33  	}
    34  )
    35  
    36  func init() {
    37  	orgsCmd.AddCommand(orgsListCmd)
    38  	orgsCmd.AddCommand(orgsCreateCmd)
    39  	rootCmd.AddCommand(orgsCmd)
    40  }