---
name: "kwalletcli"
section: "1"
platform: "linux"
package: "kwalletcli"
version: "3.03-1+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/kwalletcli"
---

# kwalletcli(1)

command line interface to the KDE Wallet

## NAME

**kwalletcli** – command line interface to the KDE Wallet

## SYNOPSIS

**kwalletcli** \[**Nq**\] **NhV**

**kwalletcli** \[**Nq**\] **Nf** *folder* **Ne** *entry* \[**NP** \| **Np** *password*\]

## DESCRIPTION

The **kwalletcli** utility is a command line interface to KWallet. It will only work if KDE is running (DCOP) and reachable (via X11). **kwalletcli** can be used to get password entries from the default Wallet, or to write them there.

The options are as follows:

- **-e** *entry*

  Define the key (*entry*) to use when accessing the Wallet. Mandatory.

- **-f** *folder*

  Set the *folder* to use when accessing the Wallet. Mandatory.

- **-h**

  Display the usage.

- **-P**

  Read the password to write from standard input. Currently limited to 6''3' octets.

- **-p** *password*

  Write *password* into the designated location in the Wallet.

- **-q**

  Be more quiet. In combination with **NV**, do not display anything.

- **-V**

  Display the **kwalletcli** version information.

Default mode of operation, that is, unless **NP** or **Np** are used, is to read the password from the default Wallet and print it to standard output asNis, without any trailing newline.

There is currently no way to specify a Wallet other than the default.

All input and output is assumed to be in UTFN8. The password string (whether read from standard input or command line) is now converted from “possibly UTFN8 but binary transparent” to standardsNconformant UTFN8 for the Qt side, and back upon reading out.

## 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.

The exit codes 1 and 4, on reading, are not fatal; they merely indicate that the folder or entry specified does not exist. 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.

## ENVIRONMENT

- DISPLAY

  The X11 display to use for communicating with the KDE Wallet.

## EXAMPLES

The following command...

```
$ printf 4%s\n4 "secret"  kwalletcli Nf passwords Ne sitename NP
```

... stores the password “secret” as passwords\\sitename inside the default Wallet. To read it out, use:

```
$ password=$(kwalletcli Nf passwords Ne sitename)
```

## SEE ALSO

[kwalletcli\_getpin(1)](/kwalletcli_getpin/1.md)

## AUTHORS

**kwalletcli** was written by mirabilos  m@mirbsd.org  mostly for tarent solutions GmbH.

## CAVEATS

Do not use **Np** *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 **NP** instead and provide the *password* on standard input.

Beware of trailing newlines, especially outside of [mksh(1)](/mksh/1.md) scripts!

## 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.
