Skip to content

Commit ee69ee0

Browse files
yadavan88SethTisue
andauthored
Added info about repl with toolkit (#2721)
* Added info about repl with toolkit * Update repl.md * Update website/docs/commands/repl.md review comments addressed Co-authored-by: Seth Tisue <[email protected]> --------- Co-authored-by: Seth Tisue <[email protected]>
1 parent 9757697 commit ee69ee0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

website/docs/commands/repl.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,30 @@ scala> :quit
8080

8181
</ChainedSnippets>
8282

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+
83107
## Inject code as JAR file in class path
84108

85109
If your application inspects its class path, and requires only JAR files in it, use `--as-jar` to

0 commit comments

Comments
 (0)