marcosnils / bin

Effortless binary manager
MIT License
648 stars 45 forks source link

Improvements for headless use #102

Open schnatterer opened 3 years ago

schnatterer commented 3 years ago

It would be great to have a non-interactive mode where bin does not prompt.

I'm starting to role out bin to all my machines headlessly, using ansible (bin installation, self management and update; bin install example).

Here it is difficult to install some binaries because of the prompt. This could be worked around with, e.g. echo 4 | bin install ..... But update all managed binaries it is impossible because of different prompts.

So basically I'd love to have two features:

Examples:

marcosnils commented 3 years ago
  • Choosing a binary or binaries via a parameter (that can be passed multiple times for multiple binaries), that evaluates a regex

Yep, we've briefly spoken about this in some other issues. I think this could be a good place to start prototyping and define how the headless UX would look like.

@schnatterer would you like to kick this off?

As a general rule, I'd also like to make sure that we're doinge everything possible in the automatic file detection before changing the UX of the tool. Basically make some progress on https://github.com/marcosnils/bin/issues/67 before jumping into this.

Regardless, brainstorming ideas here I also think it's worth to give it a shot.

skorokithakis commented 1 year ago

I'm not sure if this is the right issue, but there are some very simple things that could be done now (e.g. ignore files with sha256 in the extension). Could some of these improvements be implemented?

marcosnils commented 1 year ago

I'm not sure if this is the right issue, but there are some very simple things that could be done now (e.g. ignore files with sha256 in the extension). Could some of these improvements be implemented?

yep. definitely, I'll have some time during the next days to check this out.

skorokithakis commented 1 year ago

Thank you! I imagine there are a few more things that can be done to weed out various candidates, e.g. man pages, or txt files, etc. Unfortunately, I just threw out my output after upgrading, but I can post some easy pickings next time I do.

Presumably, bin removes those files from consideration and then installs what's left (or lets you choose what to install, if there are more than one candidates left).

marcosnils commented 1 year ago

Yep, the initial approach would be to only list executable files initially and see how it goes from there.

giggio commented 9 months ago

I found that if you create the config file it will not prompt you to select the install location:

# run as root
echo '{ "default_path": "/usr/local/bin", "bins": { } }' > "$HOME"/.config/bin/config.json