Class: Zanzibar::Cli

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/zanzibar/cli.rb

Overview

The ‘zanzibar` binary/thor application main class. See whatisthor.com/ for information on syntax.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCli

Initialize the application and set some logging defaults



23
24
25
26
27
28
29
30
31
# File 'lib/zanzibar/cli.rb', line 23

def initialize(*)
  super
  the_shell = (options['no-color'] ? Thor::Shell::Basic.new : shell)
  @ui = Shell.new(the_shell)
  @ui.be_quiet! if options['quiet']
  @ui.debug! if options['verbose']

  debug_header
end

Instance Attribute Details

#uiObject

The stream to which we are writing messages (usually stdout)



19
20
21
# File 'lib/zanzibar/cli.rb', line 19

def ui
  @ui
end

Instance Method Details

#bundleObject Also known as: plunder, install

Fetch secrets declared in a local Zanzifle



62
# File 'lib/zanzibar/cli.rb', line 62

desc 'bundle', "Fetch secrets declared in your #{ZANZIFILE_NAME}"

#get(scrt_id) ⇒ Object

Fetch a single secret specified on the commandline



103
104
105
# File 'lib/zanzibar/cli.rb', line 103

def get(scrt_id)
  run_action { get! scrt_id }
end

#initObject

Generate a new blank Zanzifile



42
# File 'lib/zanzibar/cli.rb', line 42

desc 'init', "Create an empty #{ZANZIFILE_NAME} in the current directory."

#updateObject

Redownload Zazifile secrets



79
# File 'lib/zanzibar/cli.rb', line 79

desc 'update', "Redownload all secrets in your #{ZANZIFILE_NAME}"

#versionObject

Print the version of the application



35
# File 'lib/zanzibar/cli.rb', line 35

desc 'version', 'Display your Zanzibar verion'