The CLI's edit command appears only to be capable of renaming items inside a folder, and not moving the items across (or up) folders.
This Issue /would/ be a feature request, except for the CLI's behaviour of not catching a naive request to move an item to the root, and instead creating an entry with unexpected double-slashes.
$ function kpc() { echo pass | keepassxc-cli "$@" | grep -v "^Insert password"; }
$ kpc ls ~/test.kdbx
Personal/
$ kpc ls ~/test.kdbx /Personal
Twitter
Google
$ kpc edit ~/test.kdbx /Personal/Twitter -t Twitter
Successfully edited entry Twitter.
$ kpc ls ~/test.kdbx /Personal
Twitter
Google
$ kpc ls ~/test.kdbx /
Personal/
$ kpc edit ~/test.kdbx /Personal/Twitter -t /Twitter
Successfully edited entry /Twitter.
$ kpc ls ~/test.kdbx /
Personal/
$ kpc ls ~/test.kdbx /Personal
/Twitter
Google
$ kpc edit ~/test.kdbx /Personal/Google -t /Foo/Google
Successfully edited entry /Foo/Google.
$ kpc ls ~/test.kdbx /Personal
/Twitter
/Foo/Google
Note that the kpc edit ~/test.kdbx /Personal/Twitter -t /Twitter command renames the item inside the "Personal" folder, giving it a name of "/Twitter".
I expected the CLI to be able to move items around the hierarchy (feature request).
I expected the CLI to indicate in some way that the edit command's inability to move items means that the overloaded "title" attribute, which encompasses both position and name, can only be used to "edit" the name characteristic, and not leave me with items named with leading slashes.
As above.
On Debian stable, so a bit of an older version:
$ keepassxc-cli --version
2.3.4
$ apt-cache policy keepassxc
keepassxc:
Installed: 2.3.4+dfsg.1-1
Operating System: Linux
Desktop Env: ChromeOS
Windowing System: Wayland
Perhaps an easy first step would be to amend the output, above, so that instead of
$ kpc edit ~/test.kdbx /Personal/Twitter -t /Twitter
Successfully edited entry /Twitter.
.. positional/hierarchical information wasn't lost. If the success message had included the item's full path, this would have surprised me less. But not zero. ;-)
Update to 2.6.0, cli has a move command
For any future debian stable users reading this, 2.6.0 isn't available yet via the apt archives ... but it's not required.
The version of the CLI in buster-backports (https://backports.debian.org/) is 2.5.4, and it has this command, as well as TOTP CLI generation :-)
You can also use our ppa