Skip to content

Instantly share code, notes, and snippets.

@rioki
Created March 25, 2021 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rioki/86ddd54f69ce90fb111664f3d820f2cd to your computer and use it in GitHub Desktop.
Save rioki/86ddd54f69ce90fb111664f3d820f2cd to your computer and use it in GitHub Desktop.

Supergenpass Command Line Interface

This is short CLI to run supergenpass, for when the website is down.

License

This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
http://www.wtfpl.net/ for more details.
// Supergenpass Command Line Interface
// Sean Farrell <sean.farrell@rioki.org>
//
// This program is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What The Fuck You Want
// To Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
const yargs = require('yargs/yargs')
const { hideBin } = require('yargs/helpers')
const sgp = require('supergenpass-lib')
const argv = yargs(hideBin(process.argv)).argv
if (argv._.length != 2) {
console.error("Please specify master password and domain")
}
const masterPassword = argv._[0]
const URI = argv._[1]
const options = {}
if (argv.hashRounds) {
options.hashRounds = argv.hashRounds
}
if (argv.length) {
options.length = argv.length
}
if (argv.method) {
options.method = argv.method
}
if (argv.removeSubdomains) {
options.removeSubdomains = argv.removeSubdomains
}
if (argv.secret) {
options.secret = argv.secret
}
sgp.generate(masterPassword, URI, options, function (password) {
console.log(password)
});
{
"name": "supergenpass",
"version": "1.0.0",
"description": "A script implementing suprgenpass command line interface.",
"main": "index.js",
"dependencies": {
"supergenpass-lib": "^3.0.1",
"yargs": "^16.2.0"
},
"devDependencies": {},
"author": "Sean Farrell <sean.farrell@rioki.org>",
"license": "WTFPL"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment