A modern Kotlin script runner
Run .kts like you
run modern scripts.
What uv is for Python and bun is for JavaScript, ktx aims to be for .kts. Daemon-warm starts, lockfiles, per-script JDK, and a one-command compile-to-fat-jar — built on top of JetBrains' supported kotlin-main-kts.
Get started
$
mise use -g github:gaojunran/ktx@latestktx lock writes *.kts.lock pinning every transitive jar to its sha256. ktx run --frozen runs offline, makes CI deterministic. Lockfiles →03toolchainPer-script JDK. Declare @file:Toolchain(jdk = "17") and ktx auto-installs the requested JDK from Adoptium and re-execs onto it before compilation. Toolchain →04compileDistribute as a single jar.ktx compile emits a 11–13 MB fat jar that runs on plain JRE 17+ — your end users do not need ktx, do not need a Kotlin compiler, do not need anything but Java. Compile →