Class: Sylvia::CLI

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

Class Method Summary collapse

Class Method Details

.start(args) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/sylvia/cli.rb', line 12

def self.start(args)
  command = args.shift

  case command
  when 'llm'
    LLM.setup
  when 'ai'
    LLM.run
  when 'prettier'
    Prettier.setup
  when 'rubocop'
    RuboCop.setup
  when 'rubocop-todo'
    RuboCop.generate_todo
  when 'rubocop-rails'
    RuboCopRails.setup
  when 'rubocop-rails-todo'
    RuboCopRails.generate_todo
  when 'jekyll'
    target = args.shift || 'jekyll-app'
    Jekyll.new_project(target)
  when 'bot'
    target = args.shift || 'bot-app'
    Bot.new_project(target)
  when '-v', '--version'
    puts "Sylvia version #{Sylvia::VERSION}"
  else
    puts 'Usage:'
    puts '  sylvia llm           # Create setup file llm'
    puts '  sylvia ai            # Run llm'
    puts '  sylvia prettier      # Setup Prettier for Ruby'
    puts '  sylvia rubocop       # Create .rubocop.yml config file'
    puts '  sylvia rubocop-todo  # Generate .rubocop_todo.yml automatically'
    puts '  sylvia rubocop-rails       # Create .rubocop.yml config file for Rails'
    puts '  sylvia rubocop-rails-todo  # Generate .rubocop_todo.yml automatically'
    puts '  sylvia jekyll [name-app]  # Create Jekyll boilerplate project'
    puts '  sylvia bot [name-app]     # Create Discord & Telegram bot boilerplate project'
    puts '  sylvia -v, --version # Show Sylvia version'
  end
end