KEEPASSXC-CLI(1)
π KEEPASSXC-CLI π
okay bestie, so this is the manual page for keepassxc-cli β General Commands Manual, that's the vibe β and it's literally your golden ticket to the KeePassXC password manager from the terminal. no GUI, no clicking, just you and the command line being iconic together π
β¨ NAME β¨
keepassxc-cli β the command line interface for the KeePassXC password manager π«Ά
β¨ SYNOPSIS β¨
keepassxc-cli command [options]
β¨ DESCRIPTION β¨
so keepassxc-cli is, like, the command line interface for the KeePassXC password manager. what it gives you is the ability to query and modify the entries of a KeePass database, directly from the command line. no windows, no mouse, just vibes and flags π
π COMMANDS π
your whole arsenal, bestie. every single one. let's go π¦
add [options] <database> <entry>
Adds a new entry to a database. you can have a password generated for you (that's the -g option β¨), or you can get a prompt to type the password in yourself (that's the -p option). and here's the cute part β when you've got -g set, you can use all the same password generation options that are documented for the generate command. same energy, same flags π
analyze [options] <database>
Analyzes passwords in a database for weaknesses, using offline HIBP SHA-1 hash lookup. it's giving detective era π and no, it's offline, so your hashes aren't going on a lil field trip πΈ
attachment-export [options] <database> <entry> <attachment_name> <export_file>
Exports the content of an attachment to a specified file. wanna skip the file entirely and just yeet it to the terminal? use the --stdout option and the contents of the attachment go straight to stdout instead π
attachment-import [options] <database> <entry> <attachment_name> <import_file>
Imports the attachment into an entry. and heads up β an existing attachment with the same name may be overwritten if you specify the -f option π so like, know before you do it
attachment-rm <database> <entry> <attachment_name>
Removes the named attachment from an entry. bye bestie π«Ά (the attachment. the attachment is the bestie leaving)
clip [options] <database> <entry> [timeout]
Copies an attribute β or the current TOTP, if you passed the -t option β of a database entry to the clipboard. if you don't name an attribute with the -a option, then the password is what gets copied. now listen: if multiple entries with the same name exist in different groups, only the attribute for the first one gets copied π so if you need the attribute of an entry in a specific group, specify the group path to the entry as well, instead of just the name. also you can optionally pass a timeout in seconds to automatically clear the clipboard β the default timeout is 10 seconds, and you set it to 0 to disable it entirely. iconic security behavior actually π
close
In interactive mode, closes the currently opened database (see open). that's it. that's the whole thing π
db-create [options] <database>
Creates a new database with a password and/or a key file. the key file will be created if the file that is referred to does not exist β¨ and real talk: if both the key file and password are empty, no database will be created. nothing. nada. don't do that π
db-edit [options] <database>
Edits a database. and when you're setting a key file, that key file will be created if the file that is referred to does not exist π
db-info [options] <database>
Show a database's information. just the facts, bestie π
diceware [options]
Generates a random diceware passphrase. roll the dice, get a passphrase, slay π²
edit [options] <database> <entry>
Edits a database entry. password can be generated (-g option β¨) or you can get a prompt to input the password (-p option). and same as before β with -g set, all the same password generation options documented for the generate command apply π
estimate [options] [password]
Estimates the entropy of a password. you can hand over the password to estimate as a positional argument, or you can feed it in using the standard input. your call, no judgment π§
exit
Exits interactive mode. Synonymous with quit. twin commands, both valid π
export [options] <database>
Exports the content of a database to standard output in the specified format (defaults to XML). straight to stdout, no cap π€
generate [options]
Generates a random password. the moment you've been waiting for π₯
help [command]
Displays a list of available commands, or detailed information about the specified command. when in doubt, ask for help β that's main character energy π
import [options] <xml> <database>
Imports the contents of an XML exported database to a new created database with a password and/or key file. the key file will be created if the file that is referred to does not exist β¨ if both the key file and password are empty, no database will be created β fr fr, nothing happens π and the new database will be in kdbx 4 format π¦
ls [options] <database> [group]
Lists the contents of a group in a database. if no group is specified, it will default to the root group. root group is the default bestie πΈ
merge [options] <database1> <database2>
Merges two databases together. β οΈ okay real talk time: the first database file is going to be replaced by the result of the merge, so for that reason it is advisable to keep a backup of the two database files before attempting a merge. like, actually do it. back it up. i'm not playing π and in the case that both databases make use of the same credentials, the --same-credentials or -s option can be used π
mkdir [options] <database> <group>
Adds a new group to a database. new group, who dis π
mv [options] <database> <entry> <group>
Moves an entry to a new group. relocation era β¨
open [options] <database>
Opens the given database in a shell-style interactive mode. this is useful for performing multiple operations on a single database (e.g. ls followed by show) π
quit
Exits interactive mode. Synonymous with exit. same thing, different spelling, both iconic π
rm [options] <database> <entry>
Removes an entry from a database. and here's the nuance bestie β if the database has a recycle bin, the entry will be moved there. but if the entry is already in the recycle bin, it will be removed permanently π so like, double-check where you are before you do this
rmdir [options] <database> <group>
Removes a group from a database. same deal as rm: if the database has a recycle bin, the group will be moved there. if the group is already in the recycle bin, it will be removed permanently π
search [options] <database> <term>
Searches all entries that match a specific search term in a database. find your people π
show [options] <database> <entry>
Shows the title, username, password, URL and notes of a database entry. can also show the current TOTP β¨ and regarding the occurrence of multiple entries with the same name in different groups β everything stated in the clip command section also applies here. so yeah, first one wins unless you give the group path π«Ά
to be continued, bestieβ¦ more of this page is coming π
β¨ OPTIONS β¨
okay bestie, this is the big one. every single flag, no skips, we're going the whole way π
πΈ General options
--debug-infoβ spills all the debugging tea. when something's acting up, this is the receipt.-k,--key-file <path>β points at a key file to unlock the database. heads up: in a merge operation, this one is the key file path for the first database. two databases, two key files, don't mix them up π«Ά--no-passwordβ turns off the password key for the database. bye password π-y,--yubikey <slot[:serial]>β names the YubiKey slot used to unlock the database. and in a merge operation? this one is the YubiKey slot for the first database. (yes,<slot[:serial]>β the serial part is optional.)-q,--quiet <path>β shushes the password prompt and all the other secondary output. lowkey the "let me live" flag.-h,--helpβ help info. the classic.-v,--versionβ tells you which program version you're running.
π Merge options
-d,--dry-run <path>β prints everything the merge found, and changes nothing in the database. it's giving window shopping. zero commitment β¨--key-file-from <path>β sets the path of the key file for the second database.--no-password-fromβ deactivates the password key for the database you're merging from.--yubikey-from <slot[:serial]>β YubiKey slot for the second database.-s,--same-credentialsβ one set of credentials, both databases unlocked. efficient icon behaviour π
π Add and edit options
fr fr important: when the-goption is set, the exact same password generation options documented for thegeneratecommand can be used with these 2 commands. same options, same energy.
-u,--username <username>β sets the username of the entry.--url <url>β sets the URL of the entry.--notes <notes>β sets the notes of the entry.-p,--password-promptβ pops a prompt so you can type the entry's password yourself.-g,--generateβ generates a brand new password for the entry. slay.
π¦ Edit options
-t,--title <title>β sets the title of the entry. yes, just the one option here. she's a short section and she ate.
π Estimate options
-a,--advancedβ does the advanced analysis on the password. going deeper, bestie.
π Analyze options
-H,--hibp <filename>β checks whether any passwords have been publicly leaked, by comparing against the given list of password SHA-1 hashes. that list must be in "Have I Been Pwned" format. files like that live athttps://haveibeenpwned.com/Passwordsβ but bestie, they are large, so this operation typically takes some time. we're talking minutes, up to an hour or so π go make a snack.--okon <okon-cli path>β use the specifiedokon-cliprogram to do offline breach checks. you can getokon-clifromhttps://github.com/stryku/okon. β οΈ when you use this option,-H, --hibpmust point to a post-processed okon file (e.g.file.okon).
π Clip options
-a,--attributeβ copies the specified attribute to the clipboard. if you don't name an attribute, the password attribute is the default. for example,"-a username"would copy the username to the clipboard. [Default:password]-t,--totpβ copies the current TOTP to the clipboard instead of the specified attribute. π will report an error if no TOTP is configured for the entry.-b,--bestβ tries to find and copy a unique entry matching the input. if a unique matching entry is found it gets copied to the clipboard. if multiple entries match, they get listed so you can refine your search β and no clip is performed. (no clip performed, bestie, read it again.)
π Db-create, Db-edit and Import options
--set-key-file <path>β set the key file for the database.-p,--set-passwordβ set a password for the database.
β Db-create, Import options
-t,--decryption-time <time>β target decryption time in MS for the database.
π Db-edit options
--unset-password <path>β removes the password for the database.--unset-key-file <path>β removes the key file for the database.
β¨ Show options
-a,--attributes <attribute>...β shows the named attributes. you can specify this option more than once, and each attribute is shown one-per-line in the order you gave them. if you specify no attributes and-tisn't specified, you get a summary of the default attributes instead. π and heads up: protected attributes will be displayed in clear text if you specify them explicitly with this option.--allβ shows all the attributes of the entry. the whole lore.-s,--show-protectedβ shows the protected attributes in clear text. (yes. out loud. in public. π)--show-attachmentsβ shows the attachment names along with the size of the attachments.-t,--totpβ also shows the current TOTP, and reports an error if no TOTP is configured for the entry.
π§ Diceware options
-W,--words <count>β sets the desired number of words for the generated passphrase. [Default:7]-w,--word-list <path>β sets the Path of the wordlist for the diceware generator. the wordlist must have > 1000 words, otherwise the program will fail. if the wordlist has < 4000 words, a warning gets printed to STDERR. any diceware-compatible wordlist works. β οΈ but note: KeePassXC will NOT verify the PGP signature of signed wordlists. so, like, trust responsibly.
π Export options
-f,--formatβ format to use when exporting. available choices arexmlorcsv. defaults toxml.
πΈ List options
-R,--recursiveβ recursively lists the elements of the group.-f,--flattenβ flattens the output to single lines. when this option is enabled, subgroups and subentries get displayed with a relative group path instead of indentation.
π Generate options
-L,--length <length>β sets the desired length for the generated password. [Default:16]-l,--lowerβ uses lowercase characters for the generated password. [Default: Enabled]-U,--upperβ uses uppercase characters for the generated password. [Default: Enabled]-n,--numericβ uses numbers characters for the generated password. [Default: Enabled]-s,--specialβ uses special characters for the generated password. [Default: Disabled]-e,--extendedβ uses extended ASCII characters for the generated password. [Default: Disabled]-x,--exclude <chars>β comma-separated list of characters to exclude from the generated password. None is excluded by default.--exclude-similarβ exclude similar looking characters. [Default: Disabled]--every-groupβ include characters from every selected group. [Default: Disabled]
π NOTES
- Project homepage β
https://keepassxc.org - QuickStart Guide β
https://keepassxc.org/docs/KeePassXC_GettingStarted.html - User Guide β
https://keepassxc.org/docs/KeePassXC_UserGuide.html - Git repository β
https://github.com/keepassxreboot/keepassxc.git
βοΈ AUTHOR
This manual page was originally written by Manolis Agkopian m.agkopian@gmail.com. credit where credit is due, icon π«Ά
π REPORTING BUGS
Bugs and feature requests can be reported on GitHub at https://github.com/keepassxreboot/keepassxc/issues.
βοΈ COPYRIGHT
Copyright (C) 2016-2020 KeePassXC Team team@keepassxc.org
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 or version 3. There is NO WARRANTY, to the extent permitted by law.
no warranty bestie. it's free software, not a safety net π
π SEE ALSO
π AUTHOR
KeePassXC Team
and that's the whole page, bestie!! πβ¨ this one's from KeePassXC 2.8.0, dated 2022-08-20 β the KEEPASSXC-CLI(1) manual. now go lock down those passwords, you absolute legend π
ππ¦
π¦ where this page comes from
- arch rolling: keepassxc 2.8.0-3 Β· GPL-2.0-only OR GPL-3.0-only OR LGPL-2.1-only
- fedora 43: keepassxc 2.8.0-2.fc43 Β· GPL-2.0-or-later AND BSD-2-Clause AND MIT AND CC0-1.0 AND Apache-2.0 AND LGPL-2.0-only AND LGPL-2.1-only
- fedora 44: keepassxc 2.8.0-2.fc44 Β· GPL-2.0-or-later AND BSD-2-Clause AND MIT AND CC0-1.0 AND Apache-2.0 AND LGPL-2.0-only AND LGPL-2.1-only
- nixpkgs unstable: keepassxc 2.8.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms