asdf/assets/guide_getting-started.md.C3BDv6cZ.lean.js
2024-10-07 13:52:36 +00:00

14 lines
50 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as i,c as a,a2 as e,o as t}from"./chunks/framework.C9NVOr0y.js";const c=JSON.parse('{"title":"Getting Started","description":"","frontmatter":{},"headers":[],"relativePath":"guide/getting-started.md","filePath":"guide/getting-started.md","lastUpdated":1724080713000}'),l={name:"guide/getting-started.md"};function n(h,s,o,p,d,r){return t(),a("div",null,s[0]||(s[0]=[e(`<h1 id="getting-started" tabindex="-1">Getting Started <a class="header-anchor" href="#getting-started" aria-label="Permalink to &quot;Getting Started&quot;"></a></h1><p><code>asdf</code> installation involves:</p><ol><li>Installing dependencies</li><li>Downloading <code>asdf</code> core</li><li>Installing <code>asdf</code></li><li>Installing a plugin for each tool/runtime you wish to manage</li><li>Installing a version of the tool/runtime</li><li>Setting global and project versions via <code>.tool-versions</code> config files</li></ol><h2 id="_1-install-dependencies" tabindex="-1">1. Install Dependencies <a class="header-anchor" href="#_1-install-dependencies" aria-label="Permalink to &quot;1. Install Dependencies&quot;"></a></h2><p>asdf primarily requires <code>git</code> &amp; <code>curl</code>. Here is a <em>non-exhaustive</em> list of commands to run for <em>your</em> package manager (some might automatically install these tools in later steps).</p><table tabindex="0"><thead><tr><th>OS</th><th>Package Manager</th><th>Command</th></tr></thead><tbody><tr><td>linux</td><td>Aptitude</td><td><code>apt install curl git</code></td></tr><tr><td>linux</td><td>DNF</td><td><code>dnf install curl git</code></td></tr><tr><td>linux</td><td>Pacman</td><td><code>pacman -S curl git</code></td></tr><tr><td>linux</td><td>Zypper</td><td><code>zypper install curl git</code></td></tr><tr><td>macOS</td><td>Homebrew</td><td><code>brew install coreutils curl git</code></td></tr><tr><td>macOS</td><td>Spack</td><td><code>spack install coreutils curl git</code></td></tr></tbody></table><div class="tip custom-block"><p class="custom-block-title">Note</p><p><code>sudo</code> may be required depending on your system configuration.</p></div><h2 id="_2-download-asdf" tabindex="-1">2. Download asdf <a class="header-anchor" href="#_2-download-asdf" aria-label="Permalink to &quot;2. Download asdf&quot;"></a></h2><h3 id="official-download" tabindex="-1">Official Download <a class="header-anchor" href="#official-download" aria-label="Permalink to &quot;Official Download&quot;"></a></h3><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clone</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://github.com/asdf-vm/asdf.git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.asdf</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --branch</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> v0.14.1</span></span></code></pre></div><h3 id="community-supported-download-methods" tabindex="-1">Community Supported Download Methods <a class="header-anchor" href="#community-supported-download-methods" aria-label="Permalink to &quot;Community Supported Download Methods&quot;"></a></h3><p>We highly recommend using the official <code>git</code> method.</p><table tabindex="0"><thead><tr><th>Method</th><th>Command</th></tr></thead><tbody><tr><td>Homebrew</td><td><code>brew install asdf</code></td></tr><tr><td>Pacman</td><td><code>git clone https://aur.archlinux.org/asdf-vm.git &amp;&amp; cd asdf-vm &amp;&amp; makepkg -si</code> or use your preferred <a href="https://wiki.archlinux.org/index.php/AUR_helpers" target="_blank" rel="noreferrer">AUR helper</a></td></tr></tbody></table><h2 id="_3-install-asdf" tabindex="-1">3. Install asdf <a class="header-anchor" href="#_3-install-asdf" aria-label="Permalink to &quot;3. Install asdf&quot;"></a></h2><p>There are many different combinations of Shells, OSs &amp; Installation methods all of which affect the configuration here. Expand the selection below that best matches your system.</p><p><strong>macOS users, be sure to read the warning about <code>path_helper</code> at the end of this section.</strong></p><details class="details custom-block"><summary>Bash &amp; Git</summary><p>Add the following to <code>~/.bashrc</code>:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">.</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$HOME</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/.asdf/asdf.sh&quot;</span></span></code></pre></div><p>Completions must be configured by adding the following to your <code>.bashrc</code>:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">.</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$HOME</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/.asdf/completions/asdf.bash&quot;</span></span></code></pre></div></details><details class="details custom-block"><summary>Bash &amp; Git (macOS)</summary><p>If using <strong>macOS Catalina or newer</strong>, the default shell has changed to <strong>ZSH</strong>. Unless changing back to Bash, follow the ZSH instructions.</p><p>Add the following to <code>~/.bash_profile</code>:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">.</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$HOME</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/.asdf/asdf.sh&quot;</span></span></code></pre></div><p>Completions must be configured manually with the following entry in your <code>.bash_profile</code>:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">.</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$HOME</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/.asdf/completions/asdf.bash&quot;</span></span></code></pre></div></details><details class="details custom-block"><summary>Bash &amp; Homebrew</summary><p>Add <code>asdf.sh</code> to your <code>~/.bashrc</code> with:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -e</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;\\n. </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">$(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">brew</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --prefix</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> asdf)/libexec/asdf.sh</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &gt;&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.bashrc</span></span></code></pre></div><p>Completions will need to be <a href="https://docs.brew.sh/Shell-Completion#configuring-completions-in-bash" target="_blank" rel="noreferrer">configured as per Homebrew&#39;s instructions</a> or with the following:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -e</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;\\n. </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">$(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">brew</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --prefix</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> asdf)/etc/bash_completion.d/asdf.bash</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &gt;&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.bashrc</span></span></code></pre></div></details><details class="details custom-block"><summary>Bash &amp; Homebrew (macOS)</summary><p>If using <strong>macOS Catalina or newer</strong>, the default shell has changed to <strong>ZSH</strong>. Unless changing back to Bash, follow the ZSH instructions.</p><p>Add <code>asdf.sh</code> to your <code>~/.bash_profile</code> with:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -e</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;\\n. </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">$(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">brew</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --prefix</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> asdf)/libexec/asdf.sh</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &gt;&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.bash_profile</span></span></code></pre></div><p>Completions will need to be <a href="https://docs.brew.sh/Shell-Completion#configuring-completions-in-bash" target="_blank" rel="noreferrer">configured as per Homebrew&#39;s instructions</a> or with the following:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -e</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;\\n. </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">$(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">brew</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --prefix</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> asdf)/etc/bash_completion.d/asdf.bash</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &gt;&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.bash_profile</span></span></code></pre></div></details><details class="details custom-block"><summary>Bash &amp; Pacman</summary><p>Add the following to <code>~/.bashrc</code>:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">.</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /opt/asdf-vm/asdf.sh</span></span></code></pre></div><p><a href="https://wiki.archlinux.org/title/bash#Common_programs_and_options" target="_blank" rel="noreferrer"><code>bash-completion</code></a> needs to be installed for the completions to work.</p></details><details class="details custom-block"><summary>Fish &amp; Git</summary><p>Add the following to <code>~/.config/fish/config.fish</code>:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">source</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.asdf/asdf.fish</span></span></code></pre></div><p>Completions must be configured manually with the following command:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">mkdir</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -p</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.config/fish/completions</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">and</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ln</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -s</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.asdf/completions/asdf.fish</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.config/fish/completions</span></span></code></pre></div></details><details class="details custom-block"><summary>Fish &amp; Homebrew</summary><p>Add <code>asdf.fish</code> to your <code>~/.config/fish/config.fish</code> with:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -e</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;\\nsource &quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">brew</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --prefix</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> asdf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;/libexec/asdf.fish&quot;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &gt;&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.config/fish/config.fish</span></span></code></pre></div><p>Completions are <a href="https://docs.brew.sh/Shell-Completion#configuring-completions-in-fish" target="_blank" rel="noreferrer">handled by Homebrew for the Fish shell</a>. Friendly!</p></details><details class="details custom-block"><summary>Fish &amp; Pacman</summary><p>Add the following to <code>~/.config/fish/config.fish</code>:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">source</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /opt/asdf-vm/asdf.fish</span></span></code></pre></div><p>Completions are automatically configured on installation by the AUR package.</p></details><details class="details custom-block"><summary>Elvish &amp; Git</summary><p>Add <code>asdf.elv</code> to your <code>~/.config/elvish/rc.elv</code> with:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">mkdir</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -p</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.config/elvish/lib</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">ln</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -s</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.asdf/asdf.elv</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.config/elvish/lib/asdf.elv</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;\\n&quot;&#39;use asdf _asdf; var asdf~ = $_asdf:asdf~&#39;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &gt;&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.config/elvish/rc.elv</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;\\n&quot;&#39;set edit:completion:arg-completer[asdf] = $_asdf:arg-completer~&#39;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &gt;&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.config/elvish/rc.elv</span></span></code></pre></div><p>Completions are automatically configured.</p></details><details class="details custom-block"><summary>Elvish &amp; Homebrew</summary><p>Add <code>asdf.elv</code> to your <code>~/.config/elvish/rc.elv</code> with:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">mkdir</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -p</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.config/elvish/lib</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">ln</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -s</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (brew </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">--prefix</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> asdf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)/libexec/asdf.elv </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">~</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">/.config/elvish/lib/asdf.elv</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;\\n&quot;&#39;use asdf _asdf; var asdf~ = $_asdf:asdf~&#39;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &gt;&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.config/elvish/rc.elv</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;\\n&quot;&#39;set edit:completion:arg-completer[asdf] = $_asdf:arg-completer~&#39;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &gt;&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.config/elvish/rc.elv</span></span></code></pre></div><p>Completions are automatically configured.</p></details><details class="details custom-block"><summary>Elvish &amp; Pacman</summary><p>Add <code>asdf.elv</code> to your <code>~/.config/elvish/rc.elv</code> with:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">mkdir</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -p</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.config/elvish/lib</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">ln</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -s</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /opt/asdf-vm/asdf.elv</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.config/elvish/lib/asdf.elv</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;\\n&quot;&#39;use asdf _asdf; var asdf~ = $_asdf:asdf~&#39;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &gt;&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.config/elvish/rc.elv</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;\\n&quot;&#39;set edit:completion:arg-completer[asdf] = $_asdf:arg-completer~&#39;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &gt;&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.config/elvish/rc.elv</span></span></code></pre></div><p>Completions are automatically configured.</p></details><details class="details custom-block"><summary>ZSH &amp; Git</summary><p>Add the following to <code>~/.zshrc</code>:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">.</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$HOME</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/.asdf/asdf.sh&quot;</span></span></code></pre></div><p><strong>OR</strong> use a ZSH Framework plugin like <a href="https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/asdf" target="_blank" rel="noreferrer">asdf for oh-my-zsh</a> which will source this script and setup completions.</p><p>Completions are configured by either a ZSH Framework <code>asdf</code> plugin or by adding the following to your <code>.zshrc</code>:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># append completions to fpath</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">fpath</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(\${ASDF_DIR}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/completions</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $fpath)</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># initialise completions with ZSH&#39;s compinit</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">autoload</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -Uz</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> compinit</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">compinit</span></span></code></pre></div><ul><li>if you are using a custom <code>compinit</code> setup, ensure <code>compinit</code> is below your sourcing of <code>asdf.sh</code></li><li>if you are using a custom <code>compinit</code> setup with a ZSH Framework, ensure <code>compinit</code> is below your sourcing of the framework</li></ul><p><strong>Warning</strong></p><p>If you are using a ZSH Framework the associated <code>asdf</code> plugin may need to be updated to use the new ZSH completions properly via <code>fpath</code>. The Oh-My-ZSH asdf plugin is yet to be updated, see <a href="https://github.com/ohmyzsh/ohmyzsh/pull/8837" target="_blank" rel="noreferrer">ohmyzsh/ohmyzsh#8837</a>.</p></details><details class="details custom-block"><summary>ZSH &amp; Homebrew</summary><p>Add <code>asdf.sh</code> to your <code>~/.zshrc</code> with:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -e</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;\\n. $(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">brew</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --prefix</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> asdf)/libexec/asdf.sh&quot;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &gt;&gt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> \${ZDOTDIR</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">~}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/.zshrc</span></span></code></pre></div><p><strong>OR</strong> use a ZSH Framework plugin like <a href="https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/asdf" target="_blank" rel="noreferrer">asdf for oh-my-zsh</a> which will source this script and setup completions.</p><p>Completions are configured by either a ZSH Framework <code>asdf</code> or will need to be <a href="https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh" target="_blank" rel="noreferrer">configured as per Homebrew&#39;s instructions</a>. If you are using a ZSH Framework the associated plugin for asdf may need to be updated to use the new ZSH completions properly via <code>fpath</code>. The Oh-My-ZSH asdf plugin is yet to be updated, see <a href="https://github.com/ohmyzsh/ohmyzsh/pull/8837" target="_blank" rel="noreferrer">ohmyzsh/ohmyzsh#8837</a>.</p></details><details class="details custom-block"><summary>ZSH &amp; Pacman</summary><p>Add the following to <code>~/.zshrc</code>:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">.</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /opt/asdf-vm/asdf.sh</span></span></code></pre></div><p>Completions are placed in a ZSH friendly location, but <a href="https://wiki.archlinux.org/index.php/zsh#Command_completion" target="_blank" rel="noreferrer">ZSH must be configured to use the autocompletions</a>.</p></details><details class="details custom-block"><summary>PowerShell Core &amp; Git</summary><p>Add the following to <code>~/.config/powershell/profile.ps1</code>:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">.</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$HOME</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/.asdf/asdf.ps1&quot;</span></span></code></pre></div></details><details class="details custom-block"><summary>PowerShell Core &amp; Homebrew</summary><p>Add <code>asdf.sh</code> to your <code>~/.config/powershell/profile.ps1</code> with:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -e</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;\\n. </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">$(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">brew</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --prefix</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> asdf)/libexec/asdf.ps1</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &gt;&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.config/powershell/profile.ps1</span></span></code></pre></div></details><details class="details custom-block"><summary>PowerShell Core &amp; Pacman</summary><p>Add the following to <code>~/.config/powershell/profile.ps1</code>:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">.</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /opt/asdf-vm/asdf.ps1</span></span></code></pre></div></details><details class="details custom-block"><summary>Nushell &amp; Git</summary><p>Add <code>asdf.nu</code> to your <code>~/.config/nushell/config.nu</code> with:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">&quot;\\n</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$env</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">.ASDF_DIR = (</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$env</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">.HOME | path join &#39;.asdf&#39;)\\n source &quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> +</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ($env.HOME </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> path</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> join</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;.asdf/asdf.nu&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> save</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --append</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $nu</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.config-path</span></span></code></pre></div><p>Completions are automatically configured</p></details><details class="details custom-block"><summary>Nushell &amp; Homebrew</summary><p>Add <code>asdf.nu</code> to your <code>~/.config/nushell/config.nu</code> with:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">&quot;\\n</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$env</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">.ASDF_DIR = (brew --prefix asdf | str trim | into string | path join &#39;libexec&#39;)\\n source &quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> +</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (brew </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">--prefix</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> asdf</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> str</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> trim</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> into</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> string</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> path</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> join</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;libexec/asdf.nu&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> save</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --append</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $nu</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.config-path</span></span></code></pre></div><p>Completions are automatically configured</p></details><details class="details custom-block"><summary>Nushell &amp; Pacman</summary><p>Add <code>asdf.nu</code> to your <code>~/.config/nushell/config.nu</code> with:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">&quot;\\n</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$env</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">.ASDF_DIR = &#39;/opt/asdf-vm/&#39;\\n source /opt/asdf-vm/asdf.nu&quot;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> save</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --append</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $nu</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.config-path</span></span></code></pre></div><p>Completions are automatically configured.</p></details><details class="details custom-block"><summary>POSIX Shell &amp; Git</summary><p>Add the following to <code>~/.profile</code>:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ASDF_DIR</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$HOME</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/.asdf&quot;</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">.</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$HOME</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/.asdf/asdf.sh&quot;</span></span></code></pre></div></details><details class="details custom-block"><summary>POSIX Shell &amp; Homebrew</summary><p>Add <code>asdf.sh</code> to your <code>~/.profile</code> with:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -e</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;\\nexport ASDF_DIR=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">$(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">brew</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --prefix</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> asdf)/libexec/asdf.sh</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &gt;&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.profile</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -e</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;\\n. </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">$(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">brew</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --prefix</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> asdf)/libexec/asdf.sh</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &gt;&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.profile</span></span></code></pre></div></details><details class="details custom-block"><summary>POSIX Shell &amp; Pacman</summary><p>Add the following to <code>~/.profile</code>:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ASDF_DIR</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;/opt/asdf-vm&quot;</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">.</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /opt/asdf-vm/asdf.sh</span></span></code></pre></div></details><p><code>asdf</code> scripts need to be sourced <strong>after</strong> you have set your <code>$PATH</code> and <strong>after</strong> you have sourced your framework (oh-my-zsh etc).</p><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>On macOS, starting a Bash or Zsh shell automatically calls a utility called <code>path_helper</code>. <code>path_helper</code> can rearrange items in <code>PATH</code> (and <code>MANPATH</code>), causing inconsistent behavior for tools that require specific ordering. To workaround this, <code>asdf</code> on macOS defaults to forcily adding its <code>PATH</code>-entries to the front (taking highest priority). This is controllable with the <code>ASDF_FORCE_PREPEND</code> variable.</p></div><p>Restart your shell so that <code>PATH</code> changes take effect. Opening a new terminal tab will usually do it.</p><h2 id="core-installation-complete" tabindex="-1">Core Installation Complete! <a class="header-anchor" href="#core-installation-complete" aria-label="Permalink to &quot;Core Installation Complete!&quot;"></a></h2><p>This completes the installation of the <code>asdf</code> core 🎉</p><p><code>asdf</code> is only useful once you install a <strong>plugin</strong>, install a <strong>tool</strong> and manage its <strong>versions</strong>. Continue the guide below to learn how to do this.</p><h2 id="_4-install-a-plugin" tabindex="-1">4. Install a Plugin <a class="header-anchor" href="#_4-install-a-plugin" aria-label="Permalink to &quot;4. Install a Plugin&quot;"></a></h2><p>For demonstration purposes we will install &amp; set <a href="https://nodejs.org/" target="_blank" rel="noreferrer">Node.js</a> via the <a href="https://github.com/asdf-vm/asdf-nodejs/" target="_blank" rel="noreferrer"><code>asdf-nodejs</code></a> plugin.</p><h3 id="plugin-dependencies" tabindex="-1">Plugin Dependencies <a class="header-anchor" href="#plugin-dependencies" aria-label="Permalink to &quot;Plugin Dependencies&quot;"></a></h3><p>Each plugin has dependencies so we need to check the plugin repo where they should be listed. For <code>asdf-nodejs</code> they are:</p><table tabindex="0"><thead><tr><th>OS</th><th>Dependency Installation</th></tr></thead><tbody><tr><td>Debian</td><td><code>apt-get install dirmngr gpg curl gawk</code></td></tr><tr><td>CentOS/ Rocky Linux/ AlmaLinux</td><td><code>yum install gnupg2 curl gawk</code></td></tr><tr><td>macOS</td><td><code>brew install gpg gawk</code></td></tr></tbody></table><p>We should install dependencies first as some Plugins have post-install hooks.</p><h3 id="install-the-plugin" tabindex="-1">Install the Plugin <a class="header-anchor" href="#install-the-plugin" aria-label="Permalink to &quot;Install the Plugin&quot;"></a></h3><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> plugin</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> add</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nodejs</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://github.com/asdf-vm/asdf-nodejs.git</span></span></code></pre></div><h2 id="_5-install-a-version" tabindex="-1">5. Install a Version <a class="header-anchor" href="#_5-install-a-version" aria-label="Permalink to &quot;5. Install a Version&quot;"></a></h2><p>Now we have a plugin for Node.js we can install a version of the tool.</p><p>We can see which versions are available with <code>asdf list all nodejs</code> or a subset of versions with <code>asdf list all nodejs 14</code>.</p><p>We will just install the <code>latest</code> available version:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nodejs</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> latest</span></span></code></pre></div><div class="tip custom-block"><p class="custom-block-title">Note</p><p><code>asdf</code> enforces exact versions. <code>latest</code> is a helper throughout <code>asdf</code> that will resolve to the actual version number at the time of execution.</p></div><h2 id="_6-set-a-version" tabindex="-1">6. Set a Version <a class="header-anchor" href="#_6-set-a-version" aria-label="Permalink to &quot;6. Set a Version&quot;"></a></h2><p><code>asdf</code> performs a version lookup of a tool in all <code>.tool-versions</code> files from the current working directory up to the <code>$HOME</code> directory. The lookup occurs just-in-time when you execute a tool that <code>asdf</code> manages.</p><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>Without a version listed for a tool execution of the tool will <strong>error</strong>. <code>asdf current</code> will show you the tool &amp; version resolution, or absence of, from your current directory so you can observe which tools will fail to execute.</p></div><h3 id="global" tabindex="-1">Global <a class="header-anchor" href="#global" aria-label="Permalink to &quot;Global&quot;"></a></h3><p>Global defaults are managed in <code>$HOME/.tool-versions</code>. Set a global version with:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> global</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nodejs</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> latest</span></span></code></pre></div><p><code>$HOME/.tool-versions</code> will then look like:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>nodejs 16.5.0</span></span></code></pre></div><p>Some OSs already have tools installed that are managed by the system and not <code>asdf</code>, <code>python</code> is a common example. You need to tell <code>asdf</code> to pass the management back to the system. The <a href="/manage/versions.html">Versions reference section</a> will guide you.</p><h3 id="local" tabindex="-1">Local <a class="header-anchor" href="#local" aria-label="Permalink to &quot;Local&quot;"></a></h3><p>Local versions are defined in the <code>$PWD/.tool-versions</code> file (your current working directory). Usually, this will be the Git repository for a project. When in your desired directory execute:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> local</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nodejs</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> latest</span></span></code></pre></div><p><code>$PWD/.tool-versions</code> will then look like:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>nodejs 16.5.0</span></span></code></pre></div><h3 id="using-existing-tool-version-files" tabindex="-1">Using Existing Tool Version Files <a class="header-anchor" href="#using-existing-tool-version-files" aria-label="Permalink to &quot;Using Existing Tool Version Files&quot;"></a></h3><p><code>asdf</code> supports the migration from existing version files from other version managers. Eg: <code>.ruby-version</code> for the case of <code>rbenv</code>. This is supported on a per-plugin basis.</p><p><a href="https://github.com/asdf-vm/asdf-nodejs/" target="_blank" rel="noreferrer"><code>asdf-nodejs</code></a> supports this via both <code>.nvmrc</code> and <code>.node-version</code> files. To enable this, add the following to your <code>asdf</code> configuration file <code>$HOME/.asdfrc</code>:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>legacy_version_file = yes</span></span></code></pre></div><p>See the <a href="/manage/configuration.html">configuration</a> reference page for more config options.</p><h2 id="guide-complete" tabindex="-1">Guide Complete! <a class="header-anchor" href="#guide-complete" aria-label="Permalink to &quot;Guide Complete!&quot;"></a></h2><p>That completes the Getting Started guide for <code>asdf</code> 🎉 You can now manage <code>nodejs</code> versions for your project. Follow similar steps for each type of tool in your project!</p><p><code>asdf</code> has many more commands to become familiar with, you can see them all by running <code>asdf --help</code> or <code>asdf</code>. The core of the commands are broken into three categories:</p><ul><li><a href="/manage/core.html">core <code>asdf</code></a></li><li><a href="/manage/plugins.html">plugins</a></li><li><a href="/manage/versions.html">versions (of tools)</a></li></ul>`,82)]))}const g=i(l,[["render",n]]);export{c as __pageData,g as default};