Giter Site home page Giter Site logo

cpass's Introduction

cpass: another console UI for pass

!DISCLAIMER!: This is still WIP. Before the version 1.0.0, I do not guarantee that this program will run mostly as intended (doesn't mean 1.0.0 will be perfect, either). Version 1.0.0 might break some of the backward compatibility.

It is recommended to back up your passwords or use git (by pass git init) to manage the password store.


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 folders and passwords
  • Customizable: colors, key bindings and more
  • Pass operations:
    • add
    • edit
    • generate
    • remove
  • Copy passwords in various ways (also customizable)
  • Search passwords in the current directory

Todo list:

  • More pass operations, e.g., find, copy, move, rename, git, otp
  • CLI arguments for more use cases, e.g. open in find mode, and close on copy.

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 required, although theoretically a pass compatible client does not need pass (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
    
  • Install with GNU Guix

    guix pull
    guix install cpass
    
  • Clone the repo or download the single script file.

Usage:

Start cpass

For now, just run cpass.

Some CLI arguments are in mind, but those are for future versions.

Keybindings

Basic navigation keybindings just work as in a lot of command line programs (like less):

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 directory
  • a generate a new password in current directory
  • d delete current password file or directory after user confirms
  • e edit current password in $EDITOR
  • z toggle preview
  • y + y/a/[0-9] copy contents in password ('0' to copy the 10th line)
  • / or ? will start a search (forward/backward)
  • n or N go to next or previous search result

To-do ones (might change)

  • I to add multi-line password
  • A to generate with more options
  • r rename the file
  • D, Y, P remove, copy and paste files

Mouse

This is very intuitive.

  • Scroll to navigate up and down in the current list.
  • Left-click on the highlighted item will open it, otherwise will highlight it.
  • Right-click will go to the parent folder.

Configuration

Configuration file: $XDG_CONFIG_DIR/cpass/cpass.cfg, which falls back to $HOME/.config/cpass/cpass.cfg if not found.

Example configuration file cpass.cfg has all available options set to the default value, with detailed comments.

This is an overview of what can be customized through the configuration file, for the complete list of options, see cpass.cfg:

[ui]
preview_layout = side/bottom/horizontal/vertical

[pass]
no_symbols = true/false

[keys]
down = j, down, ctrl n
up = k, up, ctrl p

[copy_fields]
login = l

[color]
normal   = default, default
dir      = light blue, default

[icon]
dir     = "󰉋 "
file    = "󰈤 "

Two sections, the keys and color, need some references:

  • Key bindings in keys section:
    • For all actions available to bind, see the example configuration file.
    • For the format to specify keys, see the urwid documentation.
  • Colors in color section. The configuration is similar to (can be seen as) an urwid pallete consisting of multiple display attributes. In the example cpass.cfg I provided enough information to get started. If you want to know more:

Screenshot

cpass.mp4

cpass's People

Contributors

jgarte avatar xlucn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cpass's Issues

assert(os.path.exists(PASS_DIR))

Hi,

I was packaging cpass for guix and I get the following error:

Do you happen to know what might be causing it.

Traceback (most recent call last):
  File "/gnu/store/36dx52423ipqw2hs5cx392dwr8dysf59-cpass-guixrus-0.9.2/bin/.cpass-real", line 11, in <module>
    load_entry_point('cpass==0.9.2', 'console_scripts', 'cpass')()
  File "/gnu/store/sd2ic7bpv8fx3imy1j8xcjclx71sv6q0-python-3.8.2/lib/python3.8/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/gnu/store/sd2ic7bpv8fx3imy1j8xcjclx71sv6q0-python-3.8.2/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/gnu/store/sd2ic7bpv8fx3imy1j8xcjclx71sv6q0-python-3.8.2/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/gnu/store/sd2ic7bpv8fx3imy1j8xcjclx71sv6q0-python-3.8.2/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/gnu/store/36dx52423ipqw2hs5cx392dwr8dysf59-cpass-guixrus-0.9.2/lib/python3.8/site-packages/cpass.py", line 524, in <module>
    class Pass:
  File "/gnu/store/36dx52423ipqw2hs5cx392dwr8dysf59-cpass-guixrus-0.9.2/lib/python3.8/site-packages/cpass.py", line 531, in Pass
    assert(os.path.exists(PASS_DIR))
AssertionError

Insert or generate does not update properly with "dir/file" input

If the user enters a name with directory separator '/' in the password name for insert or generate, the password itself will be updated as intended, but the UI does not update the list with a new folder and a new file within. Now "dir/file" shows as is, as a single password file name, which is not right.

Focus could change when editing

When editing in an editbox, the user is able to change the focus by clicking elsewhere. After that, the UI does not respond to some keys like search('/'), copy('y'), etc.

Maybe after the focus changes, those keys might restart search or copy, or whatever intuitive.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.