Installation

You can use kUML in four ways: as a standalone CLI, as a Gradle plugin in your build, as an IntelliJ IDE plugin for editor support, or as a VS Code extension. Pick whichever matches the workflow you want; they all read the same *.kuml.kts script files.

Prerequisites

  • Java 21 or newer for the CLI, Gradle plugin, and JetBrains plugin.

  • Node 20+ for the VS Code extension’s command palette (rendering shells out to the CLI).

  • No additional native dependencies — kUML runs on plain Java, no GraphViz, no Python.

CLI

The CLI is the most direct way to render diagrams, generate code, validate OCL constraints, and run state-machine simulations.

Homebrew (macOS / Linux)

brew install kuml-dev/kuml/kuml
kuml --version

SDKMAN! (macOS / Linux, V2.0.5+)

SDKMAN! is the JVM-ecosystem package manager (kotlin, gradle, maven, springboot, …). kUML is published as a PLATFORM_SPECIFIC candidate with jlink-bundled JREs per platform — no Java install required on the host.

# Install the latest stable kUML:
sdk install kuml

# Or pin a specific version:
sdk install kuml {kuml-version}

# Switch between installed versions:
sdk use kuml {kuml-version}

Supported platforms: Apple Silicon (MAC_ARM64), Intel Mac (MAC_OSX), Linux x64 (LINUX_64). Windows support is on the V2.x roadmap.

Direct download

Pre-built distributions are attached to each GitHub release. Download the kuml-0.4.0.zip for your platform, unzip, and put bin/kuml on your PATH.

From source

git clone https://github.com/kuml-dev/kUML.git
cd kUML
./gradlew :kuml-cli:installDist
./kuml-cli/build/install/kuml-cli/bin/kuml --version

Gradle plugin

Add the plugin to any Gradle build. The plugin contributes three tasks: kumlRender, kumlGenerate, and kumlValidate.

plugins {
    id("dev.kuml") version "{kuml-version}"
}

kuml {
    sourceDir.set(file("src/main/kuml"))
    outputDir.set(layout.buildDirectory.dir("kuml"))
    format.set("svg")             // "svg" | "png"
    theme.set("kuml")             // any ThemeRegistry name
    generator.set("kotlin")       // "kotlin" | "java" | "sql" | any CodeGenRegistry name
}

Run any of the three tasks:

./gradlew kumlRender    // renders *.kuml.kts to SVG / PNG
./gradlew kumlGenerate  // emits code via the configured generator
./gradlew kumlValidate  // checks OCL invariants, fails on violations

The Gradle plugin uses @CacheableTask annotations throughout — running the same task twice with unchanged inputs is a no-op (UP-TO-DATE).

See the Gradle plugin reference for the full configuration surface.

JetBrains IDE plugin

The IntelliJ Platform plugin adds first-class support for *.kuml.kts files in IntelliJ IDEA, Android Studio, PyCharm, and any other JetBrains IDE based on platform build 243+ (2024.3 or newer).

Install via Settings → Plugins → Marketplace, search for kUML, click Install.

Features:

  • Syntax highlighting inherited from the bundled Kotlin plugin

  • Default imports (dev.kuml.core.dsl., dev.kuml.uml.dsl., dev.kuml.c4.dsl.*) resolve without explicit import statements

  • Custom file icon for *.kuml.kts

  • Refactoring, Find Usages, Structure View — all inherited from Kotlin scripting

VS Code extension

The VS Code extension provides syntax highlighting, snippets, and a one-click "Render to SVG" command that shells out to the CLI.

Install via Extensions → Search "kUML" → Install.

Features:

  • Syntax highlighting (own TextMate grammar — no Kotlin extension dependency)

  • Snippets: diagram, umlModel, classOf, interfaceOf, enumOf, c4Model, association, stateMachine, applyProfile, and more

  • File icon for *.kuml.kts

  • Command palette: kUML: Render to SVG

Configuration:

{
  "kuml.cliPath": "kuml",
  "kuml.theme": "kuml",
  "kuml.format": "svg"
}

Verifying the installation

Run this in any directory:

echo 'classDiagram(name = "Smoke") { classOf("Hello") }' > smoke.kuml.kts
kuml render smoke.kuml.kts --output smoke.svg
open smoke.svg     # or xdg-open / start, depending on your OS

If you see a labelled box for Hello, the installation is working. Continue with the quick start.