Class: RubynCode::CLI::DaemonRunner
- Inherits:
-
Object
- Object
- RubynCode::CLI::DaemonRunner
- Defined in:
- lib/rubyn_code/cli/daemon_runner.rb
Overview
Boots all dependencies and starts the GOLEM daemon from the CLI. Handles authentication, database setup, and lifecycle output.
Usage:
rubyn-code daemon --name golem-1 --max-runs 50 --max-cost 5.0
Instance Method Summary collapse
-
#initialize(options) ⇒ DaemonRunner
constructor
A new instance of DaemonRunner.
- #run ⇒ Object
Constructor Details
#initialize(options) ⇒ DaemonRunner
Returns a new instance of DaemonRunner.
13 14 15 16 17 18 |
# File 'lib/rubyn_code/cli/daemon_runner.rb', line 13 def initialize() @options = @daemon_opts = .fetch(:daemon, {}) @renderer = Renderer.new @project_root = Dir.pwd end |
Instance Method Details
#run ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rubyn_code/cli/daemon_runner.rb', line 20 def run bootstrap! daemon = build_daemon daemon.start! display_shutdown_summary(daemon) rescue Interrupt @renderer.info("\nShutting down daemon...") display_shutdown_summary(daemon) if daemon rescue StandardError => e @renderer.error("Daemon failed: #{e.}") RubynCode::Debug.warn(e.backtrace&.first(5)&.join("\n")) if @options[:debug] exit(1) ensure disconnect_mcp_clients! end |