MCPcopy Create free account
hub / github.com/diillson/chatcli / Unpin

Method Unpin

cli/skill_handler.go:1239–1256  ·  view source on GitHub ↗

Unpin removes a skill from the pinned set. No-op (with a friendly notice) when the skill wasn't pinned to begin with.

(name string)

Source from the content-addressed store, hash-verified

1237// Unpin removes a skill from the pinned set. No-op (with a friendly notice)
1238// when the skill wasn't pinned to begin with.
1239func (sh *SkillHandler) Unpin(name string) {
1240 sh.pinnedSkillsMu.Lock()
1241 _, was := sh.pinnedSkillNames[name]
1242 if was {
1243 delete(sh.pinnedSkillNames, name)
1244 }
1245 sh.pinnedSkillsMu.Unlock()
1246
1247 if !was {
1248 fmt.Printf("\n %s %s\n\n", colorize(i18n.T("skill.unpin.not_pinned"), ColorGray), colorize(name, ColorCyan))
1249 return
1250 }
1251
1252 sh.logger.Info("skill unpinned", zap.String("skill", name))
1253 fmt.Printf("\n %s %s\n\n",
1254 colorize(i18n.T("skill.unpin.success"), ColorGreen),
1255 colorize(name, ColorCyan))
1256}
1257
1258// ShowPinned lists all currently pinned skills for the session.
1259func (sh *SkillHandler) ShowPinned() {

Callers 3

HandleCommandMethod · 0.95

Calls 6

TFunction · 0.92
colorizeFunction · 0.85
LockMethod · 0.80
UnlockMethod · 0.80
InfoMethod · 0.65
StringMethod · 0.45

Tested by 2