Class: Yorishiro::CLI

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

Constant Summary collapse

COMPACT_THRESHOLD =

Fraction of the context budget at which auto-compaction kicks in.

0.8
API_KEY_ENV =

Env vars the /model command reads an API key from when switching to a different provider. Ollama needs none.

{ anthropic: "ANTHROPIC_API_KEY", open_ai: "OPENAI_API_KEY" }.freeze

Instance Method Summary collapse

Constructor Details

#initializeCLI

Returns a new instance of CLI.



15
16
17
18
19
20
# File 'lib/yorishiro/cli.rb', line 15

def initialize
  @conversation = nil
  @provider = nil
  @plan_mode = false
  @output = $stdout
end

Instance Method Details

#startObject



22
23
24
25
26
27
28
29
30
# File 'lib/yorishiro/cli.rb', line 22

def start
  parse_options!
  setup!
  print_welcome
  repl_loop
ensure
  @input_history&.save
  @mcp_manager&.stop_all
end