CLI Installation

This page explains how to install, upgrade, and uninstall the KXI Command Line Interface (CLI).

The supported Python versions are 3.9, 3.10, 3.11 and 3.12.

Note

If you are using Windows Subsystem for Linux (WSL), we recommend installing wslu to simplify authentication. This utility allows you to open a web browser directly from within WSL. To install wslu, run the following command:

bash

Copy
sudo apt install wslu

Refer to the KX Downloads Portal for the available versions.

Install

Note

Supported platforms: You can set up the CLI on both Windows and Linux.

To install the CLI from the KX Downloads Portal, use one of the following commands with the appropriate credentials.

uv

pipx

pip

Use the UV Package manager for installation. This tool doesn't have any prerequisites. You can install the CLI without Python on your system.

  1. Install UV if you don't already have it. We suggest using winget for windows and brew for MacOS/Linux as they automatically install the tool on the Path.

    • For Windows: winget install uv

    • For macOS/Linux: brew install uv

  2. Install the CLI with UV into a separate 3.11 Python environment:

    Note

    You can configure the CLI to use a different Python version by changing -p 3.11.

    shell

    Copy
    uv tool install -p 3.11 --extra-index-url https://portal.dl.kx.com/assets/pypi kxicli --force

    To install a specific version, run:

    bash

    Copy
    KXI_CLI_VERSION=x.y.z # replace with the version you want to install
    uv tool install -p 3.11 --extra-index-url https://portal.dl.kx.com/assets/pypi kxicli=="$KXI_CLI_VERSION" --force
  1. Ensure you have one of the supported Python versions above on your system.

  2. Install pipx on your system.

  3. Make sure you have the latest version of pipx.

  4. Ensure pipx is running with the expected Python version.

    Note

    Which Python version is pipx using ?

    Check the output of pipx environment look at the value of PIPX_DEFAULT_PYTHON. If this is wrong, download the correct Python version and set the environment variable PIPX_DEFAULT_PYTHON to the location of that Python executable."

    Important

    pipx must be available on your PATH.

    Warning

    If you have previously used pip to install the CLI you must run pip uninstall kxicli before installing with pipx to remove the old version from the PATH

  5. To install the CLI from the KX Downloads Portal, run pipx install as follows:

    bash

    Copy
    pipx install kxicli --pip-args="--no-input --extra-index-url https://portal.dl.kx.com/assets/pypi/" --force

    To install a specific version, run:

    bash

    Copy
    KXI_CLI_VERSION=x.y.z # replace with the version you want to install
    pipx install kxicli --pip-args="--no-input --extra-index-url https://portal.dl.kx.com/assets/pypi/ kxicli==$KXI_CLI_VERSION" --force

If the installation fails, you can run pipx with the --verbose modifier to find more information.

shell

Copy
pipx install kxicli  --verbose --pip-args="--no-input --extra-index-url https://portal.dl.kx.com/assets/pypi/" --force

Warning

This method should only be used by developers familiar with the Python ecosystem.

  1. You need to install Python and the Python package manager pip on your system.

    Note

    Python and pip command names

    python and pip must be available on your PATH. If alternative commands such as python3 are required, update the commands appropriately.

  2. To install the CLI from the KX Downloads Portal, run pip install as follows:

    bash

    Copy
    pip --no-input install --extra-index-url https://portal.dl.kx.com/assets/pypi/ kxicli

    To install a specific version, run:

    bash

    Copy
    KXI_CLI_VERSION=x.y.z # replace with the version you want to install
    pip --no-input install --extra-index-url https://portal.dl.kx.com/assets/pypi/ kxicli==$KXI_CLI_VERSION

If the installation fails, you can run pip with the --verbose modifier to find more information.

shell

Copy
pip --no-input install --verbose --extra-index-url https://portal.dl.kx.com/assets/pypi/ kxicli==$KXI_CLI_VERSION

Once installed, kxi is available for you to execute.

Upgrade

To upgrade the CLI, run one of the following commands as shown in the examples below:

uv

pipx

pip

bash

Copy
uv tool install -p 3.11 --extra-index-url https://portal.dl.kx.com/assets/pypi kxicli --upgrade --force

bash

Copy
pipx upgrade kxicli --pip-args="--no-input --extra-index-url https://portal.dl.kx.com/assets/pypi/ kxicli" --force

bash

Copy
# pass the '--upgrade' flag to pip
pip --no-input install --upgrade --extra-index-url https://portal.dl.kx.com/assets/pypi/ kxicli

Uninstall

To uninstall the CLI, run one of the following commands as in the below examples:

uv

pipx

pip

bash

Copy
uv tool uninstall kxicli

bash

Copy
pipx uninstall kxicli

bash

Copy
pip uninstall kxicli

Air-gapped environments

By default, pip installs dependencies from the internet. To install the CLI in an air-gapped environment, where internet access is restricted, you must download the dependencies on a machine connected to the internet and transfer the dependencies to the air-gapped environment.

  1. Download the CLI and dependencies on an internet-enabled machine

    shell

    Copy
    pip --no-input download -d bundle setuptools wheel --extra-index-url https://portal.dl.kx.com/assets/pypi/ kxicli
    tar -zcf bundle.tar.gz bundle
  2. Copy bundle.tar.gz to your air-gapped environment and run these commands to install it

    shell

    Copy
    tar -zxf bundle.tar.gz
    pip install --no-index --find-links bundle kxicli

Note

The above commands assume the interpreter and system that the dependencies are downloaded on match those of the target environment. If this is not the case, use the --platform, --python-version, --implementation, and --abi options to fetch the dependencies matching the target environment.