chshersh / tool-sync

🧰 Download pre-built binaries of all your favourite tools with a single command
https://crates.io/crates/tool-sync
Mozilla Public License 2.0
72 stars 17 forks source link

Support all the fields of the 'ConfigAsset' #91

Open chshersh opened 2 years ago

chshersh commented 2 years ago

Currently, it's possible to install only hardcoded tools without any configuration. It would be nice to have all the fields of the ConfigAsset type be able to specify as CLI flags.

The only challenge — the CLI interface.

It's nice to install a single tool with a command:

tool install xyz

But ConfigAsset has fields repo and exe_name. Which one of them should be the default string argument?


This feature should play nicely with #90 and update the config with all the explicitly specified fields.

crudiedo commented 2 years ago

What if we also allow to provide the default string argument in {owner}/{repo} format and specify exe_name, tag, asset_name as CLI flags?

For example, it would be possible to either use it like tool install xyz (part of the hardcoded db) Or tool install clementtsang/bottom --exe_name btm (not in the hardcoded db yet)

I also though about tool install clementtsang/bottom/btm, but it looks and feels terrible (:

chshersh commented 2 years ago

Or tool install clementtsang/bottom --exe_name btm

This is exactly how I imagine the final API 🙂 Thanks for writing it explicitly!

If it's just tool_name then tool-sync checks among known tools and installs them. Otherwise, it tells the message with suggestion on how to install the tool.

And if you want to install a custom tool, you write i nthe {owner}/{repo} format.

The flags like --exe-name and others should be supported for both tools in case users want to override some default fields).