Files
knox/internal/cmd/skills_health.go
T
david 0b8ac34aee chore: checkpoint uncommitted work before session store fix
Pre-existing work-in-progress in the tree: karakeep, snippets,
skills-health and redaction ingesters, the opencode.db session sweep,
gossip and metrics changes. Checkpointed as-is so the adapter fix in the
next commit stays reviewable on its own.
2026-11-01 13:48:09 -08:00

26 lines
583 B
Go

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
}