package cmd import ( "fmt" "github.com/david/knox/internal/skillsrepo" "github.com/spf13/cobra" ) // NewSkillsHealthCmd checks the skills git repo (~/.skills) health. func NewSkillsHealthCmd() *cobra.Command { cmd := &cobra.Command{ Use: "skills-health", Short: "Check the skills git repo (~/.skills) health: HEAD, fsck, ahead/behind, disk", RunE: func(c *cobra.Command, args []string) error { h := skillsrepo.Default() fmt.Print(formatSkillsHealth(h)) if !h.Healthy() { return fmt.Errorf("skills repo unhealthy") } return nil }, } return cmd }