title | sidebar_position |
---|---|
Command-line options |
1 |
This is a summary of options that are available for each subcommand of the scala-cli
command.
Available in commands:
[experimental] Run JMH benchmarks
[experimental] Set JMH version
Available in commands:
bloop
, bloop exit
, bloop output
, bloop start
, bsp
, compile
, dependency-update
, doc
, export
, fmt
, format
, scalafmt
, browse
, metabrowse
, package
, publish
, publish local
, repl
, console
, 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
, --print-classpath
Print the resulting class path
Compile test scope
Available in commands:
compile
, package
, publish
, publish local
, repl
, console
, run
, shebang
, test
[experimental] Run given command against all provided Scala versions and/or platforms
Available in commands:
bloop
, bloop start
, bsp
, compile
, config
, dependency-update
, doc
, export
, fmt
, format
, scalafmt
, browse
, metabrowse
, package
, pgp push
, publish
, publish local
, publish setup
, repl
, console
, run
, setup-ide
, shebang
, test
Turn debugging on
Debug port (5005 by default)
Debug mode (attach by default)
Available in commands:
bsp
, compile
, dependency-update
, doc
, export
, fmt
, format
, scalafmt
, browse
, metabrowse
, package
, publish
, publish local
, repl
, console
, run
, setup-ide
, shebang
, test
Aliases: --dep
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:
bloop
, bloop exit
, bloop output
, bloop start
, bsp
, clean
, compile
, config
, dependency-update
, directories
, doc
, export
, fmt
, format
, scalafmt
, install completions
, install-completions
, browse
, metabrowse
, package
, publish
, publish local
, publish setup
, repl
, console
, 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:
Aliases: --setting
Aliases: -p
Project name to be used on Mill build file
Aliases: -o
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
[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 (3.5.9 by default). If passed, this overrides whatever value is configured in the .scalafmt.conf file.
Available in commands:
about
, add-path
, bloop
, bloop exit
, bloop output
, bloop start
, bsp
, clean
, compile
, config
, default-file
, dependency-update
, directories
, doc
, doctor
, export
, fmt
, format
, scalafmt
, help
, install completions
, install-completions
, install-home
, github secret list
, gh secret list
, browse
, metabrowse
, package
, pgp create
, pgp key-id
, pgp pull
, pgp push
, pgp sign
, pgp verify
, publish
, publish local
, publish setup
, repl
, console
, run
, github secret create
, gh secret create
, 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
, -help-full
, -full-help
Print help message, including hidden options, and exit
Available in commands:
bsp
, compile
, dependency-update
, doc
, export
, fmt
, format
, scalafmt
, browse
, metabrowse
, package
, publish
, publish local
, repl
, console
, run
, setup-ide
, shebang
, test
Show options for ScalaJS
Show options for ScalaNative
Aliases: --scaladoc-help
, --doc-help
, --help-doc
Show options for Scaladoc
Aliases: --repl-help
Show options for Scala REPL
Aliases: --scalafmt-help
, --fmt-help
, --help-fmt
Show options for Scalafmt
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:
package
, repl
, console
, run
, shebang
, test
Aliases: -J
Set Java options, such as -Xmx1g
Set Java properties
Available in commands:
bloop
, bloop start
, bsp
, compile
, config
, dependency-update
, doc
, export
, fmt
, format
, scalafmt
, browse
, metabrowse
, package
, pgp push
, publish
, publish local
, publish setup
, repl
, console
, 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:
about
, add-path
, bloop
, bloop exit
, bloop output
, bloop start
, bsp
, clean
, compile
, config
, default-file
, dependency-update
, directories
, doc
, doctor
, export
, fmt
, format
, scalafmt
, help
, install completions
, install-completions
, install-home
, github secret list
, gh secret list
, browse
, metabrowse
, package
, pgp pull
, pgp push
, publish
, publish local
, publish setup
, repl
, console
, run
, github secret create
, gh secret create
, setup-ide
, shebang
, test
, uninstall
, uninstall completions
, uninstall-completions
, update
, version
Aliases: -q
Decrease verbosity
Use progress bars
Available in commands:
export
, package
, publish
, publish local
, run
, shebang
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:
bsp
, compile
, dependency-update
, doc
, export
, fmt
, format
, scalafmt
, browse
, metabrowse
, package
, publish
, publish local
, repl
, console
, run
, setup-ide
, shebang
, test
Aliases: --md
, --markdown
[experimental] Enable markdown support.
Available in commands:
Aliases: -o
Set the destination path
Aliases: -f
Overwrite the destination file, if it exists
Generate a library JAR rather than an executable JAR
Generate a source JAR rather than an executable JAR
Aliases: --scaladoc
, --javadoc
Generate a scaladoc JAR rather than an executable JAR
Generate an assembly JAR
For assembly JAR, whether to add a bash / bat preamble
[Internal] For assembly JAR, whether to specify a main class in the JAR manifest
[Internal] Generate an assembly JAR for Spark (assembly that doesn't contain Spark, nor any of its dependencies)
Package standalone JARs
Build Debian package, available only on Linux
Build dmg package, available only on macOS
Build rpm package, available only on Linux
Build msi package, available only on Windows
Build pkg package, available only on macOS
Build Docker image
[Internal] Exclude modules and their transitive dependencies from the JAR to be packaged
Aliases: --default-scaladoc-opts
Use default scaladoc options
Aliases: --graal
Build GraalVM native image
Available in commands:
Set the version of the generated package
Path to application logo in PNG format, it will be used to generate icon and banner/dialog in msi installer
Set launcher app name, which will be linked to the PATH
Aliases: -m
This should contain names and email addresses of co-maintainers of the package
The list of Debian package that this package is not compatible with
The list of Debian packages that this package depends on
Architectures that are supported by the repository (default: all)
This field represents how important it is that the user have the package installed
This field specifies an application area into which the package has been classified
CF Bundle Identifier
Licenses that are supported by the repository (list of licenses: https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing)
The number of times this version of the software was released (default: 1)
Architectures that are supported by the repository (default: noarch)
Path to the license file
Name of product (default: Scala packager)
Text that will be displayed on the exit dialog
Suppress Wix ICE validation (required for users that are neither interactive, not local administrators)
Path to extra WIX configuration content
Aliases: --64
Whether a 64-bit executable is being packaged
WIX installer version
The GUID to identify that the windows package can be upgraded.
Building the container from base image
The image registry; if empty, it will use the default registry
The image repository
The image tag; the default tag is latest
GraalVM Java major version to use to build GraalVM native images (17 by default)
GraalVM version to use to build GraalVM native images (22.2.0 by default)
JVM id of GraalVM distribution to build GraalVM native images (like "graalvm-java17:22.0.0")
Available in commands:
pgp pull
, pgp push
, publish setup
Key server to push / pull keys from
Available in commands:
[Internal] Directory where temporary files for publishing should be written
[Internal] Scala version suffix to append to the module name, like "_2.13" or "_3"
[Internal] Scala platform suffix to append to the module name, like "_sjs1" or "_native0.4"
Whether to build and publish source JARs
Aliases: --scaladoc
, --javadoc
Whether to build and publish doc JARs
Aliases: -K
ID of the GPG key to use to sign artifacts
Method to use to sign artifacts
Aliases: -G
, --gpg-opt
gpg command-line options
Set Ivy 2 home directory
[Internal]
[Internal]
Proceed as if publishing, but do not upload / write artifacts to the remote repository
[Internal]
[Internal]
Available in commands:
publish
, publish local
, publish setup
Organization to publish artifacts under
Name to publish artifacts as
Final name to publish artifacts as, including Scala version and platform suffixes if any
Version to publish artifacts as
How to compute the version to publish artifacts as
URL to put in publishing metadata
License to put in publishing metadata
VCS information to put in publishing metadata
Description to put in publishing metadata
Developer(s) to add in publishing metadata, like "alex|Alex|https://alex.info" or "alex|Alex|https://alex.info|alex@alex.me"
Secret key to use to sign artifacts with Bouncy Castle
Aliases: --secret-key-pass
Password of secret key to use to sign artifacts with Bouncy Castle
Use or setup publish parameters meant to be used on continuous integration
Available in commands:
Aliases: -R
, --publish-repo
Repository to publish to
User to use with publishing repository
Password to use with publishing repository
Realm to use when passing credentials to publishing repository
Available in commands:
Public key to use to verify artifacts (to be uploaded to a key server)
Check if some options for publishing are missing, and exit with non-zero return code if that's the case
GitHub token to use to upload secrets to GitHub - password encoded
Generate a random key pair for publishing, with a secret key protected by a random password
When generating a random key pair, the mail to associate to it
The option groups to check - can be "all", or a comma-separated list of "core", "signing", "repo", "extra"
Whether to check if a GitHub workflow already exists (one for publishing is written if none is found)
Dummy mode - don't upload any secret to GitHub
Available in commands:
publish
, publish local
, repl
, console
, run
, shebang
[experimental] Set Java options so that Python can be loaded
Aliases: --py
[experimental] Enable Python support via ScalaPy
Aliases: --scalapy-version
[experimental] Set ScalaPy version (0.5.2+5-83f1eb68 by default)
Available in commands:
Aliases: -A
, --amm
[restricted] Use Ammonite (instead of the default Scala REPL)
Aliases: --ammonite-ver
[restricted] Set the Ammonite version (2.5.5 by default)
Aliases: -a
[Internal] [restricted] Provide arguments for ammonite repl
[Internal] Don't actually run the REPL, just fetch it
Available in commands:
Aliases: --spark
[Internal] [experimental] Run as a Spark job, using the spark-submit command
Aliases: --submit-arg
[Internal] [experimental] spark-submit arguments
Aliases: --spark-standalone
[experimental] Run as a Spark job, using a vanilla Spark distribution downloaded by Scala CLI
Aliases: --hadoop
[experimental] Run as a Hadoop job, using the "hadoop jar" command
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
, export
, fmt
, format
, scalafmt
, browse
, metabrowse
, package
, publish
, publish local
, repl
, console
, run
, setup-ide
, shebang
, test
Enable Scala.js. To show more options for Scala.js pass --help-js
The Scala.js version (1.10.1 by default).
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 (1.1.1-sc6 by default).
[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
, export
, fmt
, format
, scalafmt
, browse
, metabrowse
, package
, publish
, publish local
, repl
, console
, run
, setup-ide
, shebang
, test
Enable Scala Native. To show more options for Scala Native pass --help-native
Set the Scala Native version (0.4.8 by default).
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
Embed resources into the Scala Native binary (can be read with the Java resources API)
Available in commands:
bsp
, compile
, dependency-update
, doc
, export
, fmt
, format
, scalafmt
, browse
, metabrowse
, package
, publish
, publish local
, repl
, console
, run
, setup-ide
, shebang
, test
Aliases: --scala-opt
, -O
, --scala-option
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
, export
, fmt
, format
, scalafmt
, browse
, metabrowse
, package
, publish
, publish local
, repl
, console
, run
, setup-ide
, shebang
, test
Aliases: --help-scalac
Show help for scalac. This is an alias for --scalac-option -help
Aliases: --verbose-scalac
Turn verbosity on for scalac. This is an alias for --scalac-option -verbose
Available in commands:
github secret list
, gh secret list
, github secret create
, gh secret create
Aliases: --repo
Available in commands:
github secret create
, gh secret create
Aliases: --pub-key
Aliases: -n
[Internal]
Available in commands:
bsp
, compile
, dependency-update
, doc
, export
, fmt
, format
, scalafmt
, browse
, metabrowse
, package
, publish
, publish local
, repl
, console
, run
, setup-ide
, shebang
, test
Aliases: --scala
, -S
Set the Scala version (3.2.0 by default)
Aliases: --scala-binary
, --scala-bin
, -B
[Internal] Set the Scala binary version
Aliases: --jar
, --jars
, --extra-jar
, --class
, --extra-class
, --classes
, --extra-classes
, -classpath
, -cp
, --classpath
, --class-path
, --extra-class-path
Add extra JARs and compiled classes to 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
Specify platform
[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]
Aliases: --output-directory
, -d
, --destination
, --compile-output
, --compile-out
Copy compilation results to output directory using either relative or absolute path
Available in commands:
bsp
, compile
, dependency-update
, doc
, export
, fmt
, format
, scalafmt
, browse
, metabrowse
, package
, publish
, publish local
, repl
, console
, run
, setup-ide
, shebang
, test
Allows to execute a passed string as a Scala script
Aliases: --execute-scala-script
, --execute-sc
, -e
[Internal]
A synonym to --script-snippet, which defaults the sub-command to run
when no sub-command is passed explicitly
Allows to execute a passed string as Scala code
[Internal]
A synonym to --scala-snippet, which defaults the sub-command to run
when no sub-command is passed explicitly
Allows to execute a passed string as Java code
A synonym to --scala-snippet, which defaults the sub-command to run
when no sub-command is passed explicitly
Aliases: --md-snippet
[experimental] Allows to execute a passed string as Markdown code
Aliases: --execute-md
[Internal]
[experimental] A synonym to --markdown-snippet, which defaults the sub-command to run
when no sub-command is passed explicitly
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
, add-path
, bloop
, bloop exit
, bloop output
, bloop start
, bsp
, clean
, compile
, config
, default-file
, dependency-update
, directories
, doc
, doctor
, export
, fmt
, format
, scalafmt
, help
, install completions
, install-completions
, install-home
, github secret list
, gh secret list
, browse
, metabrowse
, package
, pgp pull
, pgp push
, publish
, publish local
, publish setup
, repl
, console
, run
, github secret create
, gh secret create
, 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 version
Aliases: --scala
Show only plain scala version
Available in commands:
compile
, package
, publish
, publish local
, repl
, console
, 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]
Available in commands:
Aliases: --working-dir
, --dir
[Internal]
Available in commands:
Aliases: -f
[Internal]
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:
[Internal] Dump config DB as JSON
[Internal] Create PGP key in config
[Internal] Email to use to create PGP key in config
[Internal] If the entry is a password, print the password value rather than how to get the password
[Internal] If the entry is a password, save the password value rather than how to get the password
Aliases: --remove
[Internal] Remove an entry from config
[Internal] For repository.credentials and publish.credentials, whether these credentials should be HTTPS only (default: true)
[Internal] For repository.credentials, whether to use these credentials automatically based on the host
[Internal] For repository.credentials, whether to use these credentials are optional
[Internal] For repository.credentials, whether to use these credentials should be passed upon redirection
Available in commands:
bloop
, bloop exit
, bloop start
, bsp
, compile
, config
, dependency-update
, doc
, export
, fmt
, format
, scalafmt
, browse
, metabrowse
, package
, pgp push
, publish
, publish local
, publish setup
, repl
, console
, run
, github secret create
, gh secret create
, 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] Write result to files rather than to stdout
[Internal] List available default files
[Internal] List available default file ids
Aliases: -f
[Internal] Force overwriting destination files
Available in commands:
[Internal] A github token used to access GitHub. Not needed in most cases.
Available in commands:
bsp
, compile
, dependency-update
, doc
, export
, fmt
, format
, scalafmt
, browse
, metabrowse
, package
, publish
, publish local
, publish setup
, repl
, console
, run
, setup-ide
, shebang
, test
[Internal]
[Internal]
Available in commands:
[Internal]
Aliases: -f
[Internal] Overwrite if it exists
[Internal] Binary name
[Internal]
Print the update to env
variable
[Internal] Binary directory
Available in commands:
[Internal]
Download and add rt.jar
in the class path
Aliases: -H
[Internal] Bind to host
Aliases: -p
[Internal] Bind to port
[Internal]
[Internal]
[Internal]
[Internal]
[Internal]
[Internal]
Available in commands:
[Internal]
[Internal]
[Internal]
[Internal]
[Internal]
[Internal]
[Internal]
Available in commands:
[Internal]
Aliases: -v
[Internal]
Available in commands:
[Internal] Whether to exit with code 0 if no key is passed
Available in commands:
Aliases: -f
[Internal] Try to push the key even if Scala CLI thinks it's not a public key
[Internal] Whether to exit with code 0 if no key is passed
[Internal]
Available in commands:
[Internal]
[Internal]
Aliases: -f
[Internal]
[Internal]
Available in commands:
[Internal]
Available in commands:
[Internal]
Available in commands:
bsp
, clean
, compile
, dependency-update
, doc
, export
, fmt
, format
, scalafmt
, browse
, metabrowse
, package
, publish
, publish local
, publish setup
, repl
, console
, run
, setup-ide
, shebang
, test
[Internal] Directory where .scala-build is written