This commit is contained in:
lpf
2026-02-14 11:33:06 +08:00
parent e6f1989faf
commit 64f84678cb

View File

@@ -115,7 +115,9 @@ func main() {
case "agent":
agentCmd()
case "gateway":
maybePromptAndEscalateRoot("gateway")
if shouldPromptGatewayRoot(os.Args) {
maybePromptAndEscalateRoot("gateway")
}
gatewayCmd()
case "status":
statusCmd()
@@ -906,6 +908,11 @@ func maybePromptAndEscalateRoot(command string) {
os.Exit(0)
}
func shouldPromptGatewayRoot(args []string) bool {
// Only prompt on plain `clawgo gateway` registration flow.
return len(args) == 2 && args[1] == "gateway"
}
func isInteractiveStdin() bool {
info, err := os.Stdin.Stat()
if err != nil {