hnaderi / scala-readpass   0.0.1

Apache License 2.0 GitHub

Cross platform readpassword for scala native and jvm

Scala versions: 3.x 2.13
Scala Native versions: 0.4


readpassword Scala version support Build GitHub

This is a cross platform readpassword utility useful for CLIs that require reading password from stdin. It acts like standard unix style of password input, like in sudo where password is hidden on input.


This library is currently available for Scala binary versions 2.13 and 3.2 on JVM and Scala native.

To use the latest version, include the following in your build.sbt:

libraryDependencies ++= Seq(
  "dev.hnaderi" %%% "readpassword" % "<see badge>"

Then use it like:

import dev.hnaderi.readpassword

object Main extends App {
  val pass ="Enter your password: ")
  println(s"Your password is: $pass")

And then:

sbt:root> exampleNative/run
Enter your password: 
Your password is: This is my password!


env native jvm
posix compliant OSes