localvault 1.11.2 → 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 +4 -4
- data/lib/localvault/cli.rb +26 -15
- data/lib/localvault/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 57abcee5bdce8a863134e73333323eba61ed5d969f0675d2a0886f4c71f76a1d
|
|
4
|
+
data.tar.gz: 35114201fc535b678d90b50cc6b8876a6d589a2079750a1e2fd912fb7a32c903
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a3f24c9f87df7fbd9e6595c70899c234d439718eca08eeb5b0907a9642014f9f6c52cac651312cdf4abe32e26ab9be8a16c9def5230ddb5b08f953c5fd50c3f3
|
|
7
|
+
data.tar.gz: 927d395de3866fd187f0fbe676a518cbd26eea2f08813e6b746940b9e746794514419a22a94e1972d6068522caa313075159fb0a31df160f62237aebccb53734
|
data/lib/localvault/cli.rb
CHANGED
|
@@ -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
|
-
|
|
129
|
-
|
|
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
|
-
|
|
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 { |
|
|
161
|
+
rows.each { |usage, desc| shell.say " localvault #{usage.ljust(width)}#{desc}" }
|
|
151
162
|
end
|
|
152
163
|
|
|
153
164
|
shell.say ""
|
data/lib/localvault/version.rb
CHANGED