Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Kotlin Compiler

$ kotlinc Official Low Risk
JetBrains · Code & DevOps · Apache-2.0 · macos / linux / windows

JetBrains' 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.

FCRS-1.0 Score
72 /100
Usable w/ Caveats
Medium Confidence
Zero-Friction Install
brew install kotlin
CLI vs MCP Decision CLI Only

Local JVM compiler binary; real Kotlin codebases typically wrap compilation via Gradle rather than raw kotlinc.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 13 / 25

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 kotlinc launches an interactive REPL
  • No --json or SARIF output built into kotlinc
Trust & Safety 20 / 25

Local-only compilation with explicit -d output target and zero network or credential access.

  • Zero network/credential exposure during compilation
Setup & Portability 11 / 15

Available via Homebrew, SDKMAN, and GitHub releases, but requires a compatible JDK installed on the host.

  • Requires JVM/JDK runtime dependency
Utility & Efficiency 10 / 15

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
Maintenance & Lineage 10 / 10

Official JetBrains compiler maintained in JetBrains/kotlin under Apache-2.0.

  • First-party JetBrains toolchain
Docs & Verifiability 8 / 10

Clear command-line guide at kotlinlang.org and structured -help output.

  • Official CLI documentation at kotlinlang.org/docs/command-line.html

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

No authentication required; operates strictly on local .kt/.kts files and classpath JARs.

Side Effects
Read-Only Local Write
Cost & Quotas

Apache-2.0 open-source compiler; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Check Kotlin compiler version and flags
kotlinc -version && kotlinc -help

Prints the active kotlinc version and full list of compiler options.

Controlled Writes & Previews

Compile Kotlin source to a runnable JAR
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 .kt to JAR builds and .kts script execution.
  • + Supports -Werror for strict standalone compile checks.

Caveats & Pitfalls

  • ! Invoking kotlinc with 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.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI