Using ienv

Table of contents

  1. Introduction
  2. Usage
  3. Directory overrides
  4. Configuration
    1. IENV_MIRROR
  5. Directories and files

Introduction

ienv is Inko's official version manager, written in Bash. The installation instructions for ienv can be found on the Install page.

Usage

To install a version of Inko, run the install command:

ienv install 0.1.0

To remove a version:

ienv remove 0.1.0

To list all installed versions:

ienv list

To list all available versions:

ienv known

To remove any temporary data (e.g. the manifest and any downloaded packages):

ienv clean

Setting the default version to use:

ienv default 0.1.0

Running an Inko command using a specific version:

ienv run 0.1.0 -- ivm --version

If you have configured a default version using ienv default, then you can leave out the version when using the run command:

ienv run -- ivm --version

Updating ienv itself:

cd ~/.local/share/ienv
git pull origin master

More information about ienv can be obtained by running ienv --help.

Directory overrides

ienv can automatically use a directory specific version of Inko. To specify a directory specific version, create a file called inko-version and add the desired version to it. For example:

echo '0.1.0' > inko-version

You can then use the run command as follows to use the directory override:

ienv run -- ivm --version

ienv only supports directory for the current working directory, it will not examine any parent directories.

Configuration

ienv can be configured using various environment variables. These variables are best set in a configuration file for your shell, such as ~/.bashrc or ~/.config/fish/config.fish.

IENV_MIRROR

The base URL of the mirror to use for downloading packages. Defaults to https://releases.inko-lang.org/inko.

Directories and files

ienv adheres to the XDG base directory specification. Specifically, it uses the following directories and files:

  • $XDG_DATA_HOME/ienv/installed: the directory containing installed versions.
  • $XDG_CONFIG_HOME/ienv: the directory containing various configuration files.
  • $XDG_CACHE_HOME/ienv: the directory containing temporary files, such as downloaded archives and a local copy of the package manifest.
  • $XDG_CONFIG_HOME/ienv/inko-version: a simple text file containing the default version to use.