@@ -27,6 +27,75 @@ launchr login \
2727 --keyring-passphrase-file=/path/to/your/secret
2828```
2929
30+ To add a new key-value pair with an interactive shell:
31+ ``` shell
32+ launchr keyring:set your-key
33+ ```
34+
35+ It's possible to parse a user value and store it as a struct in a keyring. Supported formats are [ string, yaml, json] :
36+ ``` shell
37+ launchr keyring:set your-key value
38+ ```
39+
40+ It's possible to parse a user value and store it as a struct in a keyring. Possible formats are [ string, yaml, json] :
41+ ``` shell
42+ launchr keyring:set key --format yaml -- " - name: test-1
43+ - name: test-2"
44+ launchr keyring:set key --format yaml -- " $( cat file.yaml) "
45+ launchr keyring:set key --format json -- ' [
46+ {
47+ "name": "test-1"
48+ },
49+ {
50+ "name": "test-2"
51+ }
52+ ]'
53+ launchr keyring:set key --format json -- " $( cat file.json) "
54+ ```
55+
56+ You can dynamically build JSON\YAML wit structures and pass them directly to the command: ` jq `
57+ ``` shell
58+ # Define your variables
59+ TOKEN1=" abc123def456"
60+ NAME1=" production-api-key"
61+ CREATED1=" 2025-01-15T10:30:00Z"
62+
63+ TOKEN2=" xyz789uvw012"
64+ NAME2=" development-token"
65+ CREATED2=" 2025-01-15T11:45:00Z"
66+ EXPIRES2=" 2025-07-15T11:45:00Z"
67+
68+ launchr keyring:set api-tokens-json --format json -- " $( jq -n \
69+ --arg t1 " $TOKEN1 " --arg n1 " $NAME1 " --arg c1 " $CREATED1 " \
70+ --arg t2 " $TOKEN2 " --arg n2 " $NAME2 " --arg c2 " $CREATED2 " --arg e2 " $EXPIRES2 " \
71+ ' [
72+ {
73+ tokenhash: $t1,
74+ name: $n1,
75+ created: $c1,
76+ expires: null
77+ },
78+ {
79+ tokenhash: $t2,
80+ name: $n2,
81+ created: $c2,
82+ expires: $e2
83+ }
84+ ]' ) "
85+ ```
86+ ` yq ` using same variables:
87+ ``` shell
88+ launchr keyring:set api-tokens-yaml --format yaml -- " $( yq -n \
89+ ' .[0].tokenhash = env(TOKEN1) |
90+ .[0].name = env(NAME1) |
91+ .[0].created = env(CREATED1) |
92+ .[0].expires = null |
93+ .[1].tokenhash = env(TOKEN2) |
94+ .[1].name = env(NAME2) |
95+ .[1].created = env(CREATED2) |
96+ .[1].expires = env(EXPIRES2)' ) "
97+ ```
98+
3099Flags ` --keyring-passphrase ` and ` --keyring-passphrase-file ` are available for all launchr commands, for example:
31100``` shell
32101launchr compose --keyring-passphrase=YOURPASSHRPASE
0 commit comments