Class: OllamaAgent::CLI::SkillCommand

Inherits:
Thor
  • Object
show all
Defined in:
lib/ollama_agent/cli/skill_command.rb

Overview

Thor subcommand for running deterministic, JSON-contract skills. Examples:

ollama_agent skill list
ollama_agent skill run architecture_refactor --code-file path/to/file.rb
ollama_agent skill pipeline architecture_refactor performance_optimizer --code-file f.rb

Instance Method Summary collapse

Instance Method Details

#listObject



18
19
20
21
22
23
# File 'lib/ollama_agent/cli/skill_command.rb', line 18

def list
  names = Skills.registry.names
  return puts "No skills registered." if names.empty?

  names.each { |name| puts name }
end

#pipeline(*names) ⇒ Object

Raises:

  • (Thor::Error)


40
41
42
43
44
# File 'lib/ollama_agent/cli/skill_command.rb', line 40

def pipeline(*names)
  raise Thor::Error, "specify at least one skill name" if names.empty?

  emit_json(Skills::Runner.new(names.map(&:to_sym), llm: build_llm).call(skill_input))
end

#run_skill(name) ⇒ Object



30
31
32
# File 'lib/ollama_agent/cli/skill_command.rb', line 30

def run_skill(name)
  emit_json(Skills.registry.fetch(name).new(llm: build_llm).call(skill_input))
end