Class: Mcpeasy::CLI

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

Instance Method Summary collapse

Instance Method Details

#configObject



146
147
148
149
150
151
152
153
154
# File 'lib/mcpeasy/cli.rb', line 146

def config
  status = Config.config_status
  puts "📁 Config directory: #{status[:config_dir]}"
  puts "📄 Logs directory: #{status[:logs_dir]}"
  puts "🔑 Google credentials: #{status[:google_credentials] ? "" : ""}"
  puts "🎫 Google token: #{status[:google_token] ? "" : ""}"
  puts "💬 Slack config: #{status[:slack_config] ? "" : ""}"
  puts "📝 Notion config: #{status[:notion_config] ? "" : ""}"
end

#set_google_credentials(path) ⇒ Object



157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/mcpeasy/cli.rb', line 157

def set_google_credentials(path)
  unless File.exist?(path)
    puts "❌ File not found: #{path}"
    exit 1
  end

  begin
    credentials_json = File.read(path)
    JSON.parse(credentials_json) # Validate it's valid JSON
    Config.save_google_credentials(credentials_json)
    puts "✅ Google credentials saved successfully"
  rescue JSON::ParserError
    puts "❌ Invalid JSON file"
    exit 1
  rescue => e
    puts "❌ Error saving credentials: #{e.message}"
    exit 1
  end
end

#setupObject



140
141
142
143
# File 'lib/mcpeasy/cli.rb', line 140

def setup
  require_relative "setup"
  Setup.create_config_directories
end

#versionObject



134
135
136
137
# File 'lib/mcpeasy/cli.rb', line 134

def version
  puts "mcpeasy #{Mcpeasy::VERSION}"
  puts "mcpeasy, LM squeezy! 🤖"
end