As of 2025, all you need to do is save the file with a kts filename extension
hello.kts:
println("Hello World!")
terminal:
~ > kotlin test.kts Hello World!