You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-4Lines changed: 22 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -247,17 +247,35 @@ pago can store and retrieve structured data in the [TOML](https://toml.io/) form
247
247
This is useful for storing multiple related values in a single entry, such as API keys, usernames, and URLs.
248
248
249
249
To create a TOML entry, use `pago add --multiline` and provide TOML content on standard input.
250
+
The content must start with the string `# TOML`.
250
251
251
252
```shell
252
253
pago add -m services/my-api <<EOF
254
+
# TOML
253
255
user = "jdoe"
254
-
key = "abc-123"
256
+
password = "abcdef"
257
+
token = "tok-123"
255
258
url = "https://api.example.com"
256
259
numbers = [1, 1, 2, 3, 5]
257
260
EOF
258
261
```
259
262
260
-
You can then retrieve individual values from the TOML entry using the `-k`/`--key` option with the commands `show`, `clip`, and `pick`, or with the `key` command.
263
+
When you `show` or `clip` a TOML entry without specifying a key, pago will use a default key.
264
+
The default key is `password`.
265
+
You can specify a different default key by adding a key `default` to the TOML entry.
266
+
267
+
```shell
268
+
pago add -m services/my-api-custom-default <<EOF
269
+
# TOML
270
+
default = "api-key"
271
+
api-key = "xyz-456"
272
+
EOF
273
+
274
+
pago show services/my-api-custom-default
275
+
# => xyz-456
276
+
```
277
+
278
+
You can retrieve other values from the TOML entry using the `-k`/`--key` option with the commands `show`, `clip`, and `pick`, or with the `key` command.
261
279
262
280
```shell
263
281
# Show the user from the TOML entry.
@@ -280,15 +298,15 @@ When an entry is parsed as TOML, pago can retrieve scalar values (strings, numbe
280
298
Arrays and scalars other than strings are encoded as TOML for output.
281
299
pago cannot retrieve tables.
282
300
283
-
If you show or clip a TOML entry without `--key`, the entire TOML document is returned.
284
-
285
301
### TOTP
286
302
287
303
pago can generate [time-based one-time passwords (TOTP)](https://en.wikipedia.org/wiki/Time-based_one-time_password) from a [TOML entry](#toml-entries).
288
304
To use this feature, store the `otpauth://` URI in a key named `otp`.
0 commit comments