Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions cmd/lk/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,20 +269,24 @@ func tryAuthIfNeeded(ctx context.Context, cmd *cli.Command) error {
return err
}

// name
var deviceName string
// get devicename
if err := huh.NewInput().
Title("What is the name of this device?").
Value(&deviceName).
Value(&cliConfig.DeviceName).
WithTheme(util.Theme).
Run(); err != nil {
return err
}
fmt.Println("Device:", deviceName)

// remember device name for next time
if err := cliConfig.PersistIfNeeded(); err != nil {
return err
}
fmt.Println("Device:", cliConfig.DeviceName)

// request token
fmt.Println("Requesting verification token...")
token, err := authClient.GetVerificationToken(deviceName)
token, err := authClient.GetVerificationToken(cliConfig.DeviceName)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/lk/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var (
Commands: []*cli.Command{
{
Name: "add",
Usage: "Add a new project",
Usage: "Add a new project (for LiveKit Cloud projects, also see `lk cloud auth`)",
UsageText: "lk project add PROJECT_NAME",
ArgsUsage: "PROJECT_NAME",
Action: addProject,
Expand Down
1 change: 1 addition & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
type CLIConfig struct {
DefaultProject string `yaml:"default_project"`
Projects []ProjectConfig `yaml:"projects"`
DeviceName string `yaml:"device_name"`
// absent from YAML
hasPersisted bool
}
Expand Down
Loading