keepassxc-cli.1.adoc 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. // Copyright (C) 2017 Manolis Agkopian <m.agkopian@gmail.com>
  2. // Copyright (C) 2020 KeePassXC Team <team@keepassxc.org>
  3. //
  4. // This program is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation, either version 2 or (at your option)
  7. // version 3 of the License.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License
  15. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. = keepassxc-cli(1)
  17. KeePassXC Team <team@keepassxc.org>
  18. :docdate: 2022-08-20
  19. :doctype: manpage
  20. :mansource: KeePassXC {revnumber}
  21. :manmanual: General Commands Manual
  22. == NAME
  23. keepassxc-cli - command line interface for the KeePassXC password manager
  24. == SYNOPSIS
  25. *keepassxc-cli* _command_ [_options_]
  26. == DESCRIPTION
  27. *keepassxc-cli* is the command line interface for the *KeePassXC* password manager.
  28. It provides the ability to query and modify the entries of a KeePass database, directly from the command line.
  29. == COMMANDS
  30. *add* [_options_] <__database__> <__entry__>::
  31. Adds a new entry to a database.
  32. A password can be generated (*-g* option), or a prompt can be displayed to input the password (*-p* option).
  33. The same password generation options as documented for the generate command can be used when the *-g* option is set.
  34. *analyze* [_options_] <__database__>::
  35. Analyzes passwords in a database for weaknesses using offline HIBP SHA-1 hash lookup.
  36. *attachment-export* [_options_] <__database__> <__entry__> <__attachment_name__> <__export_file__>::
  37. Exports the content of an attachment to a specified file.
  38. Use *--stdout* option to instead output the contents of the attachment to stdout.
  39. *attachment-import* [_options_] <__database__> <__entry__> <__attachment_name__> <__import_file__>::
  40. Imports the attachment into an entry.
  41. An existing attachment with the same name may be overwritten if the *-f* option is specified.
  42. *attachment-rm* <__database__> <__entry__> <__attachment_name__>::
  43. Removes the named attachment from an entry.
  44. *clip* [_options_] <__database__> <__entry__> [_timeout_]::
  45. Copies an attribute or the current TOTP (if the *-t* option is specified) of a database entry to the clipboard.
  46. If no attribute name is specified using the *-a* option, the password is copied.
  47. If multiple entries with the same name exist in different groups, only the attribute for the first one is copied.
  48. For copying the attribute of an entry in a specific group, the group path to the entry should be specified as well, instead of just the name.
  49. Optionally, a timeout in seconds can be specified to automatically clear the clipboard, the default timeout is 10 seconds, set to 0 to disable.
  50. *close*::
  51. In interactive mode, closes the currently opened database (see *open*).
  52. *db-create* [_options_] <__database__>::
  53. Creates a new database with a password and/or a key file.
  54. The key file will be created if the file that is referred to does not exist.
  55. If both the key file and password are empty, no database will be created.
  56. *db-edit* [_options_] <__database__>::
  57. Edits a database.
  58. When setting a key file, the key file will be created if the file that is referred to
  59. does not exist.
  60. *db-info* [_options_] <__database__>::
  61. Show a database's information.
  62. *diceware* [_options_]::
  63. Generates a random diceware passphrase.
  64. *edit* [_options_] <__database__> <__entry__>::
  65. Edits a database entry.
  66. A password can be generated (*-g* option), or a prompt can be displayed to input the password (*-p* option).
  67. The same password generation options as documented for the generate command can be used when the *-g* option is set.
  68. *estimate* [_options_] [_password_]::
  69. Estimates the entropy of a password.
  70. The password to estimate can be provided as a positional argument, or using the standard input.
  71. *exit*::
  72. Exits interactive mode.
  73. Synonymous with *quit*.
  74. *export* [_options_] <__database__>::
  75. Exports the content of a database to standard output in the specified format (defaults to XML).
  76. *generate* [_options_]::
  77. Generates a random password.
  78. *help* [_command_]::
  79. Displays a list of available commands, or detailed information about the specified command.
  80. *import* [_options_] <__xml__> <__database__>::
  81. Imports the contents of an XML exported database to a new created database
  82. with a password and/or key file.
  83. The key file will be created if the file that is referred to does not exist.
  84. If both the key file and password are empty, no database will be created.
  85. The new database will be in kdbx 4 format.
  86. *ls* [_options_] <__database__> [_group_]::
  87. Lists the contents of a group in a database.
  88. If no group is specified, it will default to the root group.
  89. *merge* [_options_] <__database1__> <__database2__>::
  90. Merges two databases together.
  91. The first database file is going to be replaced by the result of the merge, for that reason it is advisable to keep a backup of the two database files before attempting a merge.
  92. In the case that both databases make use of the same credentials, the *--same-credentials* or *-s* option can be used.
  93. *mkdir* [_options_] <__database__> <__group__>::
  94. Adds a new group to a database.
  95. *mv* [_options_] <__database__> <__entry__> <__group__>::
  96. Moves an entry to a new group.
  97. *open* [_options_] <__database__>::
  98. Opens the given database in a shell-style interactive mode.
  99. This is useful for performing multiple operations on a single database (e.g. *ls* followed by *show*).
  100. *quit*::
  101. Exits interactive mode.
  102. Synonymous with *exit*.
  103. *rm* [_options_] <__database__> <__entry__>::
  104. Removes an entry from a database.
  105. If the database has a recycle bin, the entry will be moved there.
  106. If the entry is already in the recycle bin, it will be removed permanently.
  107. *rmdir* [_options_] <__database__> <__group__>::
  108. Removes a group from a database.
  109. If the database has a recycle bin, the group will be moved there.
  110. If the group is already in the recycle bin, it will be removed permanently.
  111. *search* [_options_] <__database__> <__term__>::
  112. Searches all entries that match a specific search term in a database.
  113. *show* [_options_] <__database__> <__entry__>::
  114. Shows the title, username, password, URL and notes of a database entry.
  115. Can also show the current TOTP.
  116. Regarding the occurrence of multiple entries with the same name in different groups, everything stated in the *clip* command section also applies here.
  117. == OPTIONS
  118. === General options
  119. *--debug-info*::
  120. Displays debugging information.
  121. *-k*, *--key-file* <__path__>::
  122. Specifies a path to a key file for unlocking the database.
  123. In a merge operation this option, is used to specify the key file path for the first database.
  124. *--no-password*::
  125. Deactivates the password key for the database.
  126. *-y*, *--yubikey* <__slot[:serial]__>::
  127. Specifies a yubikey slot for unlocking the database.
  128. In a merge operation this option is used to specify the YubiKey slot for the first database.
  129. *-q*, *--quiet* <__path__>::
  130. Silences password prompt and other secondary outputs.
  131. *-h*, *--help*::
  132. Displays help information.
  133. *-v*, *--version*::
  134. Displays the program version.
  135. === Merge options
  136. *-d*, *--dry-run* <__path__>::
  137. Prints the changes detected by the merge operation without making any changes to the database.
  138. *--key-file-from* <__path__>::
  139. Sets the path of the key file for the second database.
  140. *--no-password-from*::
  141. Deactivates password key for the database to merge from.
  142. *--yubikey-from* <__slot[:serial]__>::
  143. YubiKey slot for the second database.
  144. *-s*, *--same-credentials*::
  145. Uses the same credentials for unlocking both databases.
  146. === Add and edit options
  147. The same password generation options as documented for the generate command can be used with those 2 commands when the *-g* option is set.
  148. *-u*, *--username* <__username__>::
  149. Specifies the username of the entry.
  150. *--url* <__url__>::
  151. Specifies the URL of the entry.
  152. *--notes* <__notes__>::
  153. Specifies the notes of the entry.
  154. *-p*, *--password-prompt*::
  155. Uses a password prompt for the entry's password.
  156. *-g*, *--generate*::
  157. Generates a new password for the entry.
  158. === Edit options
  159. *-t*, *--title* <__title__>::
  160. Specifies the title of the entry.
  161. === Estimate options
  162. *-a*, *--advanced*::
  163. Performs advanced analysis on the password.
  164. === Analyze options
  165. *-H*, *--hibp* <__filename__>::
  166. Checks if any passwords have been publicly leaked, by comparing against the given list of password SHA-1 hashes, which must be in "Have I Been Pwned" format.
  167. Such files are available from https://haveibeenpwned.com/Passwords;
  168. note that they are large, and so this operation typically takes some time (minutes up to an hour or so).
  169. *--okon* <__okon-cli path__>::
  170. Use the specified okon-cli program to perform offline breach checks. You can obtain okon-cli from https://github.com/stryku/okon.
  171. When using this option, *-H, --hibp* must point to a post-processed okon file (e.g. file.okon).
  172. === Clip options
  173. *-a*, *--attribute*::
  174. Copies the specified attribute to the clipboard.
  175. If no attribute is specified, the password attribute is the default.
  176. For example, "*-a* *username*" would copy the username to the clipboard.
  177. [Default: password]
  178. *-t*, *--totp*::
  179. Copies the current TOTP instead of the specified attribute to the clipboard.
  180. Will report an error if no TOTP is configured for the entry.
  181. *-b*, *--best*::
  182. Try to find and copy to clipboard a unique entry matching the input
  183. If a unique matching entry is found it will be copied to the clipboard.
  184. If multiple entries are found they will be listed to refine the search. (no clip performed)
  185. === Db-create, Db-edit and Import options
  186. *--set-key-file* <__path__>::
  187. Set the key file for the database.
  188. *-p*, *--set-password*::
  189. Set a password for the database.
  190. === Db-create, Import options
  191. *-t*, *--decryption-time* <__time__>::
  192. Target decryption time in MS for the database.
  193. === Db-edit options
  194. *--unset-password* <__path__>::
  195. Removes the password for the database.
  196. *--unset-key-file* <__path__>::
  197. Removes the key file for the database.
  198. === Show options
  199. *-a*, *--attributes* <__attribute__>...::
  200. Shows the named attributes.
  201. This option can be specified more than once, with each attribute shown one-per-line in the given order.
  202. If no attributes are specified and *-t* is not specified, a summary of the default attributes is given.
  203. Protected attributes will be displayed in clear text if specified explicitly by this option.
  204. *--all*::
  205. Show all the attributes of the entry.
  206. *-s*, *--show-protected*::
  207. Shows the protected attributes in clear text.
  208. *--show-attachments*::
  209. Shows the attachment names along with the size of the attachments.
  210. *-t*, *--totp*::
  211. Also shows the current TOTP, reporting an error if no TOTP is configured for the entry.
  212. === Diceware options
  213. *-W*, *--words* <__count__>::
  214. Sets the desired number of words for the generated passphrase.
  215. [Default: 7]
  216. *-w*, *--word-list* <__path__>::
  217. Sets the Path of the wordlist for the diceware generator.
  218. The wordlist must have > 1000 words, otherwise the program will fail.
  219. If the wordlist has < 4000 words a warning will be printed to STDERR.
  220. Any *diceware*-compatible wordlist can be used. Note however that *KeePassXC* will NOT verify the PGP signature of signed wordlists.
  221. === Export options
  222. *-f*, *--format*::
  223. Format to use when exporting.
  224. Available choices are xml or csv.
  225. Defaults to xml.
  226. === List options
  227. *-R*, *--recursive*::
  228. Recursively lists the elements of the group.
  229. *-f*, *--flatten*::
  230. Flattens the output to single lines.
  231. When this option is enabled, subgroups and subentries will be displayed with a relative group path instead of indentation.
  232. === Generate options
  233. *-L*, *--length* <__length__>::
  234. Sets the desired length for the generated password.
  235. [Default: 16]
  236. *-l*, *--lower*::
  237. Uses lowercase characters for the generated password.
  238. [Default: Enabled]
  239. *-U*, *--upper*::
  240. Uses uppercase characters for the generated password.
  241. [Default: Enabled]
  242. *-n*, *--numeric*::
  243. Uses numbers characters for the generated password.
  244. [Default: Enabled]
  245. *-s*, *--special*::
  246. Uses special characters for the generated password.
  247. [Default: Disabled]
  248. *-e*, *--extended*::
  249. Uses extended ASCII characters for the generated password.
  250. [Default: Disabled]
  251. *-x*, *--exclude* <__chars__>::
  252. Comma-separated list of characters to exclude from the generated password.
  253. None is excluded by default.
  254. *--exclude-similar*::
  255. Exclude similar looking characters.
  256. [Default: Disabled]
  257. *--every-group*::
  258. Include characters from every selected group.
  259. [Default: Disabled]
  260. include::includes/section-notes.adoc[]
  261. == AUTHOR
  262. This manual page was originally written by Manolis Agkopian <m.agkopian@gmail.com>.
  263. include::includes/section-reporting-bugs.adoc[]
  264. include::includes/section-copyright.adoc[]
  265. == SEE ALSO
  266. *keepassxc*(1)