0b8ac34aee
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.
26 lines
583 B
Go
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
|
|
}
|