Class: Chatwerk::Cli

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

Overview

CLI interface for Chatwerk using Thor

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (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

#mcpObject



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


25
26
27
# File 'lib/chatwerk/cli.rb', line 25

def print_env
  puts Api.print_env
end

#versionObject



50
51
52
# File 'lib/chatwerk/cli.rb', line 50

def version
  puts "Chatwerk #{Chatwerk::VERSION}"
end