Overview
The Scala CLI makes it easier to compile, run, test, and package Scala code.
It can:
- compile Scala code
- run it
- package it as a JAR file, or in formats such as deb, rpm, MSI, ...
- fire up a REPL, letting you quickly play with the code
- compile and run tests suites
... and more!
Scala CLI supports most recent Scala versions (3.x, 2.13.x and 2.12.x), and changing the Scala version as easy as providing the --scala parameter. (See the cookbook for more information.)
As well as compiling and running Scala code with the JVM (the default), Scala CLI also supports Scala.js and Scala Native.
Installation
- macOS
- Linux
- Windows
- GitHub Actions
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 Virtuslab/scala-cli/scala-cliAdd the scala-cli-setup action to your workflow:
steps:
- uses: coursier/cache-action@v6
- uses: VirtusLab/scala-cli-setup@main
Prefer another way to install Scala CLI? See our Advanced installation guide.
What’s next?
Scala-CLI documentation is split into three main sections:
- Getting started, where you learn how to start with Scala CLI
- Commands, where you learn the most important Scala CLI commands
- Guides, where you can read about the core aspects of Scala CLI, and learn how Scala CLI interacts with other tools, like your IDE
- Scala CLI Cookbook, where you can learn how to solve specific problems with Scala CLI
Happy hacking with Scala CLI!
