Class: Soka::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/soka/install/install_generator.rb

Overview

Generator for installing Soka Rails configuration

Instance Method Summary collapse

Instance Method Details

#add_soka_directoryObject



23
24
25
26
27
# File 'lib/generators/soka/install/install_generator.rb', line 23

def add_soka_directory
  empty_directory 'app/soka'
  empty_directory 'app/soka/agents'
  empty_directory 'app/soka/tools'
end

#create_application_agentObject



15
16
17
# File 'lib/generators/soka/install/install_generator.rb', line 15

def create_application_agent
  template 'application_agent.rb', 'app/soka/agents/application_agent.rb'
end

#create_application_toolObject



19
20
21
# File 'lib/generators/soka/install/install_generator.rb', line 19

def create_application_tool
  template 'application_tool.rb', 'app/soka/tools/application_tool.rb'
end

#create_initializerObject



11
12
13
# File 'lib/generators/soka/install/install_generator.rb', line 11

def create_initializer
  template 'soka.rb', 'config/initializers/soka.rb'
end

#display_post_install_messageObject



29
30
31
32
33
34
35
36
# File 'lib/generators/soka/install/install_generator.rb', line 29

def display_post_install_message
  say "\nSoka Rails has been successfully installed!", :green
  say "\nNext steps:"
  say '  1. Set your AI provider API key: GEMINI_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY'
  say '  2. Create your first agent: rails generate soka:agent MyAgent'
  say '  3. Create your first tool: rails generate soka:tool MyTool'
  say "\nFor more information, visit: https://github.com/jiunjiun/soka-rails"
end