Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to run core XKPasswd from the command line (enhancement) #70

Open
macLurker opened this issue Mar 12, 2024 · 5 comments
Open
Labels
enhancement New feature or request

Comments

@macLurker
Copy link
Contributor

macLurker commented Mar 12, 2024

@hepabolu noted in another issue that, if we want to automate getting passwords, we should do it from the command line, not the web page.

Please add the ability to get passwords from the command line. Include ability to select:

  1. number of passwords to generate
  2. desired built-in preset config (DEFAULT, WEB32, WEB16, APPLEID, NTLM, SECURITYQ, XKCD)

Output the new passwords to STDOUT or a text file.

@hepabolu
Copy link
Contributor

The intention has been all along to make a separate command line tool from the XKpasswd library, but that works better when all the functionality is there. I prefer to focus on getting the webapp's functionality on par with the old version before focusing on the CLI version.

@hepabolu hepabolu added the enhancement New feature or request label Mar 12, 2024
@bbusschots
Copy link
Contributor

This simple initial CLI proposal makes sense, but I would ask we try keep it as compatible as possible with the Perl CLI's interface: https://github.com/bbusschots/hsxkpasswd/blob/master/bin/hsxkpasswd

Also, to make the code maintainable I feel strongly we should build the CLI on top of a well supported framework for JavaScript CLI apps. I think the following are what we should target:

  1. Commander for the CLI args processing etc
  2. Chalk for colour output
  3. And maybe Conf for config file management

I think we might need to add support for Promises to the core library before we are ready for a CLI.

@bbusschots
Copy link
Contributor

This seems like a good tutorial: https://blog.logrocket.com/creating-a-cli-tool-with-node-js/

@eclipseo
Copy link

eclipseo commented Apr 9, 2024

Is it possible to make a library out of it so people would be able to include it in other projects?

@bbusschots
Copy link
Contributor

Is it possible to make a library out of it so people would be able to include it in other projects?

Definitely — this repo was intended for just the library, but for now it has the web interface in it too to speed up development. Once the site comes out of beta it will be moved to its own repo, and this repo will become just the library. A third repo will also be created for the CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants