Xygeni CLI Installation

Xygeni CLI can be used either installing it or by using Xygeni CLI Docker Image.

circle-info

This page specifies how to install CLI. Please visit Xygeni CLI Docker Image if you prefer to use the CLI docker image.

CLI Installation

circle-info

Please see Xygeni CLI Prerequisites before installing.

Install the Scanner

Xygeni provides bootstrap scripts (get-xygeni.sh for mac/Linux, get-xygeni.ps1 for Windows) that download the scanner, verify its SHA-256 checksum, and install it in a single step.

1. Download the bootstrap script

curl -sSfLO https://get.xygeni.io/latest/scanner/get-xygeni.sh

2. Review the script

The script downloads the scanner, verifies its SHA-256 checksum (from a separate source on GitHub), and installs it. You can review its contents — it is intentionally kept short:

set -e
# Download helper: uses curl if available, falls back to wget
fetch() { curl -sSfL "$1" 2>/dev/null || wget -qO- "$1"; }
DIR="${1:-$HOME/.xygeni}"
# Check and exit if already installed
[ -x "$DIR/xygeni" ] && { echo "Xygeni scanner already installed in $DIR" >&2; exit 0; }
ZIP="$(mktemp).zip"
trap 'rm -f "$ZIP"' EXIT
# Download scanner and checksum
fetch https://get.xygeni.io/latest/scanner/xygeni_scanner.zip > "$ZIP"
EXPECT=$(fetch https://raw.githubusercontent.com/xygeni/xygeni/main/checksum/latest/xygeni-release.zip.sha256)
ACTUAL=$(sha256sum "$ZIP" 2>/dev/null || shasum -a 256 "$ZIP")
ACTUAL=$(echo "$ACTUAL" | awk '{print $1}')
# Verify checksum
[ "$EXPECT" = "$ACTUAL" ] || { echo "Checksum mismatch: expected $EXPECT, got $ACTUAL" >&2; exit 1; }
# Extract scanner: uses unzip if available, falls back to jar (Java is required for the scanner)
mkdir -p "$DIR"
unzip -qo "$ZIP" -d "$DIR" 2>/dev/null || (cd "$DIR" && jar xf "$ZIP")
mv "$DIR/xygeni_scanner"/* "$DIR/" && rmdir "$DIR/xygeni_scanner"  # flatten nested dir
echo "Xygeni scanner installed in $DIR"

3. Verify the script checksum

circle-exclamation

If the checksum matches, you will see:

If it does not match, you will see:

triangle-exclamation

4. Run the script

circle-info

The script fetches the checksum from GitHub (raw.githubusercontent.com/xygeni/xygeni) while the scanner zip is downloaded from get.xygeni.io — an attacker would need to compromise both sites to bypass the integrity check.

Fetch your Xygeni API token

circle-info

Active Xygeni account credentials are mandatory to run the script, so make sure you’ve signed up first! Visit Create a Free Trial account or Log in to Xygeni

Go your profile pannelarrow-up-right and navigate to Organization/Personal Tokens:

Create a new token. The difference betweeen Organization tokens and Personal tokens is who can see and revoke those tokens. Select either one and generate a new token.

In order to run scans, the only permission that is needed is the "Upload scan results" permission. However, if you want to use the same token with the REST API, you’ll need to grant it additional permissions.

Set XYGENI_TOKEN environment variable

In order to run scans, a new environment variable must be set, the name of this variable must be "XYGENI_TOKEN" and it content has to be the token that was created in the previous step.

Add this line at the end of the file:

Apply the changes:

circle-info

This will create the XYGENI_TOKEN environment variable for the current user.

In order to execute the Xygeni application as another command, the scanner must be accessible from your shell.

circle-info

This step is optional but highly recommended to facilitate future scans.

Option 1 — Symlink in ~/.local/bin (recommended, if ~/.local/bin is already in PATH):

Option 2 — Shell alias in ~/.bashrc or ~/.zshrc:

Option 3 — Add to PATH (fallback):

circle-info

This will modify the Current User Path.

What’s next?

Congratulations, at this point you should have your installation successfully completed.

Now, let’s run your first scan. Move to your installation directory and execute the command:

Last updated