robertknight / passcards

A 1Password-compatible command-line and web-based password manager
robertknight.github.io/passcards
BSD 3-Clause "New" or "Revised" License
138 stars 5 forks source link

Can there be a short usage example in the readme? #53

Open serapath opened 9 years ago

serapath commented 9 years ago

I installed the chrome extension and it works. I installed the module from npm npm install passcards but don't know how to use it and couldn't find documentation.

Later, i found npm install passcards -g on the projects website, but it's unclear to me how to use it exactly... $> passcards

usage: passcards [-h] [-v VAULT] [-d]

                 {list,show,lock,copy,add,edit,trash,restore,set-password,remove,gen-password,new-vault,repair}
                 ...
passcards: error: too few arguments

Is there some documentation how those work?

I then tried to access the website from a locally running server, using http-server, but I get a blank page.

$> http-server

Starting up http-server, serving ./ on: http://0.0.0.0:8080

But navigating to http://0.0.0.0:8080/webui/index.html gives me a blank page which contains

<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <title>passcards</title>
    <script src="dist/scripts/platform_bundle.js"></script>
    <script src="dist/scripts/webui_bundle.js"></script>
    <link rel="stylesheet" href="dist/style/app.css">
  </head>
  <body>
    <div id="app-view"></div>
</body></html>

and the only error in the terminal is:

index.html:11 GET http://0.0.0.0:8080/webui/dist/style/app.css

There is no 'dist' folder and the make all gives me

make all
make: *** No rule to make target `node_modules/dropbox/package.json', needed by `node_modules/dropbox/lib/dropbox.js'.  Stop.

I would prefer running something like $> passcards --serve

Running passcards on http://localhost:8000/webui/index.html

and instead of make all maybe there could be npm run build instead?

Would also be great to utilize stored passwords in other node programs by

var passcards = require('passcards')

and then using the passcards API to control all my credentials

It would also be nice, if I could store my data locally instead of using dropbox (maybe I can) and configure the browser extension to make use of my local server running

robertknight commented 9 years ago

Is there some documentation how those work?

That needs work, in particular improving the --help output to something that is easier to understand and generating a nice man page.

Basic usage is as follows:

 /t/passcards-test > passcards -v $HOME/Dropbox/Passcards/Passcards.agilekeychain list
Master password: 
google.co.uk (Login, E1DB)

1 matching item(s) in vault

 /t/passcards-test > passcards -v $HOME/Dropbox/Passcards/Passcards.agilekeychain show google
google.co.uk (Login)

Info:
  ID: E1DB9D260CFA42B3B4CA3B86210BC500
  Updated: Sun Mar 15 2015 19:46:45 GMT+0000 (GMT)
  Location: https://www.google.co.uk/?gfe_rd=cr&ei=tMtfVM6VBcuq8weq-IDADQ

Sections:
  a new section
    new password: eL8-qwL-fGBG

Websites:
  website: https://www.google.co.uk/?gfe_rd=cr&ei=tMtfVM6VBcuq8weq-IDADQ

Form Fields:
  username (0): jim.smith@smith.com
  password (1): V4A-i74-Vn65
 /t/passcards-test >

make all make: *\ No rule to make target node_modules/dropbox/package.json', needed by node_modules/dropbox/lib/dropbox.js'. Stop.

Would also be great to utilize stored passwords in other node programs by var passcards = require('passcards') and then using the passcards API to control all my credentials

Passcards APIs are not stable at the moment, but it is possible to use them in other projects, for example with:

require('es6-collections');

var node_fs = require('passcards/build/lib/vfs/node');
var agile_keychain = require('passcards/build/lib/agile_keychain');

var fs = new node_fs.FileVFS('/home/yourname');
var vault = new agile_keychain.Vault(fs, 'Dropbox/1Password/1Password.agilekeychain');

vault.unlock('<INSERT PASSWORD>').then(function() {
    return vault.listItems();
}).then(function(items) {
    console.log('There are %d items in your vault', items.length);
}).done();
robertknight commented 9 years ago

The instructions for developing the app locally were missing the npm install command which should build the Dropbox library. See https://github.com/robertknight/passcards/blob/master/README.md#development