KWALLETCLI(1)

πŸ‘‘ kwalletcli β€” the manual, bestie edition πŸ’…

okay so this is the kwalletcli page from section 1 of the General Commands Manual. it's your girl's guide to talking to KWallet from the command line, no GUI nonsense required. let's get into it. 🫢


✨ NAME ✨

kwalletcli β€” a command line interface to the KDE Wallet. yes queen, terminal access to your secrets. πŸ”


🌸 SYNOPSIS 🌸

kwalletcli [-q] -f folder -e entry [-P | -p password]

like, that's the whole vibe. two shapes. pick one. πŸ’–


πŸ’– DESCRIPTION πŸ’–

so kwalletcli is a command line interface to KWallet. but β€” and this is the important part β€” it will only work if KDE is running (DCOP) and reachable (via X11). no KDE, no dice. 😭

what does it actually do? two things: get password entries out of the default Wallet, or write them in there. iconic behaviour honestly. 🌈

The options are as follows:

  • -e entry β€” define the key (entry) to use when accessing the Wallet. Mandatory. you literally cannot skip this one bestie.
  • -f folder β€” set the folder to use when accessing the Wallet. Mandatory. also not optional. two mandatory flags, we love a strict queen. πŸ’…
  • -h β€” display the usage. help me help you. πŸŽ€
  • -P β€” read the password to write from standard input. currently limited to 65535 octets. that's the ceiling, don't fight it.
  • -p password β€” write password into the designated location in the Wallet.
  • -q β€” be more quiet. in combination with -V, do not display anything. silence is golden. 🀫
  • -V β€” display the kwalletcli version information.

Default mode of operation, that is, unless -P or -p are used, is to read the password from the default Wallet and print it to standard output as-is, without any trailing newline. yes, as-is. no little newline garnish. ✨

There is currently no way to specify a Wallet other than the default. just the default. that's the only one on the menu, babe. πŸ“

All input and output is assumed to be in UTF-8. The password string (whether read from standard input or command line) is now converted from β€œpossibly UTF-8 but binary transparent” to standards-conformant UTF-8 for the Qt side, and back upon reading out. so it does the little translation dance both ways. πŸ’ƒ


πŸ”₯ RETURN VALUES πŸ”₯

The kwalletcli utility exits 0 on success or >0 if an error occurred:

  • 1 β€” The entry specified cannot be found (read access).
  • 2 β€” The usage was shown.
  • 3 β€” The Wallet could not be opened. May be a missing DCOP connection. Perhaps DISPLAY is not set.
  • 4 β€” The folder specified cannot be found (read access).
  • 5 β€” The folder specified cannot be opened.
  • 6 β€” The value to the key specified could not be retrieved.
  • 8 β€” An error occurred trying to write the value.

now listen carefully, because this part actually matters: the exit codes 1 and 4, on reading, are not fatal β€” they merely indicate that the folder or entry specified does not exist. no big deal, just a lil "that's not here" moment. πŸ™ˆ

The other errors are fatal and may be used to indicate the user that the KWallet should not be used any more during the current session. like, game over for this session, pack it up. πŸ’€


πŸ¦‹ ENVIRONMENT πŸ¦‹

  • DISPLAY β€” The X11 display to use for communicating with the KDE Wallet.

🌟 EXAMPLES 🌟

The following command...

$ printf '%s\n' "secret" | kwalletcli -f passwords -e sitename -P

...stores the password β€œsecret” as passwords\sitename inside the default Wallet. slay. πŸ’…

To read it out, use:

$ password=$(kwalletcli -f passwords -e sitename)

and boom, it's in your variable. no newline, remember. πŸŽ€


πŸ‘€ SEE ALSO πŸ‘€

go read that one too, bestie. iykyk. πŸ’œ


🫢 AUTHORS 🫢

kwalletcli was written by mirabilos <m@mirbsd.org> mostly for tarent solutions GmbH. shoutout to the author, absolute legend. πŸ‘‘


🚨 CAVEATS 🚨

Do not use -p password to store it, unless you absolutely must. It is a security risk, because the command line invocation is public information in a normal Unix environment. Use -P instead and provide the password on standard input. this is not a drill, bestie, everybody and their group chat can see your process list. 😭

Beware of trailing newlines, especially outside of mksh(1) scripts! those sneaky little \ns will ruin your whole day, fr fr. πŸ“


πŸ’€ BUGS πŸ’€

If DISPLAY is not set, not valid, or kdeinit or kdeinit4 cannot start for other reasons, kwalletcli may not recover gracefully. in KDE 4 versions, this may even result in a Segmentation fault. πŸ’₯

The author does not know of a way to catch this early; patches are welcome. so if you've got the fix, the door is open, main character energy only. πŸ”₯


okay that's the whole page, you ate it, periodt. πŸ’– this one came from the Debian crew and it's dated November 19, 2020 β€” so yeah, a lil vintage but still serving. go forth and wallet responsibly. βœ¨πŸŽ€πŸ’…

πŸ“¦ where this page comes from