# frozen_string_literal: true require "thor" require 'tty-spinner' # TODO: make this like neetob module NeetoDeploy class CLI < Thor require_relative "cli/base" require_relative "cli/login/base" require_relative "cli/exec/base" require_relative "cli/logs/base" require_relative "cli/env/commands" require_relative "cli/redis/commands" require_relative "cli/pg/commands" require_relative "cli/addon/commands" require_relative "cli/autoscaling_config/commands" require_relative "cli/certificates/commands" def self.start(*) super end desc "login", "Login" def login CLI::Login::Base.new.process! end desc "env", "Manage environment variable" subcommand "env", Env::Commands desc "exec", "Exec into deployment" option :app, type: :string, aliases: "-a", required: true, desc: "App slug" def exec CLI::Exec::Base.new(options[:app]).process! end desc "logs", "Show logs" option :app, type: :string, aliases: "-a", required: true, desc: "App slug" option :process_type, type: :string, aliases: "-p", required: true, desc: "Process type" def logs CLI::Logs::Base.new(options[:app], options[:process_type]).process! end desc "redis", "Manage redis addons" subcommand "redis", Redis::Commands desc "pg", "Manage postgresql addons" subcommand "pg", Pg::Commands desc "addon", "Manage addons" subcommand "addon", Addon::Commands desc "autoscaling_config", "Manage autoscaling" subcommand "autoscaling_config", AutoscalingConfig::Commands desc "certificates", "Manage certificates" subcommand "certificates", Certificates::Commands end end