Class: Vaultez::CLI
- Inherits:
-
Thor
- Object
- Thor
- Vaultez::CLI
- Defined in:
- lib/vaultez/cli.rb
Instance Method Summary collapse
- #__version ⇒ Object
- #config ⇒ Object
- #fetch ⇒ Object
- #help(command = nil, subcommand: false) ⇒ Object
-
#initialize(*args) ⇒ CLI
constructor
A new instance of CLI.
- #login ⇒ Object
- #logout ⇒ Object
Constructor Details
#initialize(*args) ⇒ CLI
Returns a new instance of CLI.
18 19 20 21 |
# File 'lib/vaultez/cli.rb', line 18 def initialize(*args) super ENV["VAULTEZ_TOKEN"] = [:token] if [:token] end |
Instance Method Details
#__version ⇒ Object
85 86 87 |
# File 'lib/vaultez/cli.rb', line 85 def __version puts "vaultez-cli #{Vaultez::VERSION}" end |
#config ⇒ Object
82 |
# File 'lib/vaultez/cli.rb', line 82 def config; super; end |
#fetch ⇒ Object
72 |
# File 'lib/vaultez/cli.rb', line 72 def fetch; super; end |
#help(command = nil, subcommand: false) ⇒ Object
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/vaultez/cli.rb', line 89 def help(command = nil, subcommand: false) if command super else puts "Vaultez CLI — secure secret management from your terminal" puts puts "Usage: vaultez <command> [options]" puts puts "Commands:" puts " login Authenticate with email, password, and 2FA code" puts " logout Revoke the current session token" puts " fetch Fetch secrets from a project" puts " config Set default company or token" puts " help Show help for any command" puts puts "Options:" puts " --token Use a project token instead of the saved session" puts " --version Show the installed CLI version" puts puts "Examples:" puts " vaultez login" puts " vaultez fetch --project=\"Backend\"" puts " vaultez fetch --project=\"Backend\" --secret=\"DATABASE_URL\"" puts " vaultez fetch --token=\"vz_...\"" puts " vaultez fetch --token=\"vz_...\" --secret=\"DATABASE_URL\"" end end |
#login ⇒ Object
34 |
# File 'lib/vaultez/cli.rb', line 34 def login; super; end |
#logout ⇒ Object
43 |
# File 'lib/vaultez/cli.rb', line 43 def logout; super; end |