1
0

完成一个简易的全局skill、command管理器

This commit is contained in:
2026-02-25 14:33:56 +08:00
parent f4cb809f9d
commit 2d327b5af8
60 changed files with 6053 additions and 1 deletions

View File

@@ -0,0 +1,43 @@
package main
import (
"fmt"
"github.com/spf13/cobra"
"skillmgr/internal/config"
)
var removeCmd = &cobra.Command{
Use: "remove <name>",
Short: "移除源仓库",
Long: `从配置中移除已添加的源仓库。
示例:
skillmgr remove my-skills`,
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
name := args[0]
// 检查仓库是否存在
repo, err := config.FindRepository(name)
if err != nil {
return err
}
if repo == nil {
fmt.Printf("仓库 '%s' 不存在\n", name)
return nil
}
if err := config.RemoveRepository(name); err != nil {
return err
}
fmt.Printf("✓ 仓库 '%s' 已移除\n", name)
return nil
},
}
func init() {
rootCmd.AddCommand(removeCmd)
}