Skip to content

Instantly share code, notes, and snippets.

@rioki
Created Mar 25, 2021
Embed
What would you like to do?

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