https://docs.scala-lang.org/scala3/book/methods-main-methods...
https://www.nushell.sh/book/modules.html#main
https://www.nushell.sh/book/custom_commands.html#flags
Python has typer[1] to do this with type hints. It's limited and gets ugly quickly, but I love it for simple scripts.
[0] nushell.sh
[1] typer.tiangolo.com