# kpcli {{INLINETOC}} **kpcli** est un utilitaire permettant la manipulation de fichier .kdbx (ou .kbd) depuis la console. Il couvre les fonctions principales de **KeePassX** (copie du login/mot de passe dans le presse-papier, arborescence conservée, création de nouvelles entrées etc.) **Note**: la gestion du format **Keepass** n’est pas strictement identique entre **kpcli** et **KeePassX**, par exemple kpcli gère les tags mais pas **KeePassX**. Si on en ajoute avec **kpcli**, ils ne seront donc pas visibles avec **KeePassX**! ## Créer une nouvelle base Il suffit de lancer kpcli sans argument, puis de sauvegarder : ``` $ kpcli KeePass CLI (kpcli) v3.1 is ready for operation. kpcli:/> saveas foo.kdbx Please provide the master password: ************************* Retype to verify: ************************* ``` ## Utilisation courante kpcli a quelques options au démarrage. Les plus utiles étant : * **--kdb FICHIER**: Spécifie le fichier .kdbx à ouvrir. * **--readonly**: Ouverture de la base de données en lecture seule ``` $ kpcli --readonly --kdb foo.kdbx Please provide the master password: ************************* Type 'help' for a description of available commands. Type 'help ' for details on individual commands. kpcli:/> help attach -- Manage attachments: attach cd -- Change directory (path to a group) cl -- Change directory and list entries (cd+ls) clone -- Clone an entry: clone close -- Close the currently opened database cls -- Clear screen ("clear" command also works) copy -- Copy an entry: copy edit -- Edit an entry: edit export -- Export entries to a new KeePass DB (export []) find -- Finds entries by Title help -- Print helpful information history -- Prints the command history icons -- Change group or entry icons in the database import -- Import another KeePass DB (import []) ls -- Lists items in the pwd or a specified path ("dir" also works) mkdir -- Create a new group (mkdir ) mv -- Move an item: mv new -- Create a new entry: new open -- Open a KeePass database file (open []) pwck -- Check password quality: pwck pwd -- Print the current working directory quit -- Quit this program (EOF and exit also work) rename -- Rename a group: rename rm -- Remove an entry: rm rmdir -- Delete a group (rmdir ) save -- Save the database to disk saveas -- Save to a specific filename (saveas []) show -- Show an entry: show [-f] [-a] stats -- Prints statistics about the open KeePass file ver -- Print the version of this program vers -- Same as "ver -v" xp -- Copy password to clipboard: xp xu -- Copy username to clipboard: xu xw -- Copy URL (www) to clipboard: xw xx -- Clear the clipboard: xx Type "help " for more detailed help on a command. ``` ### Naviguer dans la base de données ``` kpcli:/> ls === Groups === eMail/ Internet/ ``` ``` kpcli:/> cd Internet/ kpcli:/Internet> ls === Entries === 0. example.com secure.example.com 1. example.net intra.example.net 2. example.org magic.example.org ``` ``` kpcli:/Internet> show 2 Path: /Internet Title: example.org Uname: baz Pass: URL: magic.example.net Notes: Tarpin secure thing ``` **Note** : le champ « Pass » est invisible mais l’on peut le copier/coller avec la souris. ### Ajouter une entrée ``` $ kpcli:/Internet> new Adding new entry to "/Internet" Title: example Username: root Password: ("g" or "w" to auto-generate, "i" for interactive) Retype to verify: URL: Tags: Strings: (a)dd/(e)dit/(d)elete/(c)ancel/(F)inish? Notes/Comments (""): (end multi-line input with a single "." on a line) | Database was modified. Do you want to save it now? [y/N]: Saved to foo.kdbx ``` ### Modifier une entrée ``` $ kpcli:/Internet> edit 0 ```