Class: AgentEvalPlanner::CLI

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run(argv = ARGV) ⇒ Object



9
10
11
# File 'lib/agent_eval_planner/cli.rb', line 9

def self.run(argv = ARGV)
  new.run(argv)
end

Instance Method Details

#run(argv) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/agent_eval_planner/cli.rb', line 13

def run(argv)
  argv = argv.dup
  return run_validate(argv[1..]) if argv.first == "validate"

  options = default_options
  parser = build_option_parser(options)
  parser.parse!(argv)

  input = argv.first
  abort parser.help if input.nil?

  result = AgentEvalPlanner.generate(
    input_path: input,
    team: options[:team],
    agent_name: options[:agent_name],
    tools: options[:tools],
    declared_scope: options[:declared_scope],
    out_of_scope: options[:out_of_scope],
    harness: options[:harness]
  )

  write_outputs(result, options)
rescue Error => e
  warn "Erro: #{e.message}"
  exit 1
end