Commands
about
​
Print details about this application
Accepts options:
clean
​
Clean the workspace
Accepts options:
compile
​
Compile Scala code
Accepts options:
- compilation server
- compile
- coursier
- cross
- dependency
- directories
- help group
- jvm
- logging
- Scala.js
- Scala Native
- scalac
- shared
- verbosity
- watch
- workspace
doctor
​
Print details about this application
Accepts options:
export
​
Export current project to sbt or Mill
Accepts options:
- compilation server
- coursier
- dependency
- directories
- export
- help group
- jvm
- logging
- main class
- Scala.js
- Scala Native
- scalac
- shared
- verbosity
- workspace
fmt
​
Aliases:
format
scalafmt
Format Scala code
Accepts options:
- compilation server
- coursier
- dependency
- directories
- fmt
- help group
- jvm
- logging
- Scala.js
- Scala Native
- scalac
- shared
- verbosity
- workspace
help
​
Print help message
install completions
​
Aliases:
install-completions
Installs completions into your shell
Accepts options:
console
​
Aliases:
repl
Fire-up a Scala REPL
Accepts options:
- compilation server
- compile cross
- coursier
- dependency
- directories
- help group
- java
- jvm
- logging
- repl
- Scala.js
- Scala Native
- scalac
- shared
- verbosity
- watch
- workspace
package
​
Compile and package Scala code
Accepts options:
- compilation server
- compile cross
- coursier
- dependency
- directories
- help group
- jvm
- logging
- main class
- package
- packager
- Scala.js
- Scala Native
- scalac
- shared
- verbosity
- watch
- workspace
publish
​
Accepts options:
- compilation server
- compile cross
- coursier
- dependency
- directories
- help group
- jvm
- logging
- main class
- publish
- Scala.js
- Scala Native
- scalac
- shared
- verbosity
- watch
- 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 options:
- benchmarking
- compilation server
- compile cross
- coursier
- dependency
- directories
- help group
- java
- jvm
- logging
- main class
- Scala.js
- Scala Native
- scalac
- shared
- verbosity
- watch
- workspace
setup-ide
​
Generate a BSP file that you can import into your IDE
Accepts options:
- bsp file
- compilation server
- coursier
- dependency
- directories
- help group
- jvm
- logging
- Scala.js
- Scala Native
- scalac
- setup IDE
- shared
- 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 options:
- benchmarking
- compilation server
- compile cross
- coursier
- dependency
- directories
- help group
- java
- jvm
- logging
- main class
- Scala.js
- Scala Native
- scalac
- shared
- verbosity
- watch
- workspace
test
​
Compile and test Scala code
Accepts options:
- compilation server
- compile cross
- coursier
- dependency
- directories
- help group
- java
- jvm
- logging
- Scala.js
- Scala Native
- scalac
- shared
- test
- verbosity
- watch
- workspace
update
​
Update scala-cli - it works only for installation script
Accepts options:
version
​
Print scala-cli
version
Accepts options:
Hidden commands​
add-path
​
Accepts options:
bloop exit
​
Accepts options:
bloop start
​
Accepts options:
bsp
​
Start BSP server
Accepts options:
- bsp
- compilation server
- coursier
- dependency
- directories
- help group
- jvm
- logging
- Scala.js
- Scala Native
- scalac
- shared
- verbosity
- workspace
directories
​
Prints directories used by scala-cli
Accepts options:
install-home
​
Install scala-cli
in a sub-directory of the home directory
Accepts options:
browse
​
Aliases:
metabrowse
Browse Scala code and its dependencies in the browser
Accepts options:
- compilation server
- coursier
- dependency
- directories
- help group
- jvm
- logging
- metabrowse
- Scala.js
- Scala Native
- scalac
- shared
- verbosity
- workspace
pgp create
​
Create PGP key pair
Accepts options:
pgp sign
​
Sign files with PGP
Accepts options:
pgp verify
​
Verify PGP signatures
Accepts options: