Class: LLMExperiment::CLI::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/llm_experiment/cli.rb

Overview

Base class for commands. Subclasses set NAME and SUMMARY, implement #run(argv), and optionally #add_options(parser).

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(container: nil) ⇒ Command

Returns a new instance of Command.



62
63
64
65
66
# File 'lib/llm_experiment/cli.rb', line 62

def initialize(container: nil)
  @container = container
  @experiment_dir = nil
  @help_shown = false
end

Class Method Details

.summaryObject



60
# File 'lib/llm_experiment/cli.rb', line 60

def self.summary = self::SUMMARY

Instance Method Details

#call(argv) ⇒ Object



68
69
70
71
72
73
# File 'lib/llm_experiment/cli.rb', line 68

def call(argv)
  parser.parse!(argv)
  return if @help_shown

  run(argv)
end

#run(_argv) ⇒ Object

Raises:

  • (NotImplementedError)


75
76
77
# File 'lib/llm_experiment/cli.rb', line 75

def run(_argv)
  raise NotImplementedError
end