Skip to main content

Scala CLI is a command-line tool to interact with the Scala language.

It lets you compile, run, test, and package your Scala code (and more!)

gifs/demo.gifgifs/demo.gif
>_ Why Scala CLI?

Scala CLI combines all the features you need to learn and use Scala in your scripts, playgrounds and (single-module) projects.

To get started you can read the documentation, or just install and enjoy scala-cli.

Scala CLI will soon become the default Scala runner and will be shipped as `scala` (read more).

Intuitive, simple
Intuitive, simple
No complicated mechanisms, tasks, plugins or extensions: just a single-module. All our commands have multiple aliases and follow well-known conventions.
Fast
Fast
Scala CLI is optimized to be as fast as possible. CLI is compiled to native code and compilations are offloaded to bloop.
Command-line first
Command-line first
Scala CLI does not require a configuration file, and all in-file configurations can be overridden by command-line. No additional installation or setup of an environment (such as a specific working directory) are required.

Install Scala CLI

Still undecided?

Here come our main features

Scala versions, dependencies and JVMs

Scala CLI is built on top of coursier
This allow us to manage Scala versions, dependencies and JVMs so you can test your code in different environments by changing single option.

Scala CLI ships with all its dependencies
No need to fluff with installing JVM or setting up PATH.

Some additional setup may be required for JS and Native

gifs/versions.gifgifs/versions.gif

Universal tool

If you want to use older version of Scala or run your code in JS or Native environments we've got you covered.

Switching between platforms or Scala versions is as easy as changing a parameter.

Some additional setup may be required for JS and Native

gifs/universal_tool.gifgifs/universal_tool.gif

We do not call Scala CLI a build tool

Scala CLI shares some similarities with build tools, but doesn't aim at supporting multi-module projects, nor to be extended via a task system known from sbt, mill or bazel.

Scala ecosystem has multiple amazing build tools, there is no need to create another multipurpose build tool.

buildtools.pngbuildtools.png

Complete installation

Scala CLI comes with batteries included. No additional installation is required, no more fluffing with setting up the correct Java version or PATH

Scala CLI manages JVMs, Scala and other used tools under the hood.

gifs/complete-install.gifgifs/complete-install.gif

Solid defaults

No additional configuration is needed to most Scala CLI commands.

Scala CLI is configured out of the box to use the latest stable versions and other commands such as formatter or compiler contain reasonable defaults.

gifs/defaults.gifgifs/defaults.gif

No learning curve

Scala CLI does not use complex configuration language, its options are simple and self-explanatory

There are no big differences in running repl or .scala files so expanding the results of repl session into a small project does not require learning new concepts from Scala CLI perspective

gifs/learning_curve.gifgifs/learning_curve.gif

Scripts are as powerful as other programs

Scripts in Scala CLI can use dependencies and other features as standard Scala programs. Scala CLI is command-line first giving access to all its features without need for any configuration file or specific project structure.

gifs/powerful_scripts.gifgifs/powerful_scripts.gif

Embeddable Scripts

Scala CLI can be set up in shebang lines, making your *.scala or *.sc files runnable

Scala CLI supports piping inputs and is designed to be embeddable in other scripts, turning Scala into proper scripting language

gifs/embeddable_scripts.gifgifs/embeddable_scripts.gif

Self-contained examples

With Scala CLI, configuration can be included in source code so complex examples can be self-contained and shipped as e.g. gist. Moreover, Scala CLI can compile, run and test gists without any manual work!

Scala CLI is a perfect tool to submit and reproduce bugs

gifs/self-contained-examples.gifgifs/self-contained-examples.gif