Simplest IDEA project for kotlin scripts

How can I set up a minimalistic IDEA project just for kotlin kts scripts development (with IDE support)? I need something like this (and maybe even without gradle at all) but I don’t want to use kscript on my Windows PC.

I just need IDE auto-completion and other kotlin support during script editing without any compilation as I’m going to run my scrips from command line using kotlinc -script command.

1 Like

I second this :arrow_up:
I also want to develop kts scripts for my custom script definition and need simple IDE tooling in an arbitrary location (not in an existing IntelliJ project).

1 Like

I may be wrong but, the JVM lacks a global location for libraries. As consequence not having a Gradle or Maven (or even an Ant) project would mean to download external dependencies by hand or select them from and hypothetic “IntelliJ script project”.

Probably a better solution would be to have a machine/user wide Gradle script where you declare your global dependencies and every script you run implicitly uses that script. I think a Gradle plugin and and a script that points to that global build.gradle.kts would suffice.

Of course that would require you to have Gradle installed on your system.

You can open a .kts with IntelliJ (“open with” in your file browser, or idea your-script.kts in the commandline) and it’ll let you edit the file with the usual tooling, and without creating any additional project files (.idea directory, etc.)

1 Like