How to create a Scala 3 (Dotty) project with SBT

I can never remember how to create a Scala 3 (Dotty) project with SBT, so, here are some examples of how to create a Dotty/SBT project:

# create a new Dotty project
sbt new lampepfl/dotty.g8

# create a dotty project that cross compiles with scala 2
sbt new lampepfl/dotty-cross.g8

# optional: launch VS Code
sbt launchIDE

# start a dotty repl in your sbt project directory (two steps)

> console
scala> _

Here’s what an example interaction looks like — include SBT renaming my directory name to all lowercase, which brings me no joy:

/Users/al> sbt new lampepfl/dotty.g8
[info] Loading settings for project global-plugins from idea.sbt,plugins.sbt,metals.sbt ...
[info] Loading global plugins from /Users/al/.sbt/1.0/plugins
[info] Updating ProjectRef(uri("file:/Users/al/.sbt/1.0/plugins/"), "global-plugins")...
[info] Done updating.

A template to demonstrate a minimal Dotty application

name [Dotty Project Template]: MyCoolDottyProject

Template applied in /Users/al/mycooldottyproject

/Users/al> mv mycooldottyproject MyCoolDottyProject

For more information: