Installation
Install Scala CLI with WinGet by running the following one-line command in your terminal:
winget install virtuslab.scalacliRun the following one-line command in your terminal:
curl -sSLf https://scala-cli.virtuslab.org/get | shInstall Scala CLI with Homebrew by running the following one-line command in your terminal:
brew install scala-cliAdd the scala-cli-setup action to your workflow:
steps:
- uses: coursier/cache-action@v8
- uses: VirtusLab/scala-cli-setup@1
If you install Scala 3.5.0 or newer on your machine, you can use Scala CLI under the scala command.
For Scala 3 installation instructions refer here.
Note that even when installing the latest Scala 3 version, its scala command may refer to an older Scala CLI version.
For the latest stable Scala CLI release it usually is necessary to install it separately.
Pick the installation method:
For the x86_64 architecture, download the launcher from GitHub release assets with
curl -fL https://github.com/Virtuslab/scala-cli/releases/latest/download/scala-cli-x86_64-pc-linux.gz | gzip -d > scala-cli
chmod +x scala-cli
sudo mv scala-cli /usr/local/bin/scala-cli
For the ARM64 (aarch64) architecture, use:
curl -fL https://github.com/Virtuslab/scala-cli/releases/latest/download/scala-cli-aarch64-pc-linux.gz | gzip -d > scala-cli
chmod +x scala-cli
sudo mv scala-cli /usr/local/bin/scala-cli
Check that it runs fine by running its version command:
scala-cli version
Scala CLI can be installed via apt packager tool.
The apt package is only available for x86_64. On ARM64 (aarch64), use the manual installation instead.
sudo mkdir -p /etc/apt/keyrings
curl -sS "https://virtuslab.github.io/scala-cli-packages/scala-cli-archive-keyring.gpg" | sudo tee /etc/apt/keyrings/scala-cli-archive-keyring.gpg > /dev/null
sudo curl -s --compressed -o /etc/apt/sources.list.d/scala_cli_packages.list "https://virtuslab.github.io/scala-cli-packages/debian/scala_cli_packages.list"
sudo apt update
sudo apt install scala-cli
The Debian package is only available for x86_64. On ARM64 (aarch64), use the manual installation instead.
The Debian package can be downloaded at this address.
Alternatively, you can download it and install it manually with:
curl -fLo scala-cli.deb https://github.com/Virtuslab/scala-cli/releases/latest/download/scala-cli-x86_64-pc-linux.deb
sudo dpkg -i scala-cli.deb
Scala CLI can also be installed as part of the Scala language distribution (under the scala command),
which bundles Scala CLI. The Scala Debian package can be downloaded from the assets of the
latest Scala release
(scala3-<version>-x86_64-pc-linux.deb) and installed in the same way.
Scala CLI can be installed via the dnf package manager.
The package is only available for x86_64. On ARM64 (aarch64), use the manual installation instead.
cat << EOF | sudo tee /etc/yum.repos.d/virtuslab.repo
[virtuslab-repo]
name=VirtusLab Repo
baseurl=https://virtuslab.github.io/scala-cli-packages/CentOS/Packages
enabled=1
gpgcheck=1
gpgkey=https://virtuslab.github.io/scala-cli-packages/KEY.gpg
EOF
sudo dnf list --repo=virtuslab-repo
sudo dnf install scala-cli
On older systems without dnf (e.g. RHEL/CentOS 7), use yum instead of dnf
(to list the repository packages, use sudo yum repo-pkgs virtuslab-repo list).
The RPM package is only available for x86_64. On ARM64 (aarch64), use the manual installation instead.
The RPM package can be downloaded at this address.
Alternatively, you can download it and install it manually with:
curl -fLo scala-cli.rpm https://github.com/Virtuslab/scala-cli/releases/latest/download/scala-cli-x86_64-pc-linux.rpm
sudo rpm -i scala-cli.rpm
Scala CLI can also be installed as part of the Scala language distribution (under the scala command),
which bundles Scala CLI. The Scala RPM package can be downloaded from the assets of the
latest Scala release
(scala3-<version>-x86_64-pc-linux.rpm) and installed in the same way.
The static launcher is only available for x86_64.
Download the launcher from GitHub release assets with
wget -q -O scala-cli.gz https://github.com/Virtuslab/scala-cli/releases/latest/download/scala-cli-x86_64-pc-linux-static.gz && gunzip scala-cli.gz
chmod +x scala-cli
mv scala-cli /usr/bin/
Check that it runs fine by running its version command:
scala-cli version
This method is provided and supported by the community, not the core team of Scala CLI
Scala CLI can be installed via Nix with:
nix profile install nixpkgs#scala-cli
Without flakes, use nix-env -iA nixpkgs.scala-cli instead (nixos.scala-cli on NixOS).
To try it out without installing, run nix-shell -p scala-cli.
Scala CLI (as scala-cli) can be installed via SDKMAN with:
sdk install scalacli
It can also be installed as part of the Scala language distribution (under the scala command),
which bundles Scala CLI.
sdk install scala
Note that the Windows manual installation requires Visual C++ redistributable to be installed. See below for how to install it.
Download the launcher from GitHub release assets with
curl -fLo scala-cli.zip https://github.com/Virtuslab/scala-cli/releases/latest/download/scala-cli-x86_64-pc-win32.zip
tar -xf scala-cli.zip
Check that it runs fine by running its version command:
scala-cli version
If you get an error about a missing DLL (such as VCRUNTIME140.dll), you have to install
Visual C++ redistributable. A valid version is distributed with the Scala CLI launchers.
You can download it here,
and install it by double-clicking on it. Once the Visual C++ redistributable runtime is installed,
check that the Scala CLI runs fine by running its version command:
scala-cli version
Note that the commands above don't put the scala-cli command in the PATH. For that, you can create a directory, move the
launcher there, and add the directory to the PATH with
md "%USERPROFILE%/scala-cli"
scala-cli --power add-path "%USERPROFILE%/scala-cli"
move scala-cli.exe "%USERPROFILE%/scala-cli"
Download MSI installer with Scala CLI for Windows
Scala CLI for WindowsScala CLI can also be installed as part of the Scala language distribution (under the scala command),
which bundles Scala CLI. The Scala MSI installer can be downloaded from the assets of the
latest Scala release (scala3-<version>.msi).
Scala CLI (as scala-cli) can be installed via SDKMAN with:
sdk install scalacli
It can also be installed as part of the Scala language distribution (under the scala command),
which bundles Scala CLI.
sdk install scala
To install Scala CLI (as scala-cli) via Chocolatey, run the following command from the command line or from PowerShell:
choco install scala-cli
It can also be installed as part of the Scala language distribution (under the scala command),
which bundles Scala CLI.
choco install scala
To install Scala CLI via Scoop, run the following command from the command line or from PowerShell:
scoop install scala-cli
To install Scala CLI via WinGet, run the following command from the command line or from PowerShell:
winget install virtuslab.scalacli
For a Mac with the arm64 architecture run the following commands:
curl -fL https://github.com/Virtuslab/scala-cli/releases/latest/download/scala-cli-aarch64-apple-darwin.gz | gzip -d > scala-cli
chmod +x scala-cli
sudo mkdir -p /usr/local/bin
sudo mv scala-cli /usr/local/bin/scala-cli
Otherwise, for a Mac with non-arm64 architecture (pre-M1) run the following commands:
curl -fL https://github.com/Virtuslab/scala-cli/releases/latest/download/scala-cli-x86_64-apple-darwin.gz | gzip -d > scala-cli
chmod +x scala-cli
sudo mkdir -p /usr/local/bin
sudo mv scala-cli /usr/local/bin/scala-cli
Check that it runs fine by running its version command:
scala-cli version
Download the PKG installer with Scala CLI for MacOS
Scala CLI for arm64The installer isn't signed, so macOS blocks it when you first open it. Close the warning, then go to System Settings → Privacy & Security and click Open Anyway. On macOS 14 and older, you can instead right-click the downloaded file in Finder and choose "Open".
The installer links scala-cli into /usr/local/bin. If that directory doesn't exist, create it before installing with:
sudo mkdir -p /usr/local/bin
Scala CLI (as scala-cli) can be installed via homebrew with:
brew install scala-cli
It can also be installed as part of the Scala language distribution (under the scala command).
scala-cli is then pulled as a dependency.
brew install scala
This method is provided and supported by the community, not the core team of Scala CLI
Scala CLI can be installed via Nix with:
nix profile install nixpkgs#scala-cli
Without flakes, use nix-env -iA nixpkgs.scala-cli instead (nixos.scala-cli on NixOS).
To try it out without installing, run nix-shell -p scala-cli.
Scala CLI (as scala-cli) can be installed via SDKMAN with:
sdk install scalacli
It can also be installed as part of the Scala language distribution (under the scala command),
which bundles Scala CLI.
sdk install scala
FreeBSD support (and support for other BSDs) is currently experimental and not stable. Scala CLI is not being distributed for FreeBSD, but you can install it via Coursier's standalone JAR.
Before running Coursier and installing Scala CLI, make sure you have Java 17 or higher installed and in your $PATH:
pkg install openjdk17
Note: Java 17 has to be installed manually on BSD systems at this time.
Download Coursier via the Any JAR option.
After downloading Coursier, you can use it to install Scala CLI:
chmod +x coursier
./coursier install scala-cli
Scala CLI is now installed on your system. It is installed as a JAR rather than a native binary, and so the startup time is slightly longer.
To run scala-cli anywhere on your system, you need to add its binary path to the $PATH variable. For a given user-directory:
export PATH="$PATH:/home/user-directory/.local/share/coursier/bin"
Add this command to your shell's RC file to make the setting permanent.
Depending on the Java distribution you are using, it has been observed that Bloop (the build server used by Scala CLI) may have trouble starting on FreeBSD. You may try to customise Bloop JVM options with the BLOOP_JAVA_OPTS environment variable. Alternatively, you may skip using the build server altogether and use the compiler directly by passing the --server=false option. Please note that doing this will noticably extend project build times.
scala-cli run -e 'println("Hello FreeBSD")' --server=false
Any features relying on third-party JVMs (such as --jvm and package --native-image) may not work on FreeBSD, as those JVMs may not have BSD distributions provided. They may be made to work when a compatible JVM path is provided directly (refer to individual sub-commands' --help).
Script to automatically download and cache standalone Scala CLI launcher.
Download the Scala CLI launcher in your project directory:
curl https://raw.githubusercontent.com/VirtusLab/scala-cli/refs/heads/main/scala-cli.sh > scala && chmod +x scala
We also recommend downloading the corresponding launcher for Windows users:
curl https://raw.githubusercontent.com/VirtusLab/scala-cli/refs/heads/main/scala-cli.bat > scala.bat
Download the Scala CLI launcher in your project directory:
Invoke-WebRequest "https://raw.githubusercontent.com/VirtusLab/scala-cli/refs/heads/main/scala-cli.bat" -OutFile "scala.bat"
We also recommend downloading the corresponding launcher for macOS and Linux users:
Invoke-WebRequest "https://raw.githubusercontent.com/VirtusLab/scala-cli/refs/heads/main/scala-cli.sh" -OutFile "scala"
git add scala
git update-index --chmod=+x scala
In certain restricted environments, jar files may only be accessible through Nexus or a specific Artifactory, making it cumbersome to manually load each dependency and construct the classpath. To simplify this process, run the bootstrapped Scala CLI standalone fat jar using Coursier, follow the command below:
cs launch org.virtuslab.scala-cli:cliBootstrapped:latest.release -M scala.cli.ScalaCli
Alternatively, you can directly download it from the Maven repository here.
Try the completions with
eval "$(scala-cli install completions --env --shell bash)"
scala-cli --<TAB>
Install them on your system with
scala-cli install completions
If the shell cannot be determined, specify it with --shell:
scala-cli install completions --shell bash
Try the completions with
eval "$(scala-cli install completions --env --shell zsh)"
scala-cli --<TAB>
Install them on your system with
scala-cli install completions
If the shell cannot be determined, specify it with --shell:
scala-cli install completions --shell zsh
Try the completions with
scala-cli install completions --env --shell fish | source
scala-cli --<TAB>
Install them on your system with
scala-cli install completions
If the shell cannot be determined, specify it with --shell:
scala-cli install completions --shell fish
To run Scala.js applications Node.js needs to be installed. Scala CLI at this moment does not manage Node.js however it may change in the future.
Clang is required to compile and run Scala Native applications. Using some functionalities known from JDK (like using java.util.zip package) require additional packages to be installed.
Scala Native page contains detailed installation guide.
Pick the uninstallation method:
If Scala CLI was installed via the installation script, you can uninstall it with:
scala-cli uninstall
If you have installed Scala CLI completions into your shell, uninstall command uninstalls them by running uninstall-completions command under the hood.
If Scala CLI was installed manually you can uninstall it with:
sudo rm /usr/local/bin/scala-cli
If Scala CLI was installed via apt you can uninstall it with:
sudo apt purge scala-cli
If Scala CLI was installed via dpkg you can uninstall it with:
sudo dpkg --remove scala-cli
If Scala CLI was installed via dnf you can uninstall it with:
sudo dnf remove scala-cli
On older systems without dnf (e.g. RHEL/CentOS 7), use yum instead of dnf.
If Scala CLI was installed via rpm you can uninstall it with:
sudo rpm -e scala-cli
For Alpine Linux you can uninstall scala-cli with:
rm /usr/bin/scala-cli
If Scala CLI was installed via Nix you can uninstall it with:
nix profile remove scala-cli
If it was installed with nix-env, use nix-env -e scala-cli instead.
If Scala CLI was installed via SDKMAN you can uninstall it with:
sdk uninstall scalacli <version>
Run sdk list scalacli to see the installed versions.
If Scala CLI was installed manually you can uninstall it with:
rmdir /s /q "%USERPROFILE%/scala-cli"
Then remove the %USERPROFILE%\scala-cli entry from the user Path environment variable
(in Settings → System → About → Advanced system settings → Environment Variables).
If Scala CLI was installed via the installer, you can uninstall it in the Control Panel.
To uninstall Scala CLI via Chocolatey, run the following command from the command line or from PowerShell:
choco uninstall scala-cli
If Scala CLI was installed via SDKMAN you can uninstall it with:
sdk uninstall scalacli <version>
Run sdk list scalacli to see the installed versions.
To uninstall Scala CLI via Scoop, run the following command from the command line or from PowerShell:
scoop uninstall scala-cli
To uninstall Scala CLI via WinGet, run the following command from the command line or from PowerShell:
winget uninstall virtuslab.scalacli
If Scala CLI was installed via the installation script, you can uninstall it with:
scala-cli uninstall
If you have installed Scala CLI completions into your shell, uninstall command uninstalls them by running uninstall-completions command under the hood.
If Scala CLI was installed manually you can uninstall it with:
sudo rm /usr/local/bin/scala-cli
If Scala CLI was installed via homebrew you can uninstall it with:
brew uninstall scala-cli
If Scala CLI was installed via the PKG installer, you can uninstall it with:
sudo rm /usr/local/bin/scala-cli
sudo rm -rf /Applications/scala-cli-aarch64-apple-darwin.app
On a Mac with non-arm64 architecture, the application is /Applications/scala-cli-x86_64-apple-darwin.app instead.
If Scala CLI was installed via Nix you can uninstall it with:
nix profile remove scala-cli
If it was installed with nix-env, use nix-env -e scala-cli instead.
If Scala CLI was installed via SDKMAN you can uninstall it with:
sdk uninstall scalacli <version>
Run sdk list scalacli to see the installed versions.