localvault 1.10.0 → 1.11.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/lib/localvault/cli/sync.rb +2 -2
- data/lib/localvault/cli/team.rb +2 -2
- data/lib/localvault/cli.rb +108 -37
- 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: 9410cbaa6bef6d91974153c36555f7e8c799350adfa59ddf821ec261cb4dafc7
|
|
4
|
+
data.tar.gz: 9df3cc0ac84194f0f1259b12b411bfec083c3c690467741879f212046fc535c4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ad55628d78a992ff835b090871ddf20331118d306c536db173c57109efe05886d90c874d5fdb74d850a5623e4fd0a5d56ca825b28ec84da1de72fb43a86905ad
|
|
7
|
+
data.tar.gz: 62960222621adc9edaf9d469f35a6a8868284f0b6a01f99b9a09ebadd3b32ac162a6838ad37f281cc8384f4ed5c2ca9b2d144b16a992ec6f7acfd2d91e62ae25
|
data/lib/localvault/cli/sync.rb
CHANGED
|
@@ -468,8 +468,8 @@ module LocalVault
|
|
|
468
468
|
$stderr.puts " localvault login YOUR_TOKEN"
|
|
469
469
|
$stderr.puts
|
|
470
470
|
$stderr.puts "Get your token at: https://inventlist.com/@YOUR_HANDLE/edit#developer"
|
|
471
|
-
$stderr.puts "
|
|
472
|
-
$stderr.puts "Docs: https://
|
|
471
|
+
$stderr.puts "Or use your own server: localvault config set server URL (free InventList account: https://inventlist.com)"
|
|
472
|
+
$stderr.puts "Docs: https://kuickr.co/localvault/series"
|
|
473
473
|
false
|
|
474
474
|
end
|
|
475
475
|
|
data/lib/localvault/cli/team.rb
CHANGED
|
@@ -94,8 +94,8 @@ module LocalVault
|
|
|
94
94
|
$stderr.puts " localvault login YOUR_TOKEN"
|
|
95
95
|
$stderr.puts
|
|
96
96
|
$stderr.puts "Get your token at: https://inventlist.com/@YOUR_HANDLE/edit#developer"
|
|
97
|
-
$stderr.puts "
|
|
98
|
-
$stderr.puts "Docs: https://
|
|
97
|
+
$stderr.puts "Or use your own server: localvault config set server URL (free InventList account: https://inventlist.com)"
|
|
98
|
+
$stderr.puts "Docs: https://kuickr.co/localvault/series"
|
|
99
99
|
return
|
|
100
100
|
end
|
|
101
101
|
|
data/lib/localvault/cli.rb
CHANGED
|
@@ -108,24 +108,51 @@ module LocalVault
|
|
|
108
108
|
|
|
109
109
|
class_option :vault, aliases: "-v", type: :string, desc: "Vault name"
|
|
110
110
|
|
|
111
|
-
#
|
|
112
|
-
#
|
|
113
|
-
#
|
|
111
|
+
# Grouped help, generated from the command registry. Only command NAMES
|
|
112
|
+
# are declared per section — usage strings and descriptions come from
|
|
113
|
+
# Thor, and any command missing from this map lands in OTHER instead of
|
|
114
|
+
# disappearing from help.
|
|
115
|
+
HELP_SECTIONS = [
|
|
116
|
+
["GETTING STARTED", %w[login config init demo]],
|
|
117
|
+
["SECRETS", %w[set get show groups list delete import env exec]],
|
|
118
|
+
["VAULT MANAGEMENT", %w[vaults switch rekey unlock lock reset rename copy]],
|
|
119
|
+
["SYNC (requires localvault login)", %w[sync]],
|
|
120
|
+
["TEAM SHARING (requires localvault login)", %w[dashboard verify add remove team]],
|
|
121
|
+
["KEYS (X25519 identity for vault sharing)", %w[keys identity]],
|
|
122
|
+
["AI / MCP", %w[install-mcp mcp guard]],
|
|
123
|
+
["LEGACY SHARING (pre-v1.2 direct share, still works)", %w[keygen share receive revoke]],
|
|
124
|
+
["OTHER", %w[logout version doctor help]]
|
|
125
|
+
].freeze
|
|
126
|
+
|
|
114
127
|
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
|
|
130
|
+
|
|
115
131
|
shell.say ""
|
|
116
132
|
shell.say "LocalVault — encrypted local secrets vault with MCP support for AI agents"
|
|
117
133
|
shell.say " https://inventlist.com/tools/localvault"
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
134
|
+
|
|
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
|
|
147
|
+
next if rows.empty?
|
|
148
|
+
shell.say ""
|
|
149
|
+
shell.say title
|
|
150
|
+
rows.each { |row| shell.say row }
|
|
151
|
+
end
|
|
152
|
+
|
|
125
153
|
shell.say ""
|
|
126
154
|
shell.say "SAFE SECRET INPUT (preferred over passing values as arguments)"
|
|
127
155
|
shell.say " printf '%s' \"$SECRET\" | localvault set KEY --stdin"
|
|
128
|
-
shell.say " Store a secret without argv/history exposure"
|
|
129
156
|
shell.say ""
|
|
130
157
|
shell.say "PROJECTS (dot-notation groups inside one vault)"
|
|
131
158
|
shell.say " localvault set platepose.API_KEY v Store a key in the 'platepose' group"
|
|
@@ -136,18 +163,8 @@ module LocalVault
|
|
|
136
163
|
shell.say " localvault exec -- inventlist ships list"
|
|
137
164
|
shell.say " localvault exec -- curl -H \"Authorization: Bearer $API_KEY\" ..."
|
|
138
165
|
shell.say ""
|
|
139
|
-
shell.say "
|
|
140
|
-
shell.say "
|
|
141
|
-
shell.say " Use --scope KEY... for partial access; `team rotate` re-keys for all members."
|
|
142
|
-
shell.say " `team add/remove/verify` also work as aliases for the top-level commands."
|
|
143
|
-
shell.say ""
|
|
144
|
-
shell.say "AI / MCP"
|
|
145
|
-
shell.say " Agents: list secret names, then use localvault_build_exec for safe injection."
|
|
146
|
-
shell.say " `guard install` blocks plaintext secrets in agent commands (Claude Code hooks)."
|
|
147
|
-
shell.say ""
|
|
148
|
-
shell.say "LEGACY SHARING (pre-v1.2 direct share, still works as fallback)"
|
|
149
|
-
shell.say " keygen / share / receive / revoke — superseded by `keys` + team vaults."
|
|
150
|
-
shell.say ""
|
|
166
|
+
shell.say "Own sync host: localvault config set server URL (default: inventlist.com)"
|
|
167
|
+
shell.say "Subcommands: localvault help team|keys|guard|identity|sync"
|
|
151
168
|
shell.say "Full help for any command: localvault help COMMAND"
|
|
152
169
|
shell.say ""
|
|
153
170
|
end
|
|
@@ -760,13 +777,16 @@ module LocalVault
|
|
|
760
777
|
$stdout.puts "Public key: #{Identity.public_key}"
|
|
761
778
|
end
|
|
762
779
|
|
|
763
|
-
desc "login [TOKEN]", "Log in to
|
|
780
|
+
desc "login [TOKEN]", "Log in to a sync server — validate token, auto-keygen, publish public key"
|
|
764
781
|
method_option :status, type: :boolean, default: false, desc: "Show current login status"
|
|
782
|
+
method_option :server, type: :string, desc: "Sync server URL (persisted; defaults to https://inventlist.com)"
|
|
765
783
|
def login(token = nil)
|
|
784
|
+
Config.api_url = options[:server] if options[:server]
|
|
785
|
+
|
|
766
786
|
if options[:status]
|
|
767
787
|
handle = Config.inventlist_handle
|
|
768
788
|
if handle
|
|
769
|
-
$stdout.puts "Logged in as @#{handle}"
|
|
789
|
+
$stdout.puts "Logged in as @#{handle} (server: #{Config.api_url})"
|
|
770
790
|
else
|
|
771
791
|
$stdout.puts "Not logged in. Run: localvault login TOKEN"
|
|
772
792
|
end
|
|
@@ -776,13 +796,26 @@ module LocalVault
|
|
|
776
796
|
unless token
|
|
777
797
|
$stdout.puts "Usage: localvault login YOUR_TOKEN"
|
|
778
798
|
$stdout.puts
|
|
779
|
-
$stdout.puts "
|
|
780
|
-
$stdout.puts "
|
|
799
|
+
$stdout.puts "Local vault encryption works without any account or server."
|
|
800
|
+
$stdout.puts "Sync and team features need a sync server. LocalVault is server-agnostic —"
|
|
801
|
+
$stdout.puts "pick either:"
|
|
781
802
|
$stdout.puts
|
|
782
|
-
$stdout.puts "
|
|
783
|
-
$stdout.puts "
|
|
803
|
+
$stdout.puts " 1. Your own host (any server implementing the 4-endpoint protocol):"
|
|
804
|
+
$stdout.puts " localvault config set server https://vaulthost.example"
|
|
805
|
+
$stdout.puts " localvault login YOUR_TOKEN"
|
|
806
|
+
$stdout.puts " (or one-shot: localvault login YOUR_TOKEN --server https://vaulthost.example)"
|
|
784
807
|
$stdout.puts
|
|
785
|
-
$stdout.puts "
|
|
808
|
+
$stdout.puts " 2. InventList (free account):"
|
|
809
|
+
$stdout.puts " Sign up at https://inventlist.com, then get your token at"
|
|
810
|
+
$stdout.puts " https://inventlist.com/@YOUR_HANDLE/edit#developer"
|
|
811
|
+
$stdout.puts
|
|
812
|
+
$stdout.puts "Login generates your X25519 keypair and publishes the public key"
|
|
813
|
+
$stdout.puts "automatically. To do it manually:"
|
|
814
|
+
$stdout.puts " localvault keys generate # create keypair in ~/.localvault/keys/"
|
|
815
|
+
$stdout.puts " localvault keys publish # upload public key so others can share with you"
|
|
816
|
+
$stdout.puts " localvault keys show # print your public key"
|
|
817
|
+
$stdout.puts
|
|
818
|
+
$stdout.puts "Docs: https://kuickr.co/localvault/series"
|
|
786
819
|
return
|
|
787
820
|
end
|
|
788
821
|
|
|
@@ -798,15 +831,53 @@ module LocalVault
|
|
|
798
831
|
|
|
799
832
|
client.publish_public_key(Identity.public_key)
|
|
800
833
|
|
|
801
|
-
$stdout.puts "Logged in as @#{handle}"
|
|
802
|
-
$stdout.puts "Public key published to your
|
|
834
|
+
$stdout.puts "Logged in as @#{handle} (server: #{Config.api_url})"
|
|
835
|
+
$stdout.puts "Public key published to your profile."
|
|
803
836
|
$stdout.puts
|
|
804
|
-
$stdout.puts "Next: localvault sync push # sync your vault to the
|
|
837
|
+
$stdout.puts "Next: localvault sync push # sync your vault to the server"
|
|
805
838
|
rescue ApiClient::ApiError => e
|
|
806
839
|
if e.status == 401
|
|
807
|
-
$stdout.puts "Invalid token
|
|
840
|
+
$stdout.puts "Invalid token for #{Config.api_url}."
|
|
841
|
+
$stdout.puts "InventList tokens: https://inventlist.com/@YOUR_HANDLE/edit#developer"
|
|
842
|
+
else
|
|
843
|
+
$stdout.puts "Error connecting to #{Config.api_url}: #{e.message}"
|
|
844
|
+
end
|
|
845
|
+
end
|
|
846
|
+
|
|
847
|
+
desc "config SUBCOMMAND ...", "Get or set CLI configuration (currently: server)"
|
|
848
|
+
long_desc <<~DESC
|
|
849
|
+
Read or write LocalVault configuration in ~/.localvault/config.yml.
|
|
850
|
+
|
|
851
|
+
LocalVault is server-agnostic — point it at any host implementing the
|
|
852
|
+
sync protocol:
|
|
853
|
+
|
|
854
|
+
\x05 localvault config get server
|
|
855
|
+
\x05 localvault config set server https://vaulthost.example
|
|
856
|
+
\x05 localvault config unset server # back to https://inventlist.com
|
|
857
|
+
DESC
|
|
858
|
+
def config(action = "get", field = nil, value = nil)
|
|
859
|
+
unless field == "server" || (action == "get" && field.nil?)
|
|
860
|
+
return abort_with "Unknown config field '#{field}'. Supported: server"
|
|
861
|
+
end
|
|
862
|
+
|
|
863
|
+
case action
|
|
864
|
+
when "get"
|
|
865
|
+
$stdout.puts "server: #{Config.api_url}"
|
|
866
|
+
when "set"
|
|
867
|
+
return abort_with "Usage: localvault config set server URL" unless value
|
|
868
|
+
unless value.match?(%r{\Ahttps?://\S+\z})
|
|
869
|
+
return abort_with "Server must be an http(s) URL, e.g. https://vaulthost.example"
|
|
870
|
+
end
|
|
871
|
+
Config.api_url = value
|
|
872
|
+
$stdout.puts "server set to #{value}"
|
|
873
|
+
$stdout.puts "Note: tokens are per-server — run `localvault login YOUR_TOKEN` for this host."
|
|
874
|
+
when "unset"
|
|
875
|
+
data = Config.load
|
|
876
|
+
data.delete("api_url")
|
|
877
|
+
Config.save(data)
|
|
878
|
+
$stdout.puts "server reset to #{Config.api_url}"
|
|
808
879
|
else
|
|
809
|
-
|
|
880
|
+
abort_with "Usage: localvault config [get|set|unset] server [URL]"
|
|
810
881
|
end
|
|
811
882
|
end
|
|
812
883
|
|
|
@@ -1143,8 +1214,8 @@ module LocalVault
|
|
|
1143
1214
|
$stderr.puts " localvault login YOUR_TOKEN"
|
|
1144
1215
|
$stderr.puts
|
|
1145
1216
|
$stderr.puts "Get your token at: https://inventlist.com/@YOUR_HANDLE/edit#developer"
|
|
1146
|
-
$stderr.puts "
|
|
1147
|
-
$stderr.puts "Docs: https://
|
|
1217
|
+
$stderr.puts "Or use your own server: localvault config set server URL (free InventList account: https://inventlist.com)"
|
|
1218
|
+
$stderr.puts "Docs: https://kuickr.co/localvault/series"
|
|
1148
1219
|
return
|
|
1149
1220
|
end
|
|
1150
1221
|
|
data/lib/localvault/version.rb
CHANGED