Skip to main content

Commands

about

Print details about this application

Accepts option groups: about, verbosity

clean

Clean the workspace

Accepts option groups: bsp file, directories, logging, verbosity, workspace

compile

Compile Scala code

Accepts option groups: compilation server, compile, coursier, cross, debug, dependency, directories, help group, input, jvm, logging, markdown, Scala.js, Scala Native, scalac, scalac extra, shared, snippet, verbosity, watch, workspace

dependency-update

Update dependencies in project

Accepts option groups: compilation server, coursier, debug, dependency, dependency update, directories, help group, input, jvm, logging, markdown, Scala.js, Scala Native, scalac, scalac extra, shared, snippet, verbosity, workspace

doc

Generate Scaladoc documentation

Accepts option groups: compilation server, coursier, debug, dependency, directories, doc, help group, input, jvm, logging, markdown, Scala.js, Scala Native, scalac, scalac extra, shared, snippet, verbosity, workspace

doctor

Print details about this application

Accepts option groups: doctor, verbosity

export

Export current project to sbt or Mill

Accepts option groups: compilation server, coursier, debug, dependency, directories, export, help group, input, jvm, logging, main class, markdown, Scala.js, Scala Native, scalac, scalac extra, shared, snippet, verbosity, workspace

fmt

Aliases: format, scalafmt

Format Scala code

Accepts option groups: compilation server, coursier, debug, dependency, directories, fmt, help group, input, jvm, logging, markdown, Scala.js, Scala Native, scalac, scalac extra, shared, snippet, verbosity, workspace

help

Print help message

install completions

Aliases: install-completions

Installs completions into your shell

Accepts option groups: directories, install completions, logging, verbosity

repl

Aliases: console

Fire-up a Scala REPL

Accepts option groups: compilation server, coursier, cross, debug, dependency, directories, help group, input, java, jvm, logging, markdown, python, repl, Scala.js, Scala Native, scalac, scalac extra, shared, snippet, verbosity, watch, workspace

package

Compile and package Scala code

Accepts option groups: compilation server, coursier, cross, debug, dependency, directories, help group, input, java, jvm, logging, main class, markdown, package, packager, Scala.js, Scala Native, scalac, scalac extra, shared, snippet, verbosity, watch, workspace

publish

Accepts option groups: compilation server, coursier, cross, debug, dependency, directories, help group, input, jvm, logging, main class, markdown, publish, publish params, publish repository, Scala.js, Scala Native, scalac, scalac extra, shared, snippet, verbosity, watch, workspace

publish local

Accepts option groups: compilation server, coursier, cross, debug, dependency, directories, help group, input, jvm, logging, main class, markdown, publish, publish params, Scala.js, Scala Native, scalac, scalac extra, shared, snippet, verbosity, watch, workspace

publish setup

Accepts option groups: coursier, debug, directories, input, jvm, logging, pgp push pull, publish params, publish repository, publish setup, verbosity, workspace

run

Compile and run Scala code.

To pass arguments to the application, just add them after --, like:

scala-cli MyApp.scala -- first-arg second-arg

Accepts option groups: benchmarking, compilation server, coursier, cross, debug, dependency, directories, help group, input, java, jvm, logging, main class, markdown, python, run, Scala.js, Scala Native, scalac, scalac extra, shared, snippet, verbosity, watch, workspace

github secret create

Aliases: gh secret create

Accepts option groups: coursier, logging, secret, secret create, verbosity

github secret list

Aliases: gh secret list

Accepts option groups: logging, secret, verbosity

setup-ide

Generate a BSP file that you can import into your IDE

Accepts option groups: bsp file, compilation server, coursier, debug, dependency, directories, help group, input, jvm, logging, markdown, Scala.js, Scala Native, scalac, scalac extra, setup IDE, shared, snippet, verbosity, workspace

shebang

Like run, but more handy from shebang scripts

This command is equivalent to run, but it changes the way scala-cli parses its command-line arguments in order to be compatible with shebang scripts.

Normally, inputs and scala-cli options can be mixed. Program have to be specified after --

scala-cli [command] [scala_cli_options | input]... -- [program_arguments]...

Contrary, for shebang command, only a single input file can be set, all scala-cli options have to be set before the input file, and program arguments after the input file

scala-cli shebang [scala_cli_options]... input [program_arguments]...

Using this, it is possible to conveniently set up Unix shebang scripts. For example:

#!/usr/bin/env -S scala-cli shebang --scala-version 2.13
println("Hello, world)

Accepts option groups: benchmarking, compilation server, coursier, cross, debug, dependency, directories, help group, input, java, jvm, logging, main class, markdown, python, run, Scala.js, Scala Native, scalac, scalac extra, shared, snippet, verbosity, watch, workspace

test

Compile and test Scala code

Accepts option groups: compilation server, coursier, cross, debug, dependency, directories, help group, input, java, jvm, logging, markdown, Scala.js, Scala Native, scalac, scalac extra, shared, snippet, test, verbosity, watch, workspace

uninstall

Uninstall scala-cli - only works when installed by the installation script

Accepts option groups: compilation server, coursier, directories, logging, uninstall, uninstall completions, verbosity

uninstall completions

Aliases: uninstall-completions

Uninstalls completions from your shell

Accepts option groups: logging, uninstall completions, verbosity

update

Update scala-cli - only works when installed by the installation script

Accepts option groups: update, verbosity

version

Print scala-cli version

Accepts option groups: verbosity, version

Hidden commands

add-path

Accepts option groups: add path, verbosity

bloop

Accepts option groups: bloop, compilation server, coursier, debug, directories, jvm, logging, verbosity

bloop exit

Accepts option groups: compilation server, coursier, directories, logging, verbosity

bloop output

Accepts option groups: compilation server, directories, logging, verbosity

bloop start

Accepts option groups: bloop start, compilation server, coursier, debug, directories, jvm, logging, verbosity

bsp

Start BSP server

Accepts option groups: bsp, compilation server, coursier, debug, dependency, directories, help group, input, jvm, logging, markdown, Scala.js, Scala Native, scalac, scalac extra, shared, snippet, verbosity, workspace

config

Accepts option groups: config, coursier, debug, directories, jvm, logging, verbosity

default-file

Accepts option groups: default file, logging, verbosity

directories

Prints directories used by scala-cli

Accepts option groups: directories, verbosity

install-home

Install scala-cli in a sub-directory of the home directory

Accepts option groups: install home, verbosity

browse

Aliases: metabrowse

Browse Scala code and its dependencies in the browser

Accepts option groups: compilation server, coursier, debug, dependency, directories, help group, input, jvm, logging, markdown, metabrowse, Scala.js, Scala Native, scalac, scalac extra, shared, snippet, verbosity, workspace

pgp pull

Accepts option groups: logging, pgp pull, pgp push pull, verbosity

pgp push

Accepts option groups: coursier, debug, jvm, logging, pgp push, pgp push pull, verbosity

pgp create

Create PGP key pair

Accepts option groups: pgp create

pgp key-id

Accepts option groups: pgp key id

pgp sign

Sign files with PGP

Accepts option groups: pgp sign

pgp verify

Verify PGP signatures

Accepts option groups: pgp verify