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