localvault 1.11.3 → 1.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/lv +13 -0
- data/lib/localvault/cli/sync.rb +4 -2
- data/lib/localvault/cli.rb +40 -13
- data/lib/localvault/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5c37fd43d64105bf78e7501e458c98159958c4a6eca101d6716a3781b6bbb61f
|
|
4
|
+
data.tar.gz: 9f869cee27f7c118f91acf009d85cb0cef9204d9a99ada99b59939c63f7c2b22
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e503618d966e392d38a84969dae01d5355fcbccef921bad3f738a33b17139c71782e880f375756d865f1457b2c3fe23faf1175d65700caab1e5a3c1a5220e52d
|
|
7
|
+
data.tar.gz: 12bbf4acd6091c45afda3489035977e88169cce34e0313f51c8f75d8d35df71379fa6799af4e1d8e6ad252dc69971f3c41d09ee65c8aaf72ec83b9b748b54cc1
|
data/bin/lv
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
# Support both development (require_relative) and installed (load path) usage
|
|
4
|
+
begin
|
|
5
|
+
require_relative "../lib/localvault"
|
|
6
|
+
require_relative "../lib/localvault/cli"
|
|
7
|
+
rescue LoadError
|
|
8
|
+
require "localvault"
|
|
9
|
+
require "localvault/cli"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
status = LocalVault::CLI.start(ARGV)
|
|
13
|
+
exit(status) if status.is_a?(Integer) && !status.zero?
|
data/lib/localvault/cli/sync.rb
CHANGED
|
@@ -111,18 +111,20 @@ module LocalVault
|
|
|
111
111
|
default_task :all
|
|
112
112
|
|
|
113
113
|
desc "push [NAME]", "Push a vault to InventList cloud sync"
|
|
114
|
+
method_option :vault, type: :string, aliases: "-v", desc: "Vault name (same as NAME)"
|
|
114
115
|
def push(vault_name = nil)
|
|
115
116
|
return unless logged_in?
|
|
116
|
-
vault_name ||= Config.default_vault
|
|
117
|
+
vault_name ||= options[:vault] || Config.default_vault
|
|
117
118
|
client = ApiClient.new(token: Config.token)
|
|
118
119
|
perform_push(vault_name, client)
|
|
119
120
|
end
|
|
120
121
|
|
|
121
122
|
desc "pull [NAME]", "Pull a vault from InventList cloud sync"
|
|
122
123
|
method_option :force, type: :boolean, default: false, desc: "Overwrite existing local vault"
|
|
124
|
+
method_option :vault, type: :string, aliases: "-v", desc: "Vault name (same as NAME)"
|
|
123
125
|
def pull(vault_name = nil)
|
|
124
126
|
return unless logged_in?
|
|
125
|
-
vault_name ||= Config.default_vault
|
|
127
|
+
vault_name ||= options[:vault] || Config.default_vault
|
|
126
128
|
client = ApiClient.new(token: Config.token)
|
|
127
129
|
perform_pull(vault_name, client, force: options[:force])
|
|
128
130
|
end
|
data/lib/localvault/cli.rb
CHANGED
|
@@ -150,27 +150,31 @@ module LocalVault
|
|
|
150
150
|
rendered = sections.map { |title, names| [title, names.flat_map { |n| help_rows_for(n) }] }
|
|
151
151
|
width = rendered.flat_map { |_, rows| rows.map { |usage, _| usage.length } }.max + 4
|
|
152
152
|
|
|
153
|
+
say_header = ->(text) { shell.say shell.set_color(text, :cyan, true) }
|
|
154
|
+
|
|
153
155
|
shell.say ""
|
|
154
|
-
shell.say "LocalVault — encrypted local secrets vault with MCP support for AI agents"
|
|
156
|
+
shell.say shell.set_color("LocalVault", :cyan, true) + " — encrypted local secrets vault with MCP support for AI agents"
|
|
155
157
|
shell.say " https://inventlist.com/tools/localvault"
|
|
156
158
|
|
|
157
159
|
rendered.each do |title, rows|
|
|
158
160
|
next if rows.empty?
|
|
159
161
|
shell.say ""
|
|
160
|
-
|
|
161
|
-
rows.each
|
|
162
|
+
say_header.call(title)
|
|
163
|
+
rows.each do |usage, desc|
|
|
164
|
+
shell.say " localvault #{shell.set_color(usage.ljust(width), :green)}#{desc}"
|
|
165
|
+
end
|
|
162
166
|
end
|
|
163
167
|
|
|
164
168
|
shell.say ""
|
|
165
|
-
|
|
169
|
+
say_header.call("SAFE SECRET INPUT (preferred over passing values as arguments)")
|
|
166
170
|
shell.say " printf '%s' \"$SECRET\" | localvault set KEY --stdin"
|
|
167
171
|
shell.say ""
|
|
168
|
-
|
|
172
|
+
say_header.call("PROJECTS (dot-notation groups inside one vault)")
|
|
169
173
|
shell.say " localvault set platepose.API_KEY v Store a key in the 'platepose' group"
|
|
170
174
|
shell.say " Filter any command with -p: show -p platepose, exec -p platepose -- CMD"
|
|
171
175
|
shell.say " Delete a whole group: localvault delete 'platepose.*'"
|
|
172
176
|
shell.say ""
|
|
173
|
-
|
|
177
|
+
say_header.call("USING SECRETS WITH ANY CLI")
|
|
174
178
|
shell.say " localvault exec -- inventlist ships list"
|
|
175
179
|
shell.say " localvault exec -- curl -H \"Authorization: Bearer $API_KEY\" ..."
|
|
176
180
|
shell.say ""
|
|
@@ -316,15 +320,38 @@ module LocalVault
|
|
|
316
320
|
vault.list.each { |key| $stdout.puts key }
|
|
317
321
|
end
|
|
318
322
|
|
|
319
|
-
desc "groups [QUERY]", "List or search
|
|
323
|
+
desc "groups [QUERY]", "List or search secret groups / projects without revealing values"
|
|
320
324
|
long_desc <<~DESC
|
|
321
|
-
Discover
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
325
|
+
Discover the groups in a vault. "Group" and "project" are the same
|
|
326
|
+
thing: a named bucket of keys inside one vault. You never create one
|
|
327
|
+
explicitly — storing a key in it creates it, deleting its last key
|
|
328
|
+
removes it.
|
|
329
|
+
|
|
330
|
+
CREATE by storing keys into a group (three equivalent spellings):
|
|
331
|
+
\x05 localvault set kuickr.API_KEY abc123 # dot-notation
|
|
332
|
+
\x05 localvault set --group kuickr API_KEY abc123
|
|
333
|
+
\x05 localvault set -g kuickr API_KEY abc123
|
|
334
|
+
|
|
335
|
+
LIST groups (names and key counts only — values stay hidden):
|
|
336
|
+
\x05 localvault groups # all groups in the default vault
|
|
337
|
+
\x05 localvault groups stock # only groups matching "stock"
|
|
338
|
+
\x05 localvault groups -v intellectaco # groups in another vault
|
|
339
|
+
|
|
340
|
+
WORK WITH one group (any command takes -p / --project):
|
|
341
|
+
\x05 localvault show -p kuickr # see its keys (masked)
|
|
342
|
+
\x05 localvault list -p kuickr # just the key names
|
|
343
|
+
\x05 localvault exec -p kuickr -- rails s # inject only its keys as env vars
|
|
344
|
+
\x05 localvault env -p kuickr # export only its keys
|
|
345
|
+
\x05 localvault import .env -p kuickr # import a .env file into the group
|
|
346
|
+
|
|
347
|
+
DELETE one key or the whole group:
|
|
348
|
+
\x05 localvault delete kuickr.API_KEY
|
|
349
|
+
\x05 localvault delete 'kuickr.*'
|
|
350
|
+
|
|
351
|
+
`localvault projects` is an alias for this command.
|
|
327
352
|
DESC
|
|
353
|
+
map "projects" => "groups"
|
|
354
|
+
|
|
328
355
|
def groups(query = nil)
|
|
329
356
|
vault = open_vault!
|
|
330
357
|
matches = GroupCatalog.new(vault.all).search(query)
|
data/lib/localvault/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: localvault
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.12.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nauman Tariq
|
|
@@ -99,12 +99,14 @@ email:
|
|
|
99
99
|
- nauman@intellecta.co
|
|
100
100
|
executables:
|
|
101
101
|
- localvault
|
|
102
|
+
- lv
|
|
102
103
|
extensions: []
|
|
103
104
|
extra_rdoc_files: []
|
|
104
105
|
files:
|
|
105
106
|
- LICENSE
|
|
106
107
|
- README.md
|
|
107
108
|
- bin/localvault
|
|
109
|
+
- bin/lv
|
|
108
110
|
- lib/localvault.rb
|
|
109
111
|
- lib/localvault/api_client.rb
|
|
110
112
|
- lib/localvault/cli.rb
|