Kotlin Compiler
$ kotlinc Official Low RiskJetBrains' standalone Kotlin compiler CLI for compiling .kt files to JVM bytecode or running .kts scripts. Useful for quick single-file checks and educational scripts, though real multi-module projects rely on Gradle (./gradlew) and JVM startup latency makes repeated kotlinc calls slow.
brew install kotlin Local JVM compiler binary; real Kotlin codebases typically wrap compilation via Gradle rather than raw kotlinc.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Runs non-interactively with -Werror and -nowarn, but lacks native JSON diagnostic output and color-disabling standards, and prints an interactive REPL if run with no arguments.
- Invoking bare
kotlinclaunches an interactive REPL - No
--jsonor SARIF output built intokotlinc
Local-only compilation with explicit -d output target and zero network or credential access.
- Zero network/credential exposure during compilation
Available via Homebrew, SDKMAN, and GitHub releases, but requires a compatible JDK installed on the host.
- Requires JVM/JDK runtime dependency
Cold JVM startup on every kotlinc call is slow, and most real Kotlin repositories build through Gradle instead.
- High cold-start JVM overhead without Gradle daemon
Official JetBrains compiler maintained in JetBrains/kotlin under Apache-2.0.
- First-party JetBrains toolchain
Clear command-line guide at kotlinlang.org and structured -help output.
- Official CLI documentation at kotlinlang.org/docs/command-line.html
Security, Auth & Guardrails
No authentication required; operates strictly on local .kt/.kts files and classpath JARs.
Apache-2.0 open-source compiler; completely free.
# Kotlin Compiler (kotlinc) Agent Rules - Prefer the repository's `./gradlew compileKotlin` for Gradle projects; use `kotlinc` only for standalone `.kt`/`.kts` files. - Pass `-Werror` when verifying standalone edits so warnings fail loudly.
Agent-Ready Command Recipes
Safe Read-Only Queries
kotlinc -version && kotlinc -help
Prints the active kotlinc version and full list of compiler options.
Controlled Writes & Previews
kotlinc Main.kt -include-runtime -Werror -d build/main.jar
Compiles Main.kt with warnings treated as errors into build/main.jar.
Strengths for Agents
- + Official JetBrains compiler supporting standalone
.ktto JAR builds and.ktsscript execution. - + Supports
-Werrorfor strict standalone compile checks.
Caveats & Pitfalls
- ! Invoking
kotlincwith no arguments enters an interactive REPL that hangs non-TTY agent shells. - ! Cold JVM startup takes multiple seconds per call and diagnostics are plain text only.