Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added info about repl with toolkit #2721

Merged
merged 3 commits into from
Feb 9, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions website/docs/commands/repl.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,30 @@ scala> :quit

</ChainedSnippets>

## Using Toolkit in REPL
It is also possible to start the scala-cli REPL with [toolkit](https://scala-cli.virtuslab.org/docs/guides/introduction/toolkit/) enabled

<ChainedSnippets>

```bash ignore
scala-cli repl --toolkit default
```

```text
Welcome to Scala 3.3.1 (17, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.

scala> import os._

scala> os.pwd
val res0: os.Path = /Users/yadukrishnan/test
scala> :quit

```
</ChainedSnippets>

Since we started the repl with toolkit enbled, we can use the libraries included in the toolkit direclty. In the above example, `os-lib` library from the toolkit is used to print the current path.
yadavan88 marked this conversation as resolved.
Show resolved Hide resolved

## Inject code as JAR file in class path

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