55 "fmt"
66 "os"
77
8- "github.com/nauticalab/devenv-engine/internal/manager"
8+ "github.com/nauticalab/devenv-engine/internal/manager/auth"
9+ "github.com/nauticalab/devenv-engine/internal/manager/client"
910 "github.com/spf13/cobra"
1011)
1112
@@ -20,13 +21,24 @@ var authListCmd = &cobra.Command{
2021 Short : "List current authentication information" ,
2122 Long : `Display the current authentication information, including the authenticated user and their developer identity.` ,
2223 Run : func (cmd * cobra.Command , args []string ) {
24+ // Load configuration
25+ config , err := LoadCLIConfig ()
26+ if err != nil {
27+ fmt .Fprintf (os .Stderr , "Error loading config: %v\n " , err )
28+ os .Exit (1 )
29+ }
30+
31+ if config .ManagerURL == "" {
32+ fmt .Fprintf (os .Stderr , "Error: manager URL is required. Set DEVEN_MANAGER_URL env var or configure in ~/.devenv/config.yaml\n " )
33+ os .Exit (1 )
34+ }
35+
2336 // Create manager client
24- client := manager .NewClient (manager.ClientConfig {
25- BaseURL : os .Getenv ("DEVEN_MANAGER_URL" ),
26- })
37+ authProvider := auth .NewK8sSAProvider (nil , "" , "" , "" )
38+ c := client .NewClient (config .ManagerURL , authProvider )
2739
2840 // Get identity
29- whoami , err := client .WhoAmI (context .Background ())
41+ whoami , err := c .WhoAmI (context .Background ())
3042 if err != nil {
3143 fmt .Printf ("Error getting authentication info: %v\n " , err )
3244 os .Exit (1 )
@@ -42,9 +54,6 @@ var authListCmd = &cobra.Command{
4254}
4355
4456func init () {
45- // Add auth command to root
46- rootCmd .AddCommand (authCmd )
47-
4857 // Add subcommands
4958 authCmd .AddCommand (authListCmd )
5059}
0 commit comments