Class: OllamaAgent::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/ollama_agent/cli.rb,
lib/ollama_agent/cli/repl.rb,
lib/ollama_agent/cli/tui_repl.rb,
lib/ollama_agent/cli/repl_shared.rb,
lib/ollama_agent/cli/skill_command.rb,
lib/ollama_agent/cli/health_command.rb

Overview

Thor CLI for single-shot and interactive agent sessions. rubocop:disable Metrics/ClassLength – Thor commands and shared helpers

Defined Under Namespace

Modules: ReplShared Classes: KernelHealthCommand, Repl, SkillCommand, TuiRepl

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/ollama_agent/cli.rb', line 18

def self.exit_on_failure?
  true
end

Instance Method Details

#agentsObject



119
120
121
122
# File 'lib/ollama_agent/cli.rb', line 119

def agents
  reg = ExternalAgents::Registry.load
  ExternalAgents::Probe.print_table(reg)
end

#ask(query = nil) ⇒ Object



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

def ask(query = nil)
  load_plugins!
  apply_session_interactive_tui_flags!(query)
  validate_tui_options!
  run_ask!(query)
end

#doctorObject



125
126
127
# File 'lib/ollama_agent/cli.rb', line 125

def doctor
  agents
end

#improveObject



201
202
203
204
# File 'lib/ollama_agent/cli.rb', line 201

def improve
  ensure_improve_mode_only_automated!
  dispatch_self_review_mode("automated")
end

#orchestrate(query = nil) ⇒ Object



98
99
100
101
102
103
# File 'lib/ollama_agent/cli.rb', line 98

def orchestrate(query = nil)
  load_plugins!
  apply_session_interactive_tui_flags!(query)
  validate_tui_options!
  run_orchestrate!(query)
end

#self_reviewObject



168
169
170
# File 'lib/ollama_agent/cli.rb', line 168

def self_review
  dispatch_self_review_mode(SelfImprovement::Modes.normalize(options[:mode]))
end

#sessionsObject



107
108
109
110
111
112
113
114
115
116
# File 'lib/ollama_agent/cli.rb', line 107

def sessions
  root = resolved_root_for_self_review
  list = Session::Store.list(root: root)
  if list.empty?
    puts "No sessions found in #{root}"
    return
  end
  puts "SESSION ID                      STARTED"
  list.each { |s| puts format("%-30<id>s  %<started>s", id: s.session_id, started: s.started_at) }
end