How to start a Scala REPL session inside SBT (Simple Build Tool)

Scala FAQ: How do I start a Scala REPL session from sbt (i.e., inside the Simple Build Tool)?

Answer: Use the console or consoleQuick commands inside the sbt shell:

  • Type console to start a REPL session from inside SBT. This (a) compiles your Scala project and then (b) starts a REPL session.
  • Type consoleQuick if you don’t want to compile your project before starting a REPL session inside of sbt.

The console command process looks like this:

> sbt
[info] Loading project definition from /Users/al/Projects/Cats101/project
[info] Set current project to Cats101 (in build file:/Users/al/Projects/Cats101/)

> console
[info] Starting scala interpreter...
[info]
Welcome to Scala 2.12.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_131).
Type in expressions for evaluation. Or try :help.

scala> _

If you wanted to see how to start a Scala REPL session from inside sbt, I hope this helps.