Class: Rubino::CLI::SkillsCommand

Inherits:
Thor
  • Object
show all
Defined in:
lib/rubino/cli/skills_command.rb

Overview

Subcommands for managing skills (#188). ‘list` mirrors the in-chat /skills disclosure (enabled/disabled markers), `show` prints a skill’s SKILL.md body (trust review before enabling), and ‘enable`/`disable` run the SAME registry-validated StateRepository write the HTTP API toggle and the in-chat `/skills enable|disable` use (Skills::Toggle) —no new logic, just the missing terminal surface.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/rubino/cli/skills_command.rb', line 17

def self.exit_on_failure?
  true
end

Instance Method Details

#disable(name) ⇒ Object



55
56
57
# File 'lib/rubino/cli/skills_command.rb', line 55

def disable(name)
  toggle(name, enabled: false)
end

#enable(name) ⇒ Object



50
51
52
# File 'lib/rubino/cli/skills_command.rb', line 50

def enable(name)
  toggle(name, enabled: true)
end

#listObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/rubino/cli/skills_command.rb', line 22

def list
  Rubino.ensure_database_ready!
  registry = Skills::Registry.trusted
  skills = registry.all
  if skills.empty?
    Rubino.ui.info("No skills found.")
    Rubino.ui.info("Add .md files to .rubino/skills/ to create skills.")
    return
  end

  rows = skills.map do |skill|
    [skill.name, skill_status(skill.name, registry), skill.description.to_s]
  end
  Rubino.ui.table(headers: %w[Name Status Description], rows: rows)
end

#show(name) ⇒ Object



39
40
41
42
43
44
45
46
47
# File 'lib/rubino/cli/skills_command.rb', line 39

def show(name)
  skill = Skills::Registry.trusted.find(name)
  if skill.nil?
    Rubino.ui.error("unknown skill: #{name}")
    return
  end

  Rubino.ui.info(skill.content)
end