Feature request: Add easier shell integration with a subcommand that can be used in eval statement
- Dominant language
- Go
- Stars
- 25.6k
- Forks
- 941
- Avg merge
- 9h 24m
- Merged PRs (30d)
- 3
Description
### 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](https://asdf-vm.com/guide/getting-started.html#_3-install-asdf) 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.
Contributor guide
Research direction
Start by reading the getting started page and the existing shell-specific installation steps. Compare the requested init behavior with the bash and fish nodenv examples, then define how the subcommand should handle the shells supported by asdf. Done means users can follow one eval-style setup command for their shell and the documentation explains the resulting output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, shell
- Domain
- cli, developer-experience
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100