Class: Chatwerk::Cli
- Inherits:
-
Thor
- Object
- Thor
- Chatwerk::Cli
- Defined in:
- lib/chatwerk/cli.rb
Overview
CLI interface for Chatwerk using Thor
Class Method Summary collapse
Instance Method Summary collapse
- #inspect(working_directory = nil) ⇒ Object
- #mcp ⇒ Object
- #package(package_path) ⇒ Object
- #package_todos(package_path, constant_name = nil) ⇒ Object
- #package_violations(package_path, constant_name = nil) ⇒ Object
- #packages(package_path = nil) ⇒ Object
- #print_env ⇒ Object
- #version ⇒ Object
Class Method Details
.exit_on_failure? ⇒ Boolean
55 56 57 |
# File 'lib/chatwerk/cli.rb', line 55 def self.exit_on_failure? true end |
Instance Method Details
#inspect(working_directory = nil) ⇒ Object
19 20 21 22 |
# File 'lib/chatwerk/cli.rb', line 19 def inspect(working_directory = nil) pwd = working_directory || Dir.pwd system("npx @modelcontextprotocol/inspector -e PWD=#{pwd} bundle exec exe/chatwerk mcp") end |
#mcp ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/chatwerk/cli.rb', line 10 def mcp require_relative 'mcp' require 'mcp/transports/stdio' server = Chatwerk::Mcp.server transport = MCP::Transports::StdioTransport.new(server) transport.open end |
#package(package_path) ⇒ Object
35 36 37 |
# File 'lib/chatwerk/cli.rb', line 35 def package(package_path) puts Api.package(package_path:) end |
#package_todos(package_path, constant_name = nil) ⇒ Object
40 41 42 |
# File 'lib/chatwerk/cli.rb', line 40 def package_todos(package_path, constant_name = nil) puts Api.package_todos(package_path:, constant_name:) end |
#package_violations(package_path, constant_name = nil) ⇒ Object
45 46 47 |
# File 'lib/chatwerk/cli.rb', line 45 def package_violations(package_path, constant_name = nil) puts Api.package_violations(package_path:, constant_name:) end |
#packages(package_path = nil) ⇒ Object
30 31 32 |
# File 'lib/chatwerk/cli.rb', line 30 def packages(package_path = nil) puts Api.packages(package_path:) end |