localvault 1.11.1 → 1.11.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9410cbaa6bef6d91974153c36555f7e8c799350adfa59ddf821ec261cb4dafc7
4
- data.tar.gz: 9df3cc0ac84194f0f1259b12b411bfec083c3c690467741879f212046fc535c4
3
+ metadata.gz: 57abcee5bdce8a863134e73333323eba61ed5d969f0675d2a0886f4c71f76a1d
4
+ data.tar.gz: 35114201fc535b678d90b50cc6b8876a6d589a2079750a1e2fd912fb7a32c903
5
5
  SHA512:
6
- metadata.gz: ad55628d78a992ff835b090871ddf20331118d306c536db173c57109efe05886d90c874d5fdb74d850a5623e4fd0a5d56ca825b28ec84da1de72fb43a86905ad
7
- data.tar.gz: 62960222621adc9edaf9d469f35a6a8868284f0b6a01f99b9a09ebadd3b32ac162a6838ad37f281cc8384f4ed5c2ca9b2d144b16a992ec6f7acfd2d91e62ae25
6
+ metadata.gz: a3f24c9f87df7fbd9e6595c70899c234d439718eca08eeb5b0907a9642014f9f6c52cac651312cdf4abe32e26ab9be8a16c9def5230ddb5b08f953c5fd50c3f3
7
+ data.tar.gz: 927d395de3866fd187f0fbe676a518cbd26eea2f08813e6b746940b9e746794514419a22a94e1972d6068522caa313075159fb0a31df160f62237aebccb53734
data/README.md CHANGED
@@ -19,7 +19,7 @@ brew install inventlist/tap/localvault
19
19
  ### Install script (no Homebrew)
20
20
 
21
21
  ```bash
22
- curl -sSL https://raw.githubusercontent.com/inventlist/localvault/main/install.sh | sh
22
+ curl -sSL https://inventlist.com/tools/localvault/install.sh | sh
23
23
  ```
24
24
 
25
25
  Installs into an isolated prefix (`~/.localvault/runtime`) and writes a wrapper
@@ -32,7 +32,11 @@ module LocalVault
32
32
  end
33
33
 
34
34
  passphrase = prompt_passphrase("Passphrase for '#{vault_name}': ")
35
- return nil if passphrase.nil? || passphrase.empty?
35
+ if passphrase.nil? || passphrase.empty?
36
+ $stderr.puts "Error: Vault '#{vault_name}' is locked and no passphrase was entered."
37
+ $stderr.puts "Run: localvault unlock #{vault_name} # caches the passphrase for this session"
38
+ return nil
39
+ end
36
40
 
37
41
  vault = Vault.open(name: vault_name, passphrase: passphrase)
38
42
  vault.all # raises Crypto::DecryptionError on wrong passphrase
@@ -124,30 +124,41 @@ module LocalVault
124
124
  ["OTHER", %w[logout version doctor help]]
125
125
  ].freeze
126
126
 
127
+ # One row per plain command; registered subcommands (sync, team, keys,
128
+ # guard, identity, ...) expand to a row per action, straight from that
129
+ # registry — so `sync push` or a newly added `guard` action is always
130
+ # visible without touching this method.
131
+ def self.help_rows_for(name)
132
+ command = all_commands[name.tr("-", "_")]
133
+ return [] if command.nil? || command.hidden?
134
+
135
+ registry = subcommand_classes[command.name]
136
+ return [[command.usage, command.description]] unless registry
137
+
138
+ registry.all_commands.filter_map do |sub_name, sub|
139
+ next if sub.hidden? || %w[help tree].include?(sub_name) # Thor built-ins, redundant per-namespace
140
+ ["#{command.name} #{sub.usage}", sub.description]
141
+ end
142
+ end
143
+
127
144
  def self.help(shell, subcommand = false)
128
- visible = all_commands.reject { |_, c| c.hidden? }
129
- width = visible.values.map { |c| c.usage.length }.max + 4
145
+ sections = HELP_SECTIONS.map { |title, names| [title, names.dup] }
146
+ known = HELP_SECTIONS.flat_map { |_, names| names.map { |n| n.tr("-", "_") } }
147
+ leftovers = all_commands.reject { |_, c| c.hidden? }.keys - known
148
+ sections.last[1].concat(leftovers.map { |n| n.tr("_", "-") })
149
+
150
+ rendered = sections.map { |title, names| [title, names.flat_map { |n| help_rows_for(n) }] }
151
+ width = rendered.flat_map { |_, rows| rows.map { |usage, _| usage.length } }.max + 4
130
152
 
131
153
  shell.say ""
132
154
  shell.say "LocalVault — encrypted local secrets vault with MCP support for AI agents"
133
155
  shell.say " https://inventlist.com/tools/localvault"
134
156
 
135
- listed = []
136
- sections = HELP_SECTIONS.map { |title, names| [title, names.dup] }
137
- leftovers = visible.keys - HELP_SECTIONS.flat_map { |_, names| names.map { |n| n.tr("-", "_") } }
138
- sections.last[1].concat(leftovers.map { |n| n.tr("_", "-") })
139
-
140
- sections.each do |title, names|
141
- rows = names.filter_map do |name|
142
- command = visible[name.tr("-", "_")]
143
- next unless command
144
- listed << name
145
- " localvault #{command.usage.ljust(width)}#{command.description}"
146
- end
157
+ rendered.each do |title, rows|
147
158
  next if rows.empty?
148
159
  shell.say ""
149
160
  shell.say title
150
- rows.each { |row| shell.say row }
161
+ rows.each { |usage, desc| shell.say " localvault #{usage.ljust(width)}#{desc}" }
151
162
  end
152
163
 
153
164
  shell.say ""
@@ -1,3 +1,3 @@
1
1
  module LocalVault
2
- VERSION = "1.11.1"
2
+ VERSION = "1.11.3"
3
3
  end
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.11.1
4
+ version: 1.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nauman Tariq