task: task-1753636924-a1d4c708 - created
Change-Id: Ic78528c47ae38114b9b7504f1c4a76f95e93eb13
diff --git a/server/cmd/commands/stop_agent.go b/server/cmd/commands/stop_agent.go
new file mode 100644
index 0000000..e80d527
--- /dev/null
+++ b/server/cmd/commands/stop_agent.go
@@ -0,0 +1,31 @@
+package commands
+
+import (
+ "fmt"
+
+ "github.com/spf13/cobra"
+)
+
+var stopAgentCmd = &cobra.Command{
+ Use: "stop-agent [agent-name]",
+ Short: "Stop a running agent",
+ Long: `Stop a specific running agent.
+
+Examples:
+ staff stop-agent backend-engineer
+ staff stop-agent frontend-engineer`,
+ Args: cobra.ExactArgs(1),
+ RunE: runStopAgent,
+}
+
+func runStopAgent(cmd *cobra.Command, args []string) error {
+ agentName := args[0]
+
+ err := agentManager.StopAgent(agentName)
+ if err != nil {
+ return fmt.Errorf("failed to stop agent: %w", err)
+ }
+
+ fmt.Printf("Agent %s stopped successfully\n", agentName)
+ return nil
+}
\ No newline at end of file