Class: Coatepec::CLI
- Inherits:
-
Object
- Object
- Coatepec::CLI
- Defined in:
- lib/coatepec/cli.rb
Overview
Entry point for the coatepec executable: parses --root/--debug/
--version/--help, then runs the MCP server over stdio.
Class Method Summary collapse
Class Method Details
.parse(argv) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/coatepec/cli.rb', line 18 def self.parse(argv) = { root: nil, debug: false } remaining = argv.dup while (arg = remaining.shift) apply_flag!(, arg, remaining) end end |
.run(argv) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/coatepec/cli.rb', line 7 def self.run(argv) = parse(argv) project = Coatepec::Project.new([:root] || Dir.pwd) worker_manager = Coatepec::WorkerManager.new(project) server = Coatepec::MCP.build_server(project: project, worker_manager: worker_manager) ::MCP::Server::Transports::StdioTransport.new(server).open rescue Coatepec::Error => e warn "coatepec: #{e.code}: #{e.}" exit 1 end |