Quickly initializing tools with ASDF

A quick action for initializing ASDF plugins

Table Of Contents

Today I Explained

If you happen to be leveraging a single plugin strategy for asdf, as a way of consistently managing toolchains, a quick helper that you can make use of to quickly setup plugins is running the command:

[ -f .tool-versions ] && cat .tool-versions | cut -d' ' -f1 | grep "^[^\#]" | xargs -i echo asdf plugin add {} git@github.com:the-aeydr/<SomeName>.git

This is responsible for:

  • Checking that a .tool-versions configuration file is present in the current directory
  • Extract only the tool names (first column in .tool-versions) from the configuration file
  • Iterate over the tools, adding the plugin for all of them