elide.pkl Reference

Every block and field of the elide.pkl project manifest.

amends "elide:project.pkl"

elide: resolves to the schema bundled with the running Elide; import "elide:Jvm.pkl" and the other modules work the same way. To pin a schema version, amend the published URL instead: pkl.elide.dev/1.6.0/project.pkl.

Patch releases within a MAJOR.MINOR line only add properties. A minor release can remove, rename or retype properties and change defaults.

Pinned versionResult
Older than the running ElideUses that version’s definitions; a property removed since fails, naming the version.
Newer than the running ElideAllowed; a property the running Elide lacks fails, naming the upgrade needed.
Another major versionRefused.

elide project export prints the evaluated manifest as JSON; elide build --inspect lists its tasks.

Project metadata

PropertyPurpose
name, version, descriptionProject identity; version also names application archives.
entrypointFile(s) elide run uses when given none.
scriptsNamed shell commands for elide run NAME.
sourcesSource sets; see Sources.
dependenciesMaven, npm and PyPI packages; see Dependencies.
jvm, kotlin, javascriptLanguage and compiler settings.
nativeImageProject-wide compiler options; not merged into artifact options in 1.6.0.
engineServing contexts; see Engine contexts.
toolchainAccepted Elide versions; see Toolchain.
devSource info, MCP, dev server; see Dev.
webWeb asset settings; see Web.
artifactsBuild outputs; see Artifacts.
testingTest reports; see Testing.
coverageCoverage; see Testing › Coverage.
workspaceMember projects; see Workspaces.

build.flags holds the -f/--flag values; see Build Flags.

Engine contexts

engine {
  topology = "prespawn"
  contexts { spawn = "auto"; reserve = 2; min = 1; max = 16 }
}
PropertyMeaningDefault
topology"prespawn", the only value."prespawn"
contexts.spawnContext count: a positive integer, or "auto" (physical cores minus reserve, clamped).1
contexts.reserveCores subtracted for "auto"; does not pin CPUs.2
contexts.min, contexts.maxBounds for any count.1, none
maxContextsDeprecated fixed count; cannot combine with contexts.—

Each context evaluates the entry module once, with its own globals; all finish before the server is ready. --contexts=N|auto on run, serve and dev overrides spawn. More than one context requires Linux.

Sources

sources {
  ["main"] = "lib/**/*.kt"
  ["integrationTest"] {
    type = "test"
    dependsOn { "main" }
    paths { "it/**/*.kt" }
    resources { "it/fixtures"; new { from = "it/config"; into = "META-INF" } }
  }
}
PropertyMeaningEmpty or absent
type"source", "test", "example" or "other".Inferred from the name.
pathsGlobs or directories.src/<name>/<language>.
resourcesPaths, or new { from; into } roots.src/<name>/resources.
dependsOnSource sets visible to this one.Test and example sets see main.

See Source Sets.

Dependencies

dependencies {
  maven {
    packages { "com.google.guava:guava:33.5.0-jre" }
    testPackages { "org.junit.jupiter:junit-jupiter:5.13.4" }
    substitutions { ["com.google.guava:guava"] = "libs/guava-patched.jar" }
  }
  npm { packages { "react@19.0.0" }; devPackages { "typescript@5.6.2" } }
  pypi { packages { "requests>=2" }; optionalPackages { ["dev"] { "pytest>=8" } } }
  spring { version = "4.0.0"; starter { "web" }; testStarter { "test" } }
}
BlockProperties
mavenpackages, devPackages, modules, compileOnly, runtimeOnly, processors, testPackages, kotlinPlugins, exclusions, substitutions, repositories, enableDefaultRepositories, localRepository
npmpackages, devPackages
pypipackages, optionalPackages (named groups); elide install does not install them.
springversion, starter, testStarter; expands into maven.
ValueForm
Maven entry"group:artifact:version[:classifier]", a MavenPackageSpec (group, name, version, classifier or coordinate), a local JAR path, or a project reference.
RepositoryA URL, or a spec with url, name, description, credentials (username, password, ntlmDomain, ntlmWorkstation).
substitutions keygroup:artifact (any version) or group:artifact:version; the value is a file path.

A substitution keeps the coordinate’s resolution and transitive dependencies but puts the file on every classpath in its place. Paths resolve against the declaring manifest; members inherit the root’s. A generated file needs its task ordered first. Buckets and repositories: Dependencies.

JVM

jvm {
  main = "example.Main"
  target = 25
  flags { "--add-opens=java.base/java.lang=ALL-UNNAMED" }
  defs { ["app.env"] = "dev" }
  java { release = 25; compiler { flags { "-Xlint:all" } } }
}
PropertyMeaningDefault
mainEntrypoint class for elide run, JARs, applications and native images.—
targetBytecode target: 8 … 29, 1.8, "latest", "stable" or "auto"."auto" (21)
javaHomeJava home for external compiles and forked JVMs.Elide’s own
preferBaliPrefer bali from PATH for external JVM runs.false
features.testingJUnit dependencies on test sets.true
features.automodulesAutomatic modules for JARs without a descriptor.true
features.graalvmorg.graalvm SDK APIs on the compile classpath.false
java.source, java.releaseSource and --release levels; see Java Compiler."auto"
java.compiler.mode"embedded" or "external"."embedded"
java.compiler.flagsExtra javac flags.none
flagsJVM flags for elide run, the test JVM and start scripts.none
defsSystem properties (-D), applied wherever flags are.none
debugCompile with -g.true

Kotlin

kotlin {
  apiLevel = "auto"
  languageLevel = "auto"
  compilerOptions { allWarningsAsErrors = true; optIn { "kotlin.time.ExperimentalTime" } }
  features { serialization = true; metro = false }
  toolchain = "embedded"
  plugins { ["org.jetbrains.kotlinx.serialization"] { ["mode"] = "json" } }
}
PropertyMeaning
apiLevel, languageLevel"auto", "latest", "stable", or "1.9" … "2.5".
compilerOptionsoptIn, progressiveMode, extraWarnings, allWarningsAsErrors, suppressWarnings, verbose, freeCompilerArgs, apiVersion, languageVersion, includeRuntime, noStdlib, javaParameters, jvmTarget, noJdk, jvmTargetValidationMode, incremental
featurestesting, kotlinx, defaultPlugins, serialization, coroutines, atomicfu, powerAssert, metro, reflection
toolchain"embedded", new Kotlin.ManagedKotlinToolchain { version } or new Kotlin.CustomKotlinToolchain { path }.
pluginsOptions per compiler-plugin id, passed as -P plugin:<id>:<key>=<value>.

Defaults: Kotlin Compiler.

JavaScript

PropertyMeaningDefault
javascript.ecmaTarget: a year 2015 … 2025, "stable" or "latest"."stable"

Toolchain

toolchain { engines { ["elide"] = ">=1.6.0" } }
PropertyMeaning
engines["elide"]Version or semver range, or new { version = "…" }; a running Elide outside it fails validation.
engines[<other>]Accepted, not enforced.

Dev

dev {
  source { platform = "github"; project = "example/app" }
  mcp {
    registerElide = true
    advice = true
    resources { new { path = "docs/ARCHITECTURE.md"; name = "architecture" } }
  }
}
PropertyMeaningDefault
source.platform, source.project, source.subpathSource host: "github", "gitlab", "bitbucket", "git" or another name.—
mcp.registerElideRegister Elide as an MCP tool.true
mcp.adviceExpose elide project advice as an MCP resource.true
mcp.resourcesExtra MCP resources: path, name, description, mimeType (detected if omitted).none
server.host, server.portUnused by elide dev, which takes --host/--port (default 127.0.0.1:3000)."0.0.0.0", 8080

Web

PropertyMeaningDefault
web.css.minifyMinify built CSS.true
web.css.targetsBrowser targets: new { browser = "chrome"; version = "120" }.none
web.minifyHtmlMinify rendered HTML.true
web.browsersBrowser targets for all outputs; css.targets overrides it for CSS.none

See Web Toolchain.

Artifacts

import "elide:Jvm.pkl" as Jvm

artifacts {
  ["app"] = new Jvm.Jar {
    name = "app.jar"
    options { entrypoint = "example.Main" }
    sources { "main" }  // optional; empty packages every non-test source set
  }
}

The key names the build task. Outputs go under .dev/artifacts/<kind>/.

TypeModuleFields
Jar, SourceJar, JavadocJar, JvmApplicationelide:Jvm.pklJAR Assembly
NativeImageelide:NativeImage.pklNative Image
WebImageelide:NativeImage.pklWebImage
ContainerImageelide:Container.pklJVM Containers
StaticSiteelide:Web.pklStatic Sites
Common fieldMeaning
dependsOnArtifact names to build first.
name (JARs)"app" and "app.jar" both give app.jar; a SourceJar gives app-sources.jar.

WebImage

WebImage takes the NativeImage fields from, name, entrypoint, moduleName, dependsOn and options (see Native Image), has no type, and adds:

PropertyValuesDefault
backend"wasm-gc" (host GC) or "wasm-lm" (linear memory)."wasm-gc"
runtime"generic", "browser" or "node"."generic"
autoRunStart the program when the loader loads.true
sourceMapEmit a JavaScript source map.false

entrypoint (or jvm.main) is required even with autoRun = false. Do not also pass raw flags for these four settings. Guide: WebImage; flag-based artifacts: migration.

Testing

import "elide:Testing.pkl" as Testing

testing { reports { Testing.xmlReport() } }
PropertyMeaning
testing.reportsReport formats for every runner, written to .dev/reports/tests/<language>/<source-set>/; same as --reporter=junit.

Coverage is the top-level coverage block; see Testing › Coverage.

Workspaces

workspace { members { "core"; "app" } }

Each member is a directory with its own elide.pkl; members cannot have members. elide init --template workspace generates a root with a core library and an app that depends on it.

BehaviorRule
Build scopeFrom the root, elide build/elide test cover every project; from a member, only that member.
Cross-project taskselide build core:compile-kotlin-main, or elide build core for its default tasks.
Shared stateResolved dependencies and build state are stored in the root .dev; outputs stay in each project’s .dev.
Version pinsA member can omit a Maven version and take the root’s; a conflicting version is an error.
// core/elide.pkl
import "elide:Jvm.pkl" as Jvm

dependencies {
  maven {
    packages { "com.google.guava:guava" }  // version from the root
  }
}

artifacts {
  ["jar"] = new Jvm.Jar { name = "core" }
}
// app/elide.pkl
local core = project("core")

dependencies { maven { packages { core } } }
ReferenceMeaning
project("core")The project’s Jvm.Jar artifact plus its compile classpath; built only when needed. JVM sources alone do not count.
project("core").artifact("fat")Pick one JAR when the project declares several.
project("core").friend()Also see core’s Kotlin internal declarations (not its dependencies’). Only in packages, modules, compileOnly, testPackages.
module.project("core")Use in place, inside an object body; bare project(…) does not resolve there.
new Artifacts.ProjectArtifact { project = "core"; artifact = "fat" }Explicit form; import "elide:Artifacts.pkl" as Artifacts.

A reference to a project with no JAR, or a misplaced friend(), fails when the build is configured.