Skip to main content

Quick start

>_ Scala 3 installation

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.

>_ Advanced Installation

Pick the installation method:

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

Check that it runs fine by running its version command:

scala-cli version
>_ Standalone launcher

Script to automatically download and cache standalone scala-cli launcher.

>_ Bootstrapped standalone fat JAR

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.

>_ Shell completions

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 any of the scala-cli install completions command complained that your shell cannot be determined, specify it with --shell

scala-cli install completions --shell bash
>_ Scala.js

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.

>_ Scala Native

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.

>_ Uninstall Scala CLI

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.