asdf icon indicating copy to clipboard operation
asdf copied to clipboard

Feature request: Add easier shell integration with a subcommand that can be used in eval statement

Open onnimonni opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe

There's so many multiple ways to enable asdf for different shells.

For example I'm interested in replacing nodenv with asdf in the company I'm now working.

In our project readme we have now the following steps:

Add the following line to your shell's rc/profile file and restart your shell: eval "$(nodenv init -)"

Which is much cleaner than checking if people are using bash/zsh/fish separately and providing multiple installation steps like we need with asdf.

Describe the proposed solution

Add init subcommand to asdf which prints out the paths or commands that can be added for corresponding shell.

This is how nodenv works:

Example output using fish shell

$ nodenv init
# Load nodenv automatically by appending
# the following to ~/.config/fish/config.fish:

status --is-interactive; and source (nodenv init -|psub)

Example output using bash:

$ nodenv init
# Load nodenv automatically by appending
# the following to ~/.bash_profile:

eval "$(nodenv init -)"

Describe similar asdf features and why they are not sufficient

The third section in getting started page is sufficient but this would make the adoption little bit smoother.

Describe other workarounds you've considered

Pointing people to asdf getting started page from our documentation.

onnimonni avatar Jan 20 '22 18:01 onnimonni

@jthegedus @Stratus3D do either (or both) of you have interest in this? I don't want to implement this if there is no desire for it.

hyperupcall avatar Sep 27 '23 22:09 hyperupcall

Tackling this would make asdf easier to package for distros. Related to #1343, #666.

hyperupcall avatar Sep 30 '23 18:09 hyperupcall