shortTitle | shortDescription | expandText | anchorTarget | icon |
---|---|---|---|---|
Command Line |
Superpower your scripts with the Scala command. Get hands-on with the Scala Toolkit. Easily add libraries. Build CLI apps with instant startup. |
Scripting Utilities |
build-scala-tools |
icon4.svg |
Scala CLI gives all the tools you need to create simple Scala projects.
Import your favorite libraries, write your code, run it, create unit tests, share it as a gist, or publish it to Maven Central.
Scala CLI is fast, low-config, works with IDEs, and follows well-known conventions.
read more on the Scala CLI website//> using dependency com.lihaoyi::os-lib:0.9.1
// Sort all the files by size in the working directory os.list(os.pwd).sortBy(os.size).foreach(println)
$ scala-cli list_files.sc
/home/user/example/list_files.sc
...
The Scala Toolkit is a good fit for writing a script, prototyping, or bootstrapping a new application.
Including a selection of approachable libraries to perform everyday tasks, the Scala Toolkit helps you work with files and processes, parse JSON, send HTTP requests and unit test code.
Toolkit libraries work great on the JVM, JS and Native platforms, all while leveraging a simple code style.
find useful snippets in the Toolkit Tutorials//> using toolkit latest
// A JSON object val json = ujson.Obj("name" -> "Peter", "age" -> 23)
// Send an HTTP request import sttp.client4.quick.* val response = quickRequest .put(uri"https://httpbin.org/put") .body(ujson.write(json)) .send()
// Write the response to a file os.write(os.pwd / "response.json", response.body)
Package your apps to native binaries for instant startup time.
Deploy to Docker images, JS scripts, Spark or Hadoop jobs, and more.
other ways to package applications$ scala-cli --power package \
--native-image \
--output my-tool \
my-tool.sc
Wrote /home/user/example/my-tool, run it with ./my-tool