mirror of
https://github.com/hanzoai/agent.git
synced 2026-09-11 21:08:51 +00:00
Consolidate all Hanzo agent infrastructure into one repo: - control-plane/: Go control plane server (was agents-new) - sdk/: Go, Python, TypeScript SDKs - deployments/: Docker, Kubernetes, Helm configs - Dockerfile.sdk: Python SDK image (ghcr.io/hanzoai/agent:latest) - CI builds both SDK + control-plane images No more agentfield — everything is hanzoai/agent.
55 lines
1.3 KiB
Go
55 lines
1.3 KiB
Go
package cli
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/hanzoai/agents/control-plane/internal/packages"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var (
|
|
uninstallForce bool
|
|
)
|
|
|
|
// NewUninstallCommand creates the uninstall command
|
|
func NewUninstallCommand() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "uninstall <package-name>",
|
|
Short: "Uninstall an agent node package",
|
|
Long: `Uninstall removes an installed agent node package from your system.
|
|
|
|
This command will:
|
|
- Stop the agent node if it's currently running
|
|
- Remove the package directory and all its files
|
|
- Remove the package from the installation registry
|
|
- Clean up any associated logs
|
|
|
|
Examples:
|
|
hanzo-agents uninstall my-agent
|
|
hanzo-agents uninstall sentiment-analyzer --force`,
|
|
Args: cobra.ExactArgs(1),
|
|
RunE: runUninstallCommand,
|
|
}
|
|
|
|
cmd.Flags().BoolVarP(&uninstallForce, "force", "f", false, "Force uninstall even if agent node is running")
|
|
|
|
return cmd
|
|
}
|
|
|
|
func runUninstallCommand(cmd *cobra.Command, args []string) error {
|
|
packageName := args[0]
|
|
|
|
// Create uninstaller
|
|
uninstaller := &packages.PackageUninstaller{
|
|
HanzoAgentsHome: getHanzoAgentsHomeDir(),
|
|
Force: uninstallForce,
|
|
}
|
|
|
|
// Uninstall package
|
|
if err := uninstaller.UninstallPackage(packageName); err != nil {
|
|
return fmt.Errorf("uninstallation failed: %w", err)
|
|
}
|
|
|
|
return nil
|
|
}
|