2021-07-22 22:26:21 -07:00
# Plugins
2019-01-12 09:32:30 -07:00
2021-07-22 22:26:21 -07:00
Plugins are how `asdf` knows to handle different tools like Node.js, Ruby, Elixir etc.
See [Creating Plugins ](/plugins/create.md ) for the plugin API used to support more tools.
2019-01-12 09:32:30 -07:00
## Add
2021-06-03 15:26:46 -07:00
Add plugins via their Git URL:
2023-06-17 23:24:47 -07:00
```shell
2021-06-03 15:26:46 -07:00
asdf plugin add < name > < git-url >
# asdf plugin add elm https://github.com/vic/asdf-elm
2019-01-12 09:32:30 -07:00
```
2021-06-03 15:26:46 -07:00
or via the short-name association in the plugins repository:
2019-01-12 09:32:30 -07:00
2023-06-17 23:24:47 -07:00
```shell
2021-06-03 15:26:46 -07:00
asdf plugin add < name >
# asdf plugin add erlang
2019-01-12 09:32:30 -07:00
```
2021-07-22 22:26:21 -07:00
::: tip Recommendation
2022-06-27 16:47:49 -07:00
2021-07-22 22:26:21 -07:00
Prefer the longer `git-url` method as it is independent of the short-name repo.
2022-06-27 16:47:49 -07:00
2021-07-22 22:26:21 -07:00
:::
2021-06-03 15:26:46 -07:00
2019-01-12 09:32:30 -07:00
## List Installed
2023-06-17 23:24:47 -07:00
```shell
2020-01-30 14:59:05 -07:00
asdf plugin list
# asdf plugin list
2019-01-12 09:32:30 -07:00
# java
# nodejs
```
2023-06-17 23:24:47 -07:00
```shell
2020-01-30 14:59:05 -07:00
asdf plugin list --urls
# asdf plugin list
2020-02-09 14:00:41 -07:00
# java https://github.com/halcyon/asdf-java.git
2019-01-12 09:32:30 -07:00
# nodejs https://github.com/asdf-vm/asdf-nodejs.git
```
2021-06-03 15:26:46 -07:00
## List All in Short-name Repository
2023-06-17 23:24:47 -07:00
```shell
2021-06-03 15:26:46 -07:00
asdf plugin list all
```
2021-08-18 19:05:03 -07:00
See [Plugins Shortname Index ](https://github.com/asdf-vm/asdf-plugins ) for the entire short-name list of plugins.
2021-06-03 15:26:46 -07:00
2019-01-12 09:32:30 -07:00
## Update
2023-06-17 23:24:47 -07:00
```shell
2020-01-30 14:59:05 -07:00
asdf plugin update --all
2019-01-12 09:32:30 -07:00
```
If you want to update a specific package, just say so.
2023-06-17 23:24:47 -07:00
```shell
2020-01-30 14:59:05 -07:00
asdf plugin update < name >
# asdf plugin update erlang
2019-01-12 09:32:30 -07:00
```
2021-07-22 22:26:21 -07:00
This update will fetch the _latest commit_ on the _default branch_ of the _origin_ of the plugin repository. Versioned plugins and updates are currently being developed ([#916](https://github.com/asdf-vm/asdf/pull/916))
2021-06-03 15:26:46 -07:00
2019-01-12 09:32:30 -07:00
## Remove
2023-06-17 23:24:47 -07:00
```bash
2020-01-30 14:59:05 -07:00
asdf plugin remove < name >
# asdf plugin remove erlang
2019-01-12 09:32:30 -07:00
```
2021-06-03 15:26:46 -07:00
Removing a plugin will remove all installations of the tool made with the plugin. This can be used as a shorthand for cleaning/pruning many unused versions of a tool.
2022-06-27 16:47:49 -07:00
## Syncing the asdf Short-name Repository
2021-06-03 15:26:46 -07:00
2022-06-27 16:47:49 -07:00
The short-name repo is synced to your local machine and periodically refreshed. This method to determine a sync is as follows:
2021-06-03 15:26:46 -07:00
2022-06-27 16:47:49 -07:00
- sync events are triggered by commands:
- `asdf plugin add <name>`
- `asdf plugin list all`
- if configuration option `disable_plugin_short_name_repository` is set to `yes` , then sync is aborted early. See the [asdf config docs ](/manage/configuration.md ) for more.
2022-07-05 06:40:33 -07:00
- if there has not been a synchronization in the last `X` minutes then the sync will occur.
2022-06-27 16:47:49 -07:00
- `X` defaults to `60` , but can be configured in your `.asdfrc` via the `plugin_repository_last_check_duration` option. See the [asdf config docs ](/manage/configuration.md ) for more.