Skip to main content

Manage your login credentials from the terminal painlessly.

Project description

Passpie: Manage your passwords from the terminal
================================================

`Passpie <https://marcwebbie.github.io/passpie>`__ lets you manage your
login credentials from the terminal. Password files are saved into
`GnuPG <http://en.wikipedia.org/wiki/GNU_Privacy_Guard>`__ encrypted
files into the Database Path. Only with the passphrase used to create
the pass database you can decrypt password files. If you want to know
more about how passpie works internally, check Under the Hood section.

.. figure:: https://github.com/marcwebbie/passpie/raw/master/images/passpie.png
:alt: Passpie console interface

Passpie console interface

Passpie is built with `Click <http://click.pocoo.org>`__ for its
interface, `TinyDB <https://github.com/msiemens/tinydb>`__ for its
database and
`python-gnupg <https://github.com/isislovecruft/python-gnupg>`__ for
its encryption using gpg.

--------------

Features
--------

- [x] Console interface
- [x] Manage multiple databases
- [x] Add, update, remove credentials
- [x] Copy passwords to clipboard
- [x] List credentials as a table
- [x] List credentials with a colored output
- [x] Search credentials by name, login or comments
- [x] Search with regular expression
- [x] Group credentials by name
- [x] Configure from configfile. ``~/.passpie``
- [ ] Change passphrase and re-encrypt database
- [x] Export Passpie database to plain text file
- [x] Import plain text Passpie database
- [ ] Import credentials from
`1Password <https://agilebits.com/onepassword>`__
- [ ] Import credentials from
`Pysswords <https://github.com/marcwebbie/pysswords>`__
- [x] Randomly generated credential passwords
- [x] Generate database status report
- [ ] Undo/Redo updates to the database
- [ ] Bulk update/remove credentials

--------------

|pypi| |unix\_build| |windows\_build| |coverage| |Bitdeli Badge|

--------------

Installation
------------

Stable version
~~~~~~~~~~~~~~

Make sure you have `GPG <https://www.gnupg.org/>`__ and
`pip <http://pip.readthedocs.org/en/latest/installing.html>`__
installed:

.. code:: bash

pip install passpie

Development version
~~~~~~~~~~~~~~~~~~~

The **latest development version** can be installed directly from
GitHub:

.. code:: bash

$ pip install --upgrade https://github.com/marcwebbie/passpie/tarball/master

Quickstart
----------

.. code:: bash

# create a new credentials database.
passpie init

# add new credentials.
passpie add foo@example.com
passpie add bar@example.com

# edit credential "foo@example.com".
passpie update foo@example.com

# copy password from credential "foo@example.com" into system clipboard.
passpie copy foo@example.com

# search credentials by string "exam".
passpie search exam

# search credentials using regular expressions.
passpie search 'foo|bar'

# remove credential "foo@example.com".
passpie remove foo@example.com

# check database status
passpie status

# print all credentials as a table with hidden passwords
passpie

# specify other Passpie database. Option `-D` or `--database`
passpie -D /path/to/other/database

# shows help. Option `-h` or `--help`
passpie --help

# shows version. Option `--version`
passpie --version

Commands
--------

``init``:
~~~~~~~~~

Initialize database

``add``:
~~~~~~~~

Insert new credential to database

``update``:
~~~~~~~~~~~

Update credential from database

``remove``:
~~~~~~~~~~~

Remove credential from database

``copy``:
~~~~~~~~~

Copy credential password to clipboard

``search``:
~~~~~~~~~~~

Search credentials using regular expression

``status``:
~~~~~~~~~~~

Query database status for maintenance

``export``:
~~~~~~~~~~~

Export credentials as plain text

``import``:
~~~~~~~~~~~

Import credentials

Tutorials
---------

1. Diving into *fullname* syntax
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Passpie fullname syntax handles login and name for credentials in one go
for faster adding and querying.

Structure of a fullname
^^^^^^^^^^^^^^^^^^^^^^^

``login``\ @\ ``name``. Login is optional, however no logins means that
you can add credentials without login by passing only names:

.. code:: bash

passpie add @banks/mybank --password 1234
passpie add @banks/myotherbank --password 5678

Listing the database would show:

.. code:: bash

================= ======= ========== =========
Name Login Password Comment
================= ======= ========== =========
banks/mybank _ *****
banks/myotherbank _ *****
================= ======= ========== =========

2. Syncing your database
~~~~~~~~~~~~~~~~~~~~~~~~

Dropbox
^^^^^^^

With Passpie database on default path ``~/.passpie`` and with a Dropbox
shared directory on path ``~/Dropbox``

.. code:: bash

# move your Passpie database inside your Dropbox directory
mv ~/.passpie ~/Dropbox/.passpie

# create a symbolic link to your shared .passpie directory on the default path.
ln -s ~/Dropbox/.passpie ~/.passpie

Google Drive
^^^^^^^^^^^^

With Passpie database on default path ``~/.passpie`` and with a
GoogleDrive shared directory on path ``~/GoogleDrive``

.. code:: bash

# move your Passpie database inside your Dropbox directory
mv ~/.passpie ~/GoogleDrive/.passpie

# create a symbolic link to your shared .passpie directory on the default path.
ln -s ~/GoogleDrive/.passpie ~/.passpie

3. Exporting/Importing Passpie databases
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: bash

# export database to a passpie database file called passpie.db
# Command: `export`
passpie export passpie.db

# import database from passpie database file called passpie.db
# Option: `import`
passpie import passpie.db

4. Grouping credentials by name
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Passpie credentials handles multiple logins for each name which groups
credentials by name:

.. code:: bash

# create john credential
passpie add jonh@example.com --comment "Jonh main mail"
#Password: **********

# create doe credential
passpie add doe@example.com --comment "No comment"
#Password: **********

# listing credentials
passpie
=========== ======= ========== ===============
name login password comment
=========== ======= ========== ===============
example.com doe ***** No comment
example.com jonh ***** Jonh main email
=========== ======= ========== ===============

5. Using multiple databases
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sometimes it is useful to have multiple databases with different
passphrases for higher security. This can be done using ``-D`` Passpie
option.

Creating databases on a given directory (ex: ``~/databases``)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: bash

# create personal Passpie database
passpie -D ~/databases/personal_passwords init

# create work Passpie database
passpie -D ~/databases/work_passwords init

# create junk Passpie database
passpie -D ~/databases/junk_passwords init

Adding passwords to specific database
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: bash

# add password to personal Passpie database
passpie -D ~/databases/personal_passwords add my@example

# add password to junk Passpie database
passpie -D ~/databases/junk_passwords add other@example

Listing passwords from specific database
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: bash

# listing specific databases
passpie -D ~/databases/junk_passwords

6. Configuring passpie with ``.passpierc``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can override default passpie configuration with a ``.passpierc``
file on your home directory. Passpie configuration files must be written
as a valid `yaml <http://yaml.org/>`__ file.

Example ``.passpierc``:
^^^^^^^^^^^^^^^^^^^^^^^

.. code:: yaml

path: /Users/jon.doe/.passpie
short_commands: true
show_password: false
table_format: fancy_grid
colors:
login: green
name: yellow
password: cyan
headers:
- name
- login
- password
- comment

Options:

- colors: *[black, red, green, yellow, blue, magenta, cyan, white]*
- headers: *[fullname, name, login, password, comment]*
- path: path to database. Default: *~/.passpie*
- table\_format: *[rst, simple, orgtbl, fancy\_grid]*
- short\_commands: Use short commands aliases as in ``passpie a`` for
``passpie add``
- true
- false
- show\_password:
- true
- false

Under The Hood
--------------

Encryption
~~~~~~~~~~

Encryption is done with **GnuGPG** using
`AES256 <http://en.wikipedia.org/wiki/Advanced_Encryption_Standard>`__.
Take a look at
`passpie.crypt <https://github.com/marcwebbie/passpie/blob/master/passpie/crypt.py>`__
module to know more.

Database Path
~~~~~~~~~~~~~

The default database path is at ``~/.passpie``. If you want to change
the database path, add ``--database`` option to passpie. Together with
``init`` you can create arbitrary databases.

.. code:: bash

passpie --database "/path/to/another/database/" init

Database structure
~~~~~~~~~~~~~~~~~~

Passpie database is structured in a directory hierachy. Every credential
is a ``.pass`` file inside a directory named after a credential group.

An empty database would look like this:

.. code:: bash

passpie --database /tmp/passpie init

tree /tmp/passpie -la
# /tmp/passpie
# └── .keys

After adding a new credential the database would look like this:

.. code:: bash

passpie --database /tmp/passpie add octocat@github.com
# Password: **********

tree /tmp/passpie -la
# /tmp/passpie
# ├── .keys
# └── github.com
# └── octocat.pass

If we add more credentials to group github.com. Directory structure
would be:

.. code:: bash

passpie --database /tmp/passpie add octocat2@github.com
# Password: **********

tree /tmp/passpie -la
# /tmp/passpie
# ├── .keys
# └── github
# └── octocat.pass
# └── octocat2.pass

Contributing
------------

Feel free to comment, open a bug report or ask for new features on
Passpie `issues <https://github.com/marcwebbie/passpie/issues>`__ page
or over `Twitter <https://twitter.com/marcwebbie>`__.

If you want to contributing with code:

- Fork the repository https://github.com/marcwebbie/passpie/fork
- Read the
`Makefile <https://github.com/marcwebbie/passpie/blob/master/Makefile>`__

Common issues
-------------

Running passpie init raises ``TypeError: init() got an unexpected keyword argument 'binary'``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You probably have the unexpected ``python-gnupg`` package installed.
Passpie depends on `isislovecruft <https://github.com/isislovecruft>`__
fork of `python-gnupg <https://github.com/isislovecruft/python-gnupg>`__

To fix:

::

pip uninstall python-gnupg
pip install -U passpie

License (`MIT License <http://choosealicense.com/licenses/mit/>`__)
-------------------------------------------------------------------

The MIT License (MIT)

Copyright (c) 2014-2015 Marc Webbie, http://github.com/marcwebbie

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

.. |pypi| image:: https://img.shields.io/pypi/v/passpie.svg?style=flat-square&label=latest%20version
:target: https://pypi-hypernode.com/pypi/passpie
.. |unix\_build| image:: https://img.shields.io/travis/marcwebbie/passpie/master.svg?style=flat-square&label=unix%20build
:target: https://travis-ci.org/marcwebbie/passpie
.. |windows\_build| image:: https://img.shields.io/appveyor/ci/marcwebbie/marcwebbie.svg?style=flat-square&label=windows%20build
:target: https://ci.appveyor.com/project/marcwebbie/passpie
.. |coverage| image:: https://img.shields.io/coveralls/marcwebbie/passpie/master.svg?style=flat-square
:target: https://coveralls.io/r/marcwebbie/passpie
.. |Bitdeli Badge| image:: https://d2weczhvl823v0.cloudfront.net/marcwebbie/passpie/trend.png
:target: https://bitdeli.com/free

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

passpie-0.1rc1.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

passpie-0.1rc1-py2.py3-none-any.whl (24.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file passpie-0.1rc1.tar.gz.

File metadata

  • Download URL: passpie-0.1rc1.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for passpie-0.1rc1.tar.gz
Algorithm Hash digest
SHA256 71df68f5b996bcb7cfb303e7619c3fff18e346321c79a972ffe4eaba92dbf35f
MD5 415e6ca9ffd1431427243c3f5b685289
BLAKE2b-256 388390f8320bd4d98b877b411b45ded5628fa2e10c68895559872107fa48ccb7

See more details on using hashes here.

Provenance

File details

Details for the file passpie-0.1rc1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for passpie-0.1rc1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5ffc49d6ee665de6b8ac2ecd1a398ccc779572794215a01d2fdbca0a4fa0419e
MD5 d551a1c58c61cb6f88471313ec2cf6eb
BLAKE2b-256 1cf4aa531afbbbabede4c6a9329ee9e1e5028dffc0c0e82061de8a3c0332085b

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page