package cmd import ( "flag" "fmt" "git.noodles.cam/claude-skills/marketplace/cli/internal/config" "git.noodles.cam/claude-skills/marketplace/cli/internal/issue" "git.noodles.cam/claude-skills/marketplace/cli/internal/project" ) func init() { register(&Command{ Name: "config", Group: GroupProject, Short: "show what this project resolved to", Long: `Every path and every setting, with the overrides already applied, so a run that went somewhere unexpected can be explained without guessing. The token is never printed — only whether one was found. This is the command to reach for when the store looks empty, when a push says 401, or when two directories disagree about which project they are in.`, Examples: []Example{ {"kettle config", "resolved paths and settings"}, }, Setup: func(fs *flag.FlagSet) func([]string) error { return func(args []string) error { root := project.Root("") if root == "" { return project.NotFoundError("") } fmt.Printf("project %s\n", root) fmt.Printf("store %s\n", issue.Root("")) fmt.Printf("payload %s\n", project.PayloadRoot("")) fmt.Printf("config %s\n", config.ProjectPath("")) fmt.Printf("logins %s\n", config.LoginsPath()) r, err := config.Resolve("") if err != nil { fmt.Println() return err } red := r.Redacted() fmt.Println() fmt.Printf("login %s\n", orNone(red.Login)) fmt.Printf("url %s\n", orNone(red.URL)) fmt.Printf("token %s\n", orNone(red.Token)) if r.Owner != "" { fmt.Printf("repo %s\n", r.Slug()) } else { fmt.Printf("repo none\n") } return nil } }, }) }