Still Working with Ruby
A blog about Ruby updates, tools, editors tweaks, new gems, and random snippets. I also explore edgy parts of Ruby over at Idiosyncratic Ruby.

pws: The ruby-powered command-line password manager

  • stores your passwords in a file on your disk
  • encrypts the file with a master password
  • is designed for every-day-use
  • is written in 234 lines of understandable Ruby code… Read it!
  • is tested with 222 Cucumber steps

This announcement is actually a follow-up of my previous tutorial on how to build a password safe in ruby. Unfortunately, I was not using it and did not update it for quite a while, sorry for that.. But I finally managed to refactor it, so now it comes with specs, colors, new features and thousands of other tweaks and improvements :D

Impression / Usage


Using a Ruby 1.9, do

$ gem install pws


Usage tips

I’ve got the following lines in my ~./bashrc

export PWS="$HOME/.safe/pws"
alias pw='pws'

The first line changes the password file location. In that ~/.safe folder, I actually use git to backup some of my pws files.

The second line allows a handy syntax for getting a password:

$ pw for github
Creative Commons License

Nathan B | January 20, 2012

This looks really great! Now you've got me thinking about an open source competitor to LastPass...

Magesh | January 24, 2012

Wow! good work, i like this a lot :)

Jonathan | January 25, 2012

I was inspired by this to write a quick bash script that uses grep, vim and gpg to act as a password store on a flat file.

Rooby G | January 31, 2012

this a great guide.. I was try this at my home and it work..


Slantory | May 03, 2012

Even though I do know how to develop iphone (and not only) apps I wouldn't guess that it is possible to store the password safely in one file.