Class: Aidp::CLI::ModelsCommand

Inherits:
Object
  • Object
show all
Includes:
MessageDisplay
Defined in:
lib/aidp/cli/models_command.rb

Overview

Command handler for ‘aidp models` subcommand group

Provides commands for viewing AI models from the RubyLLM registry:

- list: Show all available models with tier information
- discover: Discover models from RubyLLM registry for a provider
- validate: Validate model configuration

Usage:

aidp models list [--provider=<name>] [--tier=<tier>]
aidp models discover [--provider=<name>]
aidp models validate

Constant Summary

Constants included from MessageDisplay

MessageDisplay::COLOR_MAP

Instance Method Summary collapse

Methods included from MessageDisplay

#display_message, included, #message_display_prompt

Constructor Details

#initialize(prompt: TTY::Prompt.new, registry: nil, ruby_llm_registry: nil) ⇒ ModelsCommand

Returns a new instance of ModelsCommand.



25
26
27
28
29
# File 'lib/aidp/cli/models_command.rb', line 25

def initialize(prompt: TTY::Prompt.new, registry: nil, ruby_llm_registry: nil)
  @prompt = prompt
  @registry = registry
  @ruby_llm_registry = ruby_llm_registry
end

Instance Method Details

#run(args) ⇒ Object

Main entry point for models subcommand



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/aidp/cli/models_command.rb', line 32

def run(args)
  subcommand = args.first if args.first && !args.first.start_with?("--")

  case subcommand
  when "list", nil
    args.shift if subcommand == "list"
    run_list_command(args)
  when "discover"
    args.shift
    run_discover_command(args)
  when "validate"
    args.shift
    run_validate_command(args)
  else
    display_message("Unknown models subcommand: #{subcommand}", type: :error)
    display_help
    1
  end
end