Coder Social home page Coder Social logo

Comments (8)

nickcanz avatar nickcanz commented on May 28, 2024 1

Thanks for the tip @jhuggart, I'll look into that!

from vulcanizer.

nickcanz avatar nickcanz commented on May 28, 2024

This is a good idea! But unfortunately it doesn't look like it's supported by the https://github.com/spf13/cobra, the cli library that's we're using: spf13/cobra#248

from vulcanizer.

jhuggart avatar jhuggart commented on May 28, 2024

Hey @nickcanz, Good to see you in the wild. I stumbled across this from the cobra issue you referenced above.

I ended up using promptui with cobra to allow input for a handful of fields. It was super easy to wire up. Maybe it'll work for you too.

from vulcanizer.

leosunmo avatar leosunmo commented on May 28, 2024

I wrote up two implementations of this using https://github.com/manifoldco/promptui and Go's builtin golang.org/x/crypto/ssh/terminal terminal.ReadPassword().

manifoldco/promptui implementation
golang.org/x/crypto/ssh/terminal implementation

Binary sizes:

13544298  promptui-vulcanizer
13120932  terminal-vulcanizer

Promptui looks a bit flashier and will obviously open up other possibilities for interactive prompts that we might want in the future, but /x/crypto/ssh/terminal is a lot slimmer.

Promptui allows you to set limits on the password, which might not be interesting for this purpose, but it displays "*" instead of what you type, where as /x/crypto/ssh/terminal just shows nothing at all which can be confusing for some.

@jhuggart If you are still using Vulcanizer, could you check out one of my branches and try it out? I don't have a cluster with auth enabled handy right now so I can't validate if this actually works.

from vulcanizer.

leosunmo avatar leosunmo commented on May 28, 2024

@nickcanz or @jhuggart could you try this out with a password protected cluster?

from vulcanizer.

nickcanz avatar nickcanz commented on May 28, 2024

Sorry about this @leosunmo! Really appreciate your work and I'm going to dedicate some time next week to look at it.

from vulcanizer.

leosunmo avatar leosunmo commented on May 28, 2024

No worries Nick, not in a huge rush, I don't even use the feature. Just very keen to close the last two issues ;)

from vulcanizer.

dshelley66 avatar dshelley66 commented on May 28, 2024

I've used https://github.com/AlecAivazis/survey for various interactive prompts including masked password in a CLI that is built with Cobra.

from vulcanizer.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.