feat(kv)!: take KID:KEY pairs and key files as kv add arguments with optional --service and --vault

This commit is contained in:
imSp4rky
2026-12-04 23:19:52 -07:00
parent f10b8dcf99
commit deb4b7846d
4 changed files with 171 additions and 35 deletions
+5 -4
View File
@@ -188,12 +188,13 @@ The `kv` command group manages the contents of your configured vaults. Every sub
$ unshackle kv --help
```
### `kv add`: import keys from a file
### `kv add`: add content keys
Add `KID:KEY` pairs to one or more vaults for a given service. The file must contain one pair per line as `HEX:HEX` (32 hex characters each); lines that do not match are ignored.
Add `KID:KEY` pairs to your vaults, for a service or in the `generic` table. Give each pair on the command line, or give a file with one pair per line. The options are in the [CLI reference](cli-reference.md#kv-add-key).
```console
$ unshackle kv add keys.txt EXAMPLE local shared
$ unshackle kv add 9a04f07998404286ab92e65be0885f95:b1c2d3e4f5a6978012345678deadbeef
$ unshackle kv add keys.txt -s EXAMPLE -v local -v shared
```
```text title="keys.txt"
@@ -201,7 +202,7 @@ $ unshackle kv add keys.txt EXAMPLE local shared
0e7cc1a4e2f9411db0f24a3fbb8f8b21:00112233445566778899aabbccddeeff
```
The service argument (`EXAMPLE` above) is normalised to its canonical tag automatically. Keys that already exist in a vault are reported as skipped.
The service (`EXAMPLE` above) is normalised to its canonical tag automatically. Keys that already exist in a vault are reported as skipped. The other vaults still receive them.
If a vault answers and refuses the content keys, `kv add` shows one warning and continues with the next vault. If a vault is unreachable or still rate limited, `kv add` stops with an error.