title | sidebar_position |
---|---|
Command-line options [in scala command] |
1 |
This is a summary of options that are available for each subcommand of the scala-cli
command.
Available in commands:
bsp
, compile
, dependency-update
, doc
, fmt
, format
, scalafmt
, console
, repl
, run
, setup-ide
, shebang
, test
, uninstall
[Internal] Protocol to use to open a BSP connection with Bloop
[Internal] Socket file to use to open a BSP connection with Bloop
[Internal] Host the compilation server should bind to
[Internal]
Port the compilation server should bind to (pass -1
to pick a random port)
[Internal] Daemon directory of the Bloop daemon (directory with lock, pid, and socket files)
[Internal] If Bloop isn't already running, the version we should start
[Internal] Maximum duration to wait for the BSP connection to be opened
[Internal] Duration between checks of the BSP connection state
[Internal] Maximum duration to wait for the compilation server to start up
[Internal] Include default JVM options for Bloop
[Internal] Pass java options to use by Bloop server
[Internal] Bloop global options file
[Internal] JVM to use to start Bloop (e.g. 'system|11', 'temurin:17', …)
[Internal] Working directory for Bloop, if it needs to be started
Enable / disable usage of Bloop compilation server. Bloop is used by default so use --server:false
to disable it. Disabling compilation server allows to test compilation in more controlled mannter (no caching or incremental compiler) but has a detrimental effect of performance.
Available in commands:
Aliases: -p
, --classpath
Print the resulting class path
Aliases: --output-directory
Copy compilation results to output directory using either relative or absolute path
Compile test scope
Available in commands:
bsp
, compile
, dependency-update
, doc
, fmt
, format
, scalafmt
, console
, repl
, run
, setup-ide
, shebang
, test
Aliases: --dep
, -d
Add dependencies
Aliases: --repo
, -r
Add repositories
Aliases: -P
, --plugin
Add compiler plugin dependencies
Available in commands:
Update all dependencies if newer version was released
Available in commands:
bsp
, clean
, compile
, dependency-update
, doc
, fmt
, format
, scalafmt
, install completions
, install-completions
, console
, repl
, run
, setup-ide
, shebang
, test
, uninstall
Aliases: --home
Available in commands:
Aliases: -o
Set the destination path
Aliases: -f
Overwrite the destination directory, if it exists
Aliases: --default-scaladoc-opts
Control if scala CLI should use default options for scaladoc, true by default. Use --default-scaladoc-opts:false
to not include default options.
Available in commands:
Check if sources are well formatted
Use project filters defined in the configuration. Turned on by default, use --respect-project-filters:false
to disable it.
Saves .scalafmt.conf file if it was created or overwritten
Aliases: --fmt-help
Show help for scalafmt. This is an alias for --scalafmt-arg -help
[Internal]
[Internal]
[Internal]
[Internal]
[Internal]
Aliases: -F
Pass argument to scalafmt.
Aliases: --scalafmt-config
Custom path to the scalafmt configuration file.
Aliases: --scalafmt-config-str
, --scalafmt-conf-snippet
Pass configuration as a string.
Aliases: --dialect
Pass a global dialect for scalafmt. This overrides whatever value is configured in the .scalafmt.conf file or inferred based on Scala version used.
Aliases: --fmt-version
Pass scalafmt version before running it. This overrides whatever value is configured in the .scalafmt.conf file.
Available in commands:
about
, bsp
, clean
, compile
, dependency-update
, doc
, doctor
, fmt
, format
, scalafmt
, help
, install completions
, install-completions
, console
, repl
, run
, setup-ide
, shebang
, test
, uninstall
, uninstall completions
, uninstall-completions
, update
, version
Print usage and exit
Aliases: -h
, -help
Print help message and exit
Aliases: --full-help
Print help message, including hidden options, and exit
Available in commands:
bsp
, compile
, dependency-update
, doc
, fmt
, format
, scalafmt
, console
, repl
, run
, setup-ide
, shebang
, test
Show options for ScalaJS
Show options for ScalaNative
Available in commands:
install completions
, install-completions
Aliases: --shell
Name of the shell, either zsh or bash
Path to *rc
file, defaults to .bashrc
or .zshrc
depending on shell
Aliases: -o
Completions output directory
[Internal] Custom banner in comment placed in rc file
[Internal] Custom completions name
Print completions to stdout
Available in commands:
console
, repl
, run
, shebang
, test
Aliases: -J
Set Java options, such as -Xmx1g
Set Java properties
Available in commands:
bsp
, compile
, dependency-update
, doc
, fmt
, format
, scalafmt
, console
, repl
, run
, setup-ide
, shebang
, test
Set the Java home directory
Aliases: -j
Use a specific JVM, such as 14
, adopt:11
, or graalvm:21
, or system
[Internal] JVM index URL
[Internal] Operating system to use when looking up in the JVM index
[Internal] CPU architecture to use when looking up in the JVM index
[Internal] Javac plugin dependencies or files
Aliases: --javac-opt
[Internal] Javac options
[Internal] Port for BSP debugging
Available in commands:
bsp
, clean
, compile
, dependency-update
, doc
, fmt
, format
, scalafmt
, install completions
, install-completions
, console
, repl
, run
, setup-ide
, shebang
, test
, uninstall
, uninstall completions
, uninstall-completions
Aliases: -q
Decrease verbosity
Use progress bars
Available in commands:
Aliases: -M
Specify which main class to run
Aliases: --main-class-list
, --list-main-class
, --list-main-classes
List main classes available in the current context
Available in commands:
Print the command that would have been run (one argument per line), rather than running it
Temporary / working directory where to write generated launchers
[Internal] Run Java commands using a manifest-based class path (shortens command length)
Available in commands:
bsp
, compile
, dependency-update
, doc
, fmt
, format
, scalafmt
, console
, repl
, run
, setup-ide
, shebang
, test
Enable Scala.js. To show more options for Scala.js pass --help-js
The Scala.js version
The Scala.js mode, either dev
or release
The Scala.js module kind: commonjs/common, esmodule/es, nomodule/none
Emit source maps
Set the destination path of source maps
Enable jsdom
A header that will be added at the top of generated .js files
Primitive Longs may be compiled as primitive JavaScript bigints
Avoid class'es when using functions and prototypes has the same observable semantics.
Avoid lets and consts when using vars has the same observable semantics.
The Scala.js module split style: fewestmodules, smallestmodules, smallmodulesfor
Create as many small modules as possible for the classes in the passed packages and their subpackages.
The Scala.js ECMA Script version: es5_1, es2015, es2016, es2017, es2018, es2019, es2020, es2021
[Internal] Path to the Scala.js linker
[Internal] Scala.js CLI version to use for linking
[Internal] Scala.js CLI Java options
[Internal] Whether to run the Scala.js CLI on the JVM or using a native executable
Available in commands:
bsp
, compile
, dependency-update
, doc
, fmt
, format
, scalafmt
, console
, repl
, run
, setup-ide
, shebang
, test
Enable Scala Native. To show more options for Scala Native pass --help-native
Set the Scala Native version
Set Scala Native compilation mode
Set the Scala Native garbage collector
Path to the Clang command
Path to the Clang++ command
Extra options passed to clang
verbatim during linking
[Internal] Use default linking settings
List of compile options
[Internal] Use default compile options
Available in commands:
bsp
, compile
, dependency-update
, doc
, fmt
, format
, scalafmt
, console
, repl
, run
, setup-ide
, shebang
, test
Aliases: --scala-opt
, -O
Add a scalac
option. Note that options starting with -g
, -language
, -opt
, -P
, -target
, -V
, -W
, -X
, and -Y
are assumed to be Scala compiler options and don't require to be passed after -O
or --scalac-option
.
Available in commands:
bsp
, compile
, dependency-update
, doc
, fmt
, format
, scalafmt
, console
, repl
, run
, setup-ide
, shebang
, test
Aliases: --scala
, -S
Set the Scala version
Aliases: --scala-binary
, --scala-bin
, -B
[Internal] Set the Scala binary version
Show help for scalac. This is an alias for --scalac-option -help
Aliases: --jar
, --jars
, --extra-jar
Add extra JARs in the class path
Aliases: --compile-only-jar
, --compile-only-jars
, --extra-compile-only-jar
Add extra JARs in the compilaion class path. Mainly using to run code in managed environments like Spark not to include certain depenencies on runtime ClassPath.
Aliases: --source-jar
, --source-jars
, --extra-source-jar
Add extra source JARs
Aliases: --resource-dir
Add a resource directory
[Internal]
[Internal] Do not add dependency to Scala Standard library. This is useful, when Scala CLI works with pure Java projects.
[Internal] Should include Scala CLI runner on the runtime ClassPath. Runner is added by default for application running on JVM using standard Scala versions. Runner is used to make stack traces more readable in case of application failure.
[Internal] Generate SemanticDBs
[Internal] Add dependency for stubs needed to make $ivy and $dep imports to work.
[Internal]
Available in commands:
bsp
, compile
, dependency-update
, doc
, fmt
, format
, scalafmt
, console
, repl
, run
, setup-ide
, shebang
, test
Aliases: -e
, --execute-script
, --execute-scala-script
, --execute-sc
Execute a passed string as a Scala script
Aliases: --execute-scala
Execute a passed string as Scala code
Aliases: --execute-java
Execute a passed string as Java code
Available in commands:
Name of the test framework's runner class to use while running tests
Fail if no test suites were run
Available in commands:
Aliases: -f
Force scala-cli uninstall
[Internal] Don't clear scala-cli cache
[Internal] Binary name
[Internal] Binary directory
Available in commands:
uninstall
, uninstall completions
, uninstall-completions
Path to *rc
file, defaults to .bashrc
or .zshrc
depending on shell
[Internal] Custom banner in comment placed in rc file
[Internal] Custom completions name
Available in commands:
[Internal] Binary name
[Internal] Binary directory
Aliases: -f
Force update scala-cli if is outdated
[Internal]
[Internal] A github token used to access GitHub. Not needed in most cases.
Available in commands:
about
, bsp
, clean
, compile
, dependency-update
, doc
, doctor
, fmt
, format
, scalafmt
, install completions
, install-completions
, console
, repl
, run
, setup-ide
, shebang
, test
, uninstall
, uninstall completions
, uninstall-completions
, update
, version
Aliases: -v
Increase verbosity (can be specified multiple times)
Aliases: -i
Interactive mode
Enable actionable diagnostics
Available in commands:
Aliases: --cli
Show only plain scala-cli version
Aliases: --scala
Show only plain scala version
Available in commands:
compile
, console
, repl
, run
, shebang
, test
Aliases: -w
Watch source files for changes
Aliases: --revolver
Run your application in background and automatically restart if sources have been changed
Available in commands:
[Internal] A github token used to access GitHub. Not needed in most cases.
Available in commands:
[Internal] Command-line options JSON file
Available in commands:
Aliases: --bsp-dir
[Internal] Custom BSP configuration location
Aliases: --name
[Internal] Name of BSP
Available in commands:
bsp
, compile
, dependency-update
, doc
, fmt
, format
, scalafmt
, console
, repl
, run
, setup-ide
, shebang
, test
, uninstall
[Internal] Specify a TTL for changing dependencies, such as snapshots
[Internal] Set the coursier cache location
[Internal] Enable checksum validation of artifacts downloaded by coursier
Available in commands:
[Internal] A github token used to access GitHub. Not needed in most cases.
Available in commands:
bsp
, compile
, dependency-update
, doc
, fmt
, format
, scalafmt
, console
, repl
, run
, setup-ide
, shebang
, test
[Internal]
[Internal]
Available in commands:
[Internal] Don't actually run the REPL, just fetch it
Available in commands:
[Internal]
Available in commands:
bsp
, clean
, compile
, dependency-update
, doc
, fmt
, format
, scalafmt
, console
, repl
, run
, setup-ide
, shebang
, test
[Internal] Directory where .scala-build is written