Skip to main content

Any asdf tool

Omni supports any tool that asdf supports. The asdf installation of omni is in its own directory, and won't conflict with any installation of asdf you might have on your system.

Using any asdf tool simply requires to add an up operation with the name of the tool. For instance, using terraform will install terraform using asdf.

Some of the asdf tools are enhanced with additional features and will thus have their own documentation page, such as rust, go, node, python and ruby.

Parameters

The following parameters can be used:

ParameterTypeDescription
dirpathRelative path (or list of relative paths) to the directory in the project for which to use the node version
urlstringThe URL to download the tool from, in case the tool is not registered in asdf-plugins or if you want to use a custom version.
versionstringThe version of the tool to install; see version handling below for more details.

Version handling

The following strings can be used to specify the version:

VersionMeaning
1.2Accepts 1.2 and any version prefixed by 1.2.*
1.2.3Accepts 1.2.3 and any version prefixed by 1.2.3.*
~1.2.3Accepts 1.2.3 and higher patch versions (1.2.4, 1.2.5, etc. but not 1.3.0)
^1.2.3Accepts 1.2.3 and higher minor and patch versions (1.2.4, 1.3.1, 1.4.7, etc. but not 2.0.0)
>1.2.3Must be greater than 1.2.3
>=1.2.3Must be greater or equal to 1.2.3
<1.2.3Must be lower than 1.2.3
<=1.2.3Must be lower or equal to 1.2.3
1.2.xAccepts 1.2.0, 1.2.1, etc. but will not accept 1.3.0
*Matches any version (will default to latest)
latestLatest release
autoLookup for any version files in the project directory (.tool-versions, .node-version, .nodejs-version, package.json or .nvmrc) and apply version parsing

The version also supports the || operator to specify ranges. This operator is not compatible with the latest and auto keywords. For instance, 1.2.x || >1.3.5 <=1.4.0 will match any version between 1.2.0 included and 1.3.0 excluded, or between 1.3.5 excluded and 1.4.0 included.

The latest version satisfying the requirements will be installed.

Examples

For a tool named, <tool>, the following examples can be used:

up:
# Will install the latest version of node
- <tool>

# And also
- <tool>: latest

# Let omni lookup for version files in the project
- <tool>: auto

# Will install any version starting with 20.3, and containing
# only dots and numbers after
- <tool>: 20.3

# Will install any version starting with 20, and containing only
# dots and numbers after
- <tool>: 20

# Full specification of the parameter to identify the version;
# this will install any version starting with 20.3.1, and
# containing only dots and numbers after
- <tool>:
version: 20.3.1

# Use that version but only in the some/sub/dir directory
- <tool>:
version: 20.3.1
dir: some/sub/dir

# Use a custom URL to download the tool
- <tool>:
url: https://github.com/omnicli/asdf-tool

Dynamic environment

The following variables will be set as part of the dynamic environment.

Environment variableOperationDescription
PATHprependThe bin directory for the loaded version of node