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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89b873121ec4642cd62fc4b8e7d18fb5bf4dd7f456d0b25b9690a154d3392d51
4
- data.tar.gz: 90915ed8508f056077cc64ed5c06e9d6925f9c893c70daaf71727fcf4c5d852c
3
+ metadata.gz: 9410cbaa6bef6d91974153c36555f7e8c799350adfa59ddf821ec261cb4dafc7
4
+ data.tar.gz: 9df3cc0ac84194f0f1259b12b411bfec083c3c690467741879f212046fc535c4
5
5
  SHA512:
6
- metadata.gz: dfcff8362dfd3ec7cbfa25fa4f8b0c599fe6584eedcea0c53f8e6515b028bfada2576cdcf7ef03e1ac130a083b4a869fbb5fe3ec282ab909a9a6f72a0affcdbb
7
- data.tar.gz: 85ba5c571866b4aa78ad40394d8ffcc3aedfaf6c8c9b5b1013042d1bc3e63ee5d9deb324e0fe8b52ddea8df7026cfa107d1e2b076b9cbf3e741d74d703d8f7aa
6
+ metadata.gz: ad55628d78a992ff835b090871ddf20331118d306c536db173c57109efe05886d90c874d5fdb74d850a5623e4fd0a5d56ca825b28ec84da1de72fb43a86905ad
7
+ data.tar.gz: 62960222621adc9edaf9d469f35a6a8868284f0b6a01f99b9a09ebadd3b32ac162a6838ad37f281cc8384f4ed5c2ca9b2d144b16a992ec6f7acfd2d91e62ae25
@@ -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 "New to InventList? Sign up free at https://inventlist.com"
472
- $stderr.puts "Docs: https://inventlist.com/sites/localvault/series/localvault"
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
 
@@ -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 "New to InventList? Sign up free at https://inventlist.com"
98
- $stderr.puts "Docs: https://inventlist.com/sites/localvault/series/localvault"
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
 
@@ -108,24 +108,51 @@ module LocalVault
108
108
 
109
109
  class_option :vault, aliases: "-v", type: :string, desc: "Vault name"
110
110
 
111
- # Main help = Thor's auto-generated command list (always complete, so new
112
- # commands appear without touching this file) + a handwritten guide for
113
- # the concepts and workflows Thor can't derive from command descriptions.
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
- shell.say ""
119
- super
120
- shell.say ""
121
- shell.say "GETTING STARTED"
122
- shell.say " localvault login [TOKEN] Log in to InventList (enables sync + team features)"
123
- shell.say " localvault init [NAME] Create a new encrypted vault"
124
- shell.say " localvault demo Create a demo vault to explore commands"
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 "TEAM SHARING (requires localvault login)"
140
- shell.say " Convert with `team init`, then `add @HANDLE` / `remove @HANDLE`."
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 InventList — validate token, auto-keygen, publish public key"
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 "Get your token at: https://inventlist.com/@YOUR_HANDLE/edit#developer"
780
- $stdout.puts "New to InventList? Sign up free at https://inventlist.com"
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 "LocalVault sync and team features require a free InventList account."
783
- $stdout.puts "Local vault encryption works without an account."
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 "Docs: https://inventlist.com/sites/localvault/series/localvault"
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 InventList profile."
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 cloud"
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. Check your token at: https://inventlist.com/@YOUR_HANDLE/edit#developer"
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
- $stdout.puts "Error connecting to InventList: #{e.message}"
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 "New to InventList? Sign up free at https://inventlist.com"
1147
- $stderr.puts "Docs: https://inventlist.com/sites/localvault/series/localvault"
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
 
@@ -1,3 +1,3 @@
1
1
  module LocalVault
2
- VERSION = "1.10.0"
2
+ VERSION = "1.11.1"
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.10.0
4
+ version: 1.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nauman Tariq