@@ -110,7 +110,7 @@ var (
110110 Before : createAgentClient ,
111111 Action : createAgentConfig ,
112112 Flags : []cli.Flag {
113- nameFlag (true ),
113+ nameFlag (false ),
114114 tomlFlag ,
115115 },
116116 ArgsUsage : "[working-dir]" ,
@@ -388,7 +388,7 @@ func createAgent(ctx context.Context, cmd *cli.Command) error {
388388 Secrets : secrets ,
389389 Replicas : int32 (agentConfig .Replicas ),
390390 MaxReplicas : int32 (agentConfig .MaxReplicas ),
391- CpuReq : agentConfig .CPU ,
391+ CpuReq : string ( agentConfig .CPU ) ,
392392 }
393393
394394 resp , err := agentsClient .CreateAgent (ctx , req )
@@ -455,8 +455,21 @@ func createAgentConfig(ctx context.Context, cmd *cli.Command) error {
455455 }
456456 }
457457
458+ name := cmd .String ("name" )
459+ if name == "" {
460+ if err := huh .NewInput ().
461+ Title ("Agent name" ).
462+ Value (& name ).
463+ WithTheme (util .Theme ).
464+ Run (); err != nil {
465+ return err
466+ } else if name == "" {
467+ return fmt .Errorf ("name is required" )
468+ }
469+ }
470+
458471 response , err := agentsClient .ListAgents (ctx , & lkproto.ListAgentsRequest {
459- AgentName : cmd . String ( " name" ) ,
472+ AgentName : name ,
460473 })
461474 if err != nil {
462475 if twerr , ok := err .(twirp.Error ); ok {
@@ -481,7 +494,7 @@ func createAgentConfig(ctx context.Context, cmd *cli.Command) error {
481494 agentConfig := & agentfs.AgentTOML {
482495 ProjectSubdomain : matches [1 ],
483496 Name : agent .AgentName ,
484- CPU : regionAgent .CpuReq ,
497+ CPU : agentfs . CPUString ( regionAgent .CpuReq ) ,
485498 Replicas : int (regionAgent .Replicas ),
486499 MaxReplicas : int (regionAgent .MaxReplicas ),
487500 }
@@ -518,7 +531,7 @@ func deployAgent(ctx context.Context, cmd *cli.Command) error {
518531 AgentName : agentConfig .Name ,
519532 Secrets : secrets ,
520533 Replicas : int32 (agentConfig .Replicas ),
521- CpuReq : agentConfig .CPU ,
534+ CpuReq : string ( agentConfig .CPU ) ,
522535 MaxReplicas : int32 (agentConfig .MaxReplicas ),
523536 }
524537
@@ -623,7 +636,7 @@ func updateAgent(ctx context.Context, cmd *cli.Command) error {
623636 req := & lkproto.UpdateAgentRequest {
624637 AgentName : agentConfig .Name ,
625638 Replicas : int32 (agentConfig .Replicas ),
626- CpuReq : agentConfig .CPU ,
639+ CpuReq : string ( agentConfig .CPU ) ,
627640 MaxReplicas : int32 (agentConfig .MaxReplicas ),
628641 }
629642
0 commit comments