You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/commands/repl.md
+24Lines changed: 24 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -80,6 +80,30 @@ scala> :quit
80
80
81
81
</ChainedSnippets>
82
82
83
+
## Using Toolkit in REPL
84
+
It is also possible to start the scala-cli REPL with [toolkit](https://scala-cli.virtuslab.org/docs/guides/introduction/toolkit/) enabled
85
+
86
+
<ChainedSnippets>
87
+
88
+
```bash ignore
89
+
scala-cli repl --toolkit default
90
+
```
91
+
92
+
```text
93
+
Welcome to Scala 3.3.1 (17, Java OpenJDK 64-Bit Server VM).
94
+
Type in expressions for evaluation. Or try :help.
95
+
96
+
scala> import os._
97
+
98
+
scala> os.pwd
99
+
val res0: os.Path = /Users/yadukrishnan/test
100
+
scala> :quit
101
+
102
+
```
103
+
</ChainedSnippets>
104
+
105
+
Since we started the repl with toolkit enabled, we can use the libraries included in the toolkit directly. In the above example, the `os-lib` library from the toolkit is used to print the current path.
106
+
83
107
## Inject code as JAR file in class path
84
108
85
109
If your application inspects its class path, and requires only JAR files in it, use `--as-jar` to
0 commit comments