Skip to content

Commit 156e44a

Browse files
committed
refactor(pilotctl): gate task/gateway/set-tags/clear-tags/enable-tasks/disable-tasks behind extras
Direct invocation now exits with a clear hint pointing to 'pilotctl extras <cmd>'. All commands remain reachable via the extras prefix. Core CLI surface is reduced to agent-facing operations only.
1 parent 2364372 commit 156e44a

1 file changed

Lines changed: 36 additions & 3 deletions

File tree

cmd/pilotctl/main.go

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,9 @@ Diagnostic commands:
439439
440440
Agent tool discovery:
441441
pilotctl context
442+
pilotctl skills [status] show where the daemon installs SKILL.md per detected agent tool
443+
pilotctl skills paths print only the install paths (shell-friendly)
444+
pilotctl skills check run one reconcile pass right now
442445
443446
Gateway (requires root for ports <1024):
444447
pilotctl gateway start [--subnet <cidr>] [--ports <list>] [<pilot-addr>...]
@@ -478,6 +481,7 @@ func main() {
478481

479482
cmd := args[0]
480483
cmdArgs := args[1:]
484+
extrasOnly := false
481485

482486
dispatch:
483487
switch cmd {
@@ -487,6 +491,7 @@ dispatch:
487491
cmdExtrasHelp()
488492
return
489493
}
494+
extrasOnly = true
490495
cmd = cmdArgs[0]
491496
cmdArgs = cmdArgs[1:]
492497
goto dispatch
@@ -499,6 +504,10 @@ dispatch:
499504
cmdUpdates(cmdArgs)
500505
return
501506

507+
case "skills":
508+
cmdSkills(cmdArgs)
509+
return
510+
502511
// Bootstrap
503512
case "init":
504513
cmdInit(cmdArgs)
@@ -527,11 +536,16 @@ dispatch:
527536
"unknown daemon subcommand: %s", cmdArgs[0])
528537
}
529538

530-
// Gateway
539+
// Gateway (extras-only — use 'pilotctl extras gateway' or pilot-gateway binary)
531540
case "gateway":
541+
if !extrasOnly {
542+
fatalHint("invalid_argument",
543+
"use 'pilotctl extras gateway <subcommand>' or the pilot-gateway binary",
544+
"gateway commands are not in the core CLI")
545+
}
532546
if len(cmdArgs) < 1 {
533547
fatalHint("invalid_argument",
534-
"available: pilotctl gateway start | stop | map | unmap | list",
548+
"available: start, stop, map, unmap, list",
535549
"missing subcommand")
536550
}
537551
switch cmdArgs[0] {
@@ -573,12 +587,24 @@ dispatch:
573587
case "clear-hostname":
574588
cmdClearHostname()
575589
case "set-tags":
590+
if !extrasOnly {
591+
fatalHint("invalid_argument", "use 'pilotctl extras set-tags'", "set-tags is not in the core CLI")
592+
}
576593
cmdSetTags(cmdArgs)
577594
case "clear-tags":
595+
if !extrasOnly {
596+
fatalHint("invalid_argument", "use 'pilotctl extras clear-tags'", "clear-tags is not in the core CLI")
597+
}
578598
cmdClearTags()
579599
case "enable-tasks":
600+
if !extrasOnly {
601+
fatalHint("invalid_argument", "use 'pilotctl extras enable-tasks'", "enable-tasks is not in the core CLI")
602+
}
580603
cmdEnableTasks()
581604
case "disable-tasks":
605+
if !extrasOnly {
606+
fatalHint("invalid_argument", "use 'pilotctl extras disable-tasks'", "disable-tasks is not in the core CLI")
607+
}
582608
cmdDisableTasks()
583609
case "set-webhook":
584610
cmdSetWebhook(cmdArgs)
@@ -599,9 +625,14 @@ dispatch:
599625
case "send-message":
600626
cmdSendMessage(cmdArgs)
601627
case "task":
628+
if !extrasOnly {
629+
fatalHint("invalid_argument",
630+
"use 'pilotctl extras task <subcommand>'",
631+
"task commands are not in the core CLI")
632+
}
602633
if len(cmdArgs) < 1 {
603634
fatalHint("invalid_argument",
604-
"available: pilotctl task submit | accept | decline | execute | send-results | result | list | queue",
635+
"available: submit, accept, decline, execute, send-results, result, list, queue",
605636
"missing subcommand")
606637
}
607638
switch cmdArgs[0] {
@@ -4034,6 +4065,8 @@ func cmdInfo(args []string) {
40344065
fmt.Printf(" Traffic: %s sent / %s recv\n", formatBytes(bytesSent), formatBytes(bytesRecv))
40354066
fmt.Printf(" Packets: %d sent / %d recv\n", pktsSent, pktsRecv)
40364067

4068+
printSkillInstallSummary()
4069+
40374070
connList, ok := info["conn_list"].([]interface{})
40384071
if ok && len(connList) > 0 {
40394072
maxDisplay := 50

0 commit comments

Comments
 (0)