A TUI for pass, the standard Unix password manager
Project description
cpass: another console UI for pass
!DISCLAIMER!: Before the version 1.0.0, I do not guarantee that this program will always run as intended.
So it is recommended to back up your passwords or use git (by pass git init
) to manage the password store, so that the changes can be reverted.
On my side, I only use pass
commands to interact with the password store to minimize any possible damages.
So simply do pass git reset --hard <some commit>
to revert any changes.
cpass
is an urwid based terminal user interface (TUI) for the standard unix password manager, pass.
cpass
tries to achieve a minimal, clean interface and utilizes vim-like keybinding. Also, thanks to the urwid module, mouse is supported quite well.
Features:
- Browse the local password store
- Preview the folder and password content in a preview window
- Colors, key bindings and other customizations through a configuration file
- Password file operations, e.g., add, generate, edit, remove
- Copy password in various ways, e.g., first line, all lines, specific field (also customizable)
- Search patterns within the current window, the general vim-like operation
Features to-be:
- Find passwords globally in the password store, the pass find operation
- Basic pass git operations and status indicator
- Password file operations, e.g., copy, move, rename (low priority, since can be done with file managers, but it is worth implementing since
pass
commands will create git commits which protect the data)
Requirement
Make sure you are using a local password store created/compatible with pass
, which cpass
will look for in $PASSWORD_STORE_DIR
, otherwise in ~/.password_store/
.
pass
is also required, although theoretically a pass
compatible client does not need pass
command (e.g., qtpass can work with git
and gpg
).
However, pass
does a lot of things to assure the robustness and security of password management, there is no need to reinvent the wheels.
Install
-
As python package:
pip install --user cpass
-
Clone the repo or download the single script file.
Usage:
Start cpass
For now, just run cpass
.
Keybindings
Basic common keybindings just work as you would use in a lot of other programs:
h
, j
, k
, l
, g
, G
, ctrl+d
, ctrl+u
, ctrl+f
, ctrl+b
, ctrl+n
, ctrl+p
For pass
related operations:
i
add a new password in current directorya
generate a new password in current directoryd
delete current password file or directory after user confirmse
edit current passwordz
toggle previewy
+y/a/[0-9]
copy contents in password/
or?
will start a search (forward/backward)n
orN
go to next or previous search result
To-do ones
I
to add multiline passwordA
to generate with more optionsr
rename the fileD
,Y
,P
remove, copy and paste item
Mouse
This is very intuitive.
- Scroll to navigate up and down in the current list.
- Left-click on the current highlighted item will open it, while left click on other items will highlight it.
- Right-click will go to the parent folder.
Configuration
Some appearances or behaviors in the program can be customized through a configuration file located at $XDG_CONFIG_DIR/cpass/cpass.cfg
or $HOME/.config/cpass/cpass.cfg
.
Most importantly, the key bindings and colors can be changed.
There is an example configuration file cpass.cfg with all available options set to the default value, with detailed comments. You don't have to copy the whole file, because it does not change the default behavior of cpass
. The different sections in the configuration file corresponds to different types of options, as listed below.
-
ui
: UI layout.Control the preview window layout, either vertical or horizontal split.
[ui] preview_layout = side/bottom/horizontal/vertical
-
pass
:pass
related options.Whether to use
--no-symbols
option inpass generate
.[pass] no_symbols = true/false
-
keys
: Key bindings.For all actions available, see the example configuration file. For the format to specify keys, see the urwid documentation.
[keys] down = j, down, ctrl n up = k, up, ctrl p
-
copy_fields
: Copy key bindings.The copy behavior can be customized by specifying a key for any field. So at the copy prompt, pressing that key will copy the corresponding field.
[copy_fields] login = l
-
color
: Colors.See urwid documentation for definition, a palette example and available color names
[color] normal = default, default dir = light blue, default
-
icon
: Icons for folder and files.You can specify fancy icons like (below is the Material Design Icons I use, they are not default)
[icon] dir = " " file = " "
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.