generated from brevdev/seed
-
Notifications
You must be signed in to change notification settings - Fork 9
/
setup.go
41 lines (35 loc) · 1.28 KB
/
setup.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
// Package setup WE SHOULD SETUP THE USER HERE
package setup
import (
"github.com/brevdev/brev-cli/pkg/cmd/cmderrors"
"github.com/brevdev/brev-cli/pkg/entity"
"github.com/brevdev/brev-cli/pkg/store"
"github.com/brevdev/brev-cli/pkg/terminal"
"github.com/spf13/cobra"
)
var (
setupLong = "Setup your local machine to work best with Brev.dev"
setupExample = "brev setup"
)
type SetupStore interface {
GetCurrentUser() (*entity.User, error)
CreateUser(idToken string) (*entity.User, error)
GetOrganizations(options *store.GetOrganizationsOptions) ([]entity.Organization, error)
CreateOrganization(req store.CreateOrganizationRequest) (*entity.Organization, error)
GetServerSockFile() string
GetWorkspaces(organizationID string, options *store.GetWorkspacesOptions) ([]entity.Workspace, error)
}
func NewCmdOpen(_ *terminal.Terminal, _ SetupStore) *cobra.Command {
cmd := &cobra.Command{
Annotations: map[string]string{"ssh": ""},
Use: "open",
DisableFlagsInUseLine: true,
Short: "[beta] open VSCode to ",
Long: setupLong,
Example: setupExample,
Args: cmderrors.TransformToValidationError(cobra.ExactArgs(1)),
Run: func(cmd *cobra.Command, args []string) {
},
}
return cmd
}