blob: 4f4b39ab3d2033eb0d8c8a9ebeb661937bb1a1b1 [file] [log] [blame]
user5a7d60d2025-07-27 21:22:04 +04001package commands
2
3import (
4 "fmt"
5
6 "github.com/spf13/cobra"
7)
8
9var stopAgentCmd = &cobra.Command{
10 Use: "stop-agent [agent-name]",
11 Short: "Stop a running agent",
12 Long: `Stop a specific running agent.
13
14Examples:
15 staff stop-agent backend-engineer
16 staff stop-agent frontend-engineer`,
17 Args: cobra.ExactArgs(1),
18 RunE: runStopAgent,
19}
20
21func runStopAgent(cmd *cobra.Command, args []string) error {
22 agentName := args[0]
23
24 err := agentManager.StopAgent(agentName)
25 if err != nil {
26 return fmt.Errorf("failed to stop agent: %w", err)
27 }
28
29 fmt.Printf("Agent %s stopped successfully\n", agentName)
30 return nil
iomodo50598c62025-07-27 22:06:32 +040031}