-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.go
57 lines (44 loc) · 1.32 KB
/
main.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package main
import (
"os"
"github.com/descope/descopecli/accesskey"
"github.com/descope/descopecli/audit"
"github.com/descope/descopecli/flow"
"github.com/descope/descopecli/project"
"github.com/descope/descopecli/tenant"
"github.com/descope/descopecli/theme"
"github.com/descope/descopecli/user"
"github.com/spf13/cobra"
)
var version = "dev"
func main() {
cli := &cobra.Command{
Version: version,
Use: "descope",
Short: help,
Example: examples,
}
entity := &cobra.Group{ID: "entity", Title: "Entity Commands:"}
cli.AddGroup(entity)
accesskey.AddCommands(cli, entity)
user.AddCommands(cli, entity)
tenant.AddCommands(cli, entity)
proj := &cobra.Group{ID: "proj", Title: "Project Commands:"}
cli.AddGroup(proj)
audit.AddCommands(cli, proj)
project.AddCommands(cli, proj)
flow.AddCommands(cli, proj)
theme.AddCommands(cli, proj)
if err := cli.Execute(); err != nil {
os.Exit(1)
}
}
// Documentation
const help = "A command line utility for working with the Descope management APIs"
const examples = ` # Load an existing user by their loginId
export DESCOPE_PROJECT_ID=...
export DESCOPE_MANAGEMENT_KEY=...
descope user load -l name@example.com
# Export all project settings and configurations
export DESCOPE_MANAGEMENT_KEY=...
descope project snapshot export P2Z1234567890123456789012345`