lib/stealth/cli.rb in stealth-0.10.4 vs lib/stealth/cli.rb in stealth-0.10.5
- old
+ new
@@ -2,13 +2,35 @@
# frozen_string_literal: true
require 'thor'
require 'stealth/cli_base'
require 'stealth/commands/console'
+require 'stealth/generators/builder'
+require 'stealth/generators/generate'
module Stealth
class Cli < Thor
extend CliBase
+
+ desc 'new', 'Creates a new Stealth bot'
+ long_desc <<-EOS
+ `stealth new <name>` creates a new Stealth both with the given name.
+
+ $ > stealth new new_bot
+ EOS
+ def new(name)
+ Stealth::Generators::Builder.start([name])
+ end
+
+ desc 'generate', 'Generates scaffold Stealth files'
+ long_desc <<-EOS
+ `stealth generate <generator> <name>` generates scaffold Stealth files
+
+ $ > stealth generate flow quote
+ EOS
+ def generate(generator, name)
+ Stealth::Generators::Generate.start([generator, name])
+ end
desc 'version', 'Prints stealth version'
long_desc <<-EOS
`stealth version` prints the version of the bundled stealth gem.
EOS