Elide Projects
Elide is capable of creating and managing Elide-native projects through a project toolchain.
An Elide Project consists of:
- Project manifest -
elide.pklis a powerful configurable Pkl-based manifest. - Work directory -
.devacts as an internal directory, that Elide uses to store output and intermediate states of build tasks. - Lockfile -
.dev/elide.build.binand.dev/elide.lock.v2.binare read-only binary files used by Elide tooling. Generally, users shouldn't edit them.
Project CLI
There are three CLI commands that can depend on an Elide project to work, which they can access in two ways:
- Direct passing - by passing
--project PATHyou can specify the manifest that will be loaded for this command. - Auto-detection - if no path is provided, the command will attempt to find a project manifest in the current directory.
As such a plain call of,
elide buildwill attempt to search for manifest in a local directory, while
elide build -p PATHwill try to fetch the manifest from the path.
These are the commands that require a project.| Command | Description |
|---|---|
build | Installs dependencies and compiles sources. |
install | Install dependencies. |
classpath | Generates a classpath for the project. |
Building a Project
elide build is the main way to build projects. It generates a task graph based on the manifest configuration.
It's possible to view a full list of tasks that a build command generates from the project manifest.
elide build --inspectTo run a specific task,
elide build TASKFor example,
elide build compile-java-mainElide Project Manifest
elide.pkl is a Pkl-based manifest that allows for extensive configuration of Elide project.
For a field-by-field schema reference, see elide.pkl Reference.
The project manifest has a regimented, yet flexible structure.
# Importing project schema
amends "elide:project.pkl"
# Importing configuration-specific schema
import "elide:Sources.pkl" as Src
# Project metadata
name = "project"
version = "1.0.0"
description = "example project"
# Project configuration
sources {
["main"] = new Src.SourceSetSpec {
paths {
"src/main/java<<>>*.java"
}
}
}Project Metadata
Top-level declarations for project organization and housekeeping.| Field | Type | Default | Description |
|---|---|---|---|
name | String | Empty | Name of the project. |
version | String | Empty | Project version number. |
description | String | Empty | Description of the project. |
Build Context
Elide automatically populates two read-only (fixed) properties in every manifest at evaluation time. These expose the current Elide runtime version and manifest format version so that manifests can adapt their configuration conditionally.
| Property | Type | Description |
|---|---|---|
elide | ElideInfo | Information about the Elide runtime executing the build. |
build | BuildInfo | State captured from the Elide build system at evaluation time. |
ElideInfo
| Field | Type | Description |
|---|---|---|
version | semver.Version | Semantic version of the Elide runtime executing the build. |
channel | ReleaseChannel | Release channel of the runtime, either "release" or "debug". |
BuildInfo
| Field | Type | Description |
|---|---|---|
manifestVersion | Int | Major version of the project manifest format. Incremented on breaking schema changes. |
elide.version is a semver.Version, you can use Pkl's semver comparison methods to write version-gated configuration:
amends "elide:project.pkl"
import "pkl:semver"
import "elide:Sources.pkl" as src
sources {
when (elide.version.isGreaterThan(semver.Version("1.1.0"))) {
["main"] = new src.SourceSetSpec {
paths {
"src/main/kotlin<<>>*.kt"
}
}
}
}Similarly, elide.channel lets you gate configuration on the release channel:
when (elide.channel == "release") {
// release-only settings
}Sources
For Elide project to build, sources have to be specified in the manifest. A general template of declaring sources is
import "elide:Sources.pkl" as Src
sources {
["main"] = new Src.SourceSetSpec {
paths {
"src/main/java<<>>*.java"
}
}
}The import allows you to use source schema and helps Elide to parse the source section of the manifest.
Sources themselves are declared by paths, which are a list of pattern-matched paths.
sources section, sources are grouped into named sets (such as ["main"] in this example). A set's name can be any string; its type defaults to source. Elide recognizes four source-set types. Currently only test changes build behavior (it is compiled with test dependencies and run as tests); source, example, and other are treated the same as source.
| Type | Description |
|---|---|
source | Production sources (the default type). |
test | Test sources. |
example | Example sources. |
other | Other sources. |
type, each source set accepts paths, the list of source paths or globs. JVM source sets can use
Jvm.JvmSourceSetSpec, which adds resources as a map of mount-path to source-path for non-code files bundled with the
set. See elide.pkl Reference for the complete source-set shape.
Test source sets are compiled with test dependencies and run by elide test. JVM test coverage is configured under testing { coverage { jvm { … } } }, which can emit HTML, XML, and CSV reports.
Entrypoint
Specifying an entrypoint allows Elide to automatically detect scripts to run.
entrypoint {
"some.entry"
}As such if during elide run no script was specified, Elide will attempt to fetch an entrypoint filepath from the manifest.
Scripts
Scripts are key value pairs, intended to work similar to scripts of Node's package.json.
Declared scripts are listed by elide project (and surfaced in elide project advice).
For example, if you specify in script
scripts {
["help"] = "elide --help"
}Note: elide run does not currently execute a script by name — the first non-option argument to elide run is always resolved as a source file path. Running a script by its manifest name is not yet supported.
Dependencies
Elide comes with a built-in, polyglot dependency manager. A single
dependencies { } block declares packages across three ecosystems — npm
(JavaScript/TypeScript), PyPI (Python), and Maven (JVM) — and one elide
install resolves and installs them all. See Dependencies
for the full installer guide.
import "elide:Jvm.pkl" as Jvm
dependencies {
npm {
packages { "react@19.0.0" }
}
pypi {
packages { "six==1.17.0" }
}
maven {
packages { "com.google.guava:guava:33.4.8-jre" }
}
}npm and pypi each accept packages (and npm also devPackages); use
their native specifier syntax (name@version for npm, name==version /
name>=version for PyPI). The Maven block is the richest — the rest of this
section covers it in detail.
Elide can act as a Maven installer.
There are three ways to declare a Maven dependency:
import "elide:Jvm.pkl" as Jvm
dependencies {
maven {
packages {
// Coordinate string — the most common form
"com.google.guava:guava:33.4.8-jre",
// Structural form — use when you need to set a classifier or other fields
new Jvm.MavenPackageSpec {
group = "com.google.guava"
name = "guava"
version = "33.4.8-jre"
}
// Local JAR path — bypasses Maven resolution entirely (see below)
"./libs/my-library.jar"
}
}
}Maven dependencies are installed in your local Maven repository and linked into your project through .dev file.
Spring Boot starters
Spring Boot starters all share the coordinate shape
org.springframework.boot:spring-boot-starter-, so a spring { } block
lets you declare just the name and the Boot version:
dependencies {
spring {
version = "3.5.0"
starter {
"actuator"
"web"
}
testStarter {
"test"
}
}
}starter entries resolve into packages (compile scope); testStarter entries
resolve into testPackages. The example above is exactly equivalent to:
dependencies {
maven {
packages {
"org.springframework.boot:spring-boot-starter-actuator:3.5.0"
"org.springframework.boot:spring-boot-starter-web:3.5.0"
}
testPackages {
"org.springframework.boot:spring-boot-starter-test:3.5.0"
}
}
}version is the Spring Boot version — Spring Framework versions
independently, and starters are versioned by Boot.
Only artifacts that follow the starter convention can be declared this way.
Anything else — spring-boot-devtools, or artifacts in the org.springframework
group — is declared as an ordinary coordinate in maven, and the two blocks
merge:
dependencies {
spring {
version = "3.5.0"
starter { "web" }
}
maven {
packages {
"org.springframework.boot:spring-boot-devtools:3.5.0"
"org.springframework:spring-core:6.2.0"
}
}
}Local JAR dependencies
Any dependency bucket (packages, modules, compileOnly, runtimeOnly,
processors, kotlinPlugins, testPackages) accepts a local JAR file path in
place of Maven coordinates. Path-based entries are read directly from disk.
import "elide:Jvm.pkl" as Jvm
dependencies {
maven {
packages {
// Shorthand: any string that isn't a coordinate is treated as a path
"./libs/my-library.jar"
// Local JAR dependencies are declared as path strings (structural MavenPackageSpec entries are for coordinates only)
}
// Local JARs work in every bucket
compileOnly {
"./libs/annotation-processor.jar"
}
testPackages {
"./libs/test-helpers.jar"
}
}
}Relative paths are resolved from the project directory (the directory containing
elide.pkl). Absolute paths are used as-is.
| Type | Description |
|---|---|
packages | Dependencies used in the compilation and runtime classpaths. |
modules | Dependencies added to the compilation and runtime modulepath for use with Java modules. |
testPackages | Dependencies added to the compilation and runtime classpaths of test sources. |
compileOnly | Dependencies added only to the compilation classpath only. |
runtimeOnly | Dependencies used only at runtime, but not present during compilation. |
processors | Dependencies containing annotation processors. |
kotlinPlugins | Dependencies containing Kotlin compiler plugins. |
exclusions | Maven packages that should be excluded from the graph, e.g. to fix version conflicts manually. |
devPackages | Installed by elide install, but not added anywhere else, useful if you want to have things like JUnit installed for use as part of custom workflows, but not add it to your actual classpath. |
repositories | Configurations for additional remote maven repositories. |
import "elide:Jvm.pkl" as Jvm
dependencies {
maven {
repositories {
["central"] = new Jvm.MavenRepositorySpec {
name = "Maven Central"
description = "The central Maven repository"
url = "https:<<>>
}
[" google"] = "https://maven.google.com"
}
}
}Or specify a local repository and connect to maven central
dependencies {
maven {
localRepository = ".m2/repository"
}
}| Type | Description |
|---|---|
enableDefaultRepositories | Whether to enable default repositories like Maven Central. Defaults to true. |
localRepository | Path to local maven repository |
|repositories | A suite of extra Maven repositories. Each repository accepts a url plus optional credentials (username / password) for authenticated registries. |
The complete dependency schema, including npm and PyPI fields, is listed in elide.pkl Reference.
JVM
Elide has a mechanism that allows for high level of configuration of how Elide interacts with the JVM.
In order to start configuring the JVM, you have to import the JVM-specific schema.
import "elide:Jvm.pkl" as Jvm
jvm {
# your configuration here
}At the high-level, you can specify what JVM you want elide to target and specify and entry point for your JVM.
jvm {
main = "test.class"
target = "latest"
javaHome = "home"
}| Configuration | Description |
|---|---|
main | Entrypoint of JVM. |
target | JVM target level. Use a numeric level (e.g. 21) or "auto"; symbolic values such as "latest"/"stable" are passed to javac verbatim and rejected. |
javaHome | Set a custom Java Home override. |
features | Controls features and settings related to JVM support. |
java | Java language settings. |
flags | Runtime JVM flags. |
features have two flags declared for JVM support, but they are not currently consumed by the build — automatic test dependencies are gated by kotlin.features.testing instead:
| Feature | Description |
|---|---|
testing | If Elide needs to automatically provide test dependencies for JVM projects. (Boolean) |
automodules | Whether auto-modules are enabled (JDK 9+ modulepath handling). (Boolean) |
java controls settings relating to the Java language such as compiler configuration.
| Feature | Description |
|---|---|
source | The source version to use. |
release | The release version to use. |
compiler | Controls settings relating to the Java compiler. Has two flags, mode which is used to configure what compiler to use and flags that control what flags to pass into compiler. Learn more about Elide compiler here |
flags are a set of JVM-tuning flags.
Kotlin
Elide allows to configure Kotlin behavior.
kotlin {
# your configuration here
}| Configuration | Description |
|---|---|
apiLevel | Kotlin API level (display/metadata only — the effective compiler knob is compilerOptions.apiVersion). |
languageLevel | Kotlin language level (display/metadata only — use compilerOptions.languageVersion). |
compilerOptions | Specifies options which relate to the Kotlin compiler. |
features | Specifies Kotlin-related features and options within Elide. |
toolchain | Describes a Kotlin toolchain to be used for compilation. |
plugins | Option key-value pairs to configure a Kotlin compiler plugin. (Declared but not currently consumed — compiler plugins are enabled via kotlin.features and dependencies.maven.kotlinPlugins.) |
compilerOptions| Option | Description |
|---|---|
optIn | Opt-ins to add to Kotlin compiler invocations. |
progressiveMode | Whether to enable the compiler's progressive mode. |
extraWarnings | Whether to enable extra K2 warnings and checks. |
allWarningsAsErrors | Report an error if there are any warnings. |
suppressWarnings | Don't generate any warnings. |
verbose | Enable verbose logging output. |
freeCompilerArgs | Arbitrary arguments to pass to the Kotlin compiler. |
apiVersion | Explicitly set an API version for Kotlin Compiler invocations; this should typically be left at the default, which allows Elide to align API version options. |
languageVersion | Explicitly set a language version for Kotlin Compiler invocations; this should typically be left at the default, which allows Elide to align language version options. |
includeRuntime | Include Kotlin runtime classes within the output artifact. |
noStdlib | Don't automatically include the Kotlin Standard Library on the classpath. |
javaParameters | Generate metadata for Java 1.8 reflection on method parameters. |
jvmTarget | Explicitly set a JVM target; typically this should be left at the default, which allows Elide to align JVM target options with Java, as applicable. |
noJdk | Don't automatically include the Java runtime on the classpath. |
jvmTargetValidationMode | Validation of JVM target compatibility between Kotlin and Java. |
incremental | Enable incremental compilation for Kotlin sources. Enabled by default. |
features| Feature | Description |
|---|---|
testing | Whether to enable Kotlin's test support features. |
kotlinx | Whether to enable KotlinX dependencies automatically on the classpath. |
defaultPlugins | Whether to enable the default suite of built-in plugins for the Kotlin compiler. |
serialization | Enable or disable KotlinX serialization support. |
coroutines | Enable or disable KotlinX Coroutines support. |
reflection | Whether to enable Kotlin's reflection features. (Declared but not currently consumed by the build.) |
toolchain| Configuration | Description |
|---|---|
version | Describes a managed Kotlin toolchain using a specific version. Managed toolchains are automatically resolved and downloaded by Elide when required. |
path | Path to a local Kotlin distribution. |
plugins {
["plugin"] = {
["setting"] = "value",
}
}JavaScript
Elide allows to configure JavaScript ECMA level for the project.
javascript {
ecma = "latest"
}Native Image
Elide accepts a project-wide nativeImage { } block. Note: this block is currently parsed but not applied by the build — set Native Image options per artifact, in the artifact's options { } block (see the Native Image artifact below). The schema below documents the block's shape.
In order to start configuring the native compiler, you have to import a specific schema.
import "elide:NativeImage.pkl" as NativeImage
nativeImage {
# your configuration here
}| Configuration | Description |
|---|---|
verbose | Whether to activate verbose output. |
linkAtBuildTime | Build-time linkage options. |
classInit | Class initialization options. |
exclusions | Exclusions to apply to classpath and modulepath calculations. |
optimization | Optimization level for the Native Image ("auto", "b", "s", "0"-"4"). |
pgo | PGO (Profiling Guided Optimization) settings. |
driverMode | Whether to invoke Native Image internally ("embedded"), or as a sub-process ("external"). |
flags | Extra flags to pass to the Native Image compiler; added to all project targets. |
cflags | Extra flags to pass to the native C compiler; added to all project targets. |
ldflags | Extra flags to pass to the native linker; added to all project targets. |
defs | Definitions of system properties to pass during the Native Image build. |
features | Enabled compiler features. |
linkAtBuildTime| Option | Description |
|---|---|
enabled | Whether link-at-build-time is enabled as the default. |
packages | Specific packages to link at build time. |
classInit| Option | Description |
|---|---|
default | Whether initialize-at-build-time is enabled as the default (default: "buildtime" or "runtime"). |
buildtime | Specific classes or packages to initialize at build time. |
runtime | Specific classes or packages to initialize at runtime. |
exclusions| Option | Description |
|---|---|
all | Exclusions from all paths. (default list: "org.graalvm.compiler:compiler", "org.graalvm.espresso:espresso-svm", "org.graalvm.nativeimage:native-image-base", "org.graalvm.nativeimage:objectfile", "org.graalvm.nativeimage:pointsto", "org.graalvm.nativeimage:svm") |
classpath | Classpath exclusions to apply. |
modulepath | Modulepath exclusions to apply. |
pgo| Option | Description |
|---|---|
enabled | Whether PGO is enabled (only activates with present profiles). |
autoprofile | Whether to enable auto-build features for PGO. (Declared but not currently consumed.) |
instrument | Whether to instrument for PGO. |
sampling | Whether to use sampling for PGO. |
profiles | PGO profiles to apply. |
Engine
This configuration is responsible for configuration of the execution engine used by Elide when running a project.
engine {
# your configuration here
}| Configuration | Description |
|---|---|
maxContexts | Intended maximum number of guest contexts. (Declared but not currently consumed by the runtime.) |
Dev
Dev configurations allow Elide to integrate fully into a development process of a project.
In order to start configuring dev settings, you have to import a specific schema.
import "elide:Dev.pkl" as Dev
dev {
# dev configuration here
}dev definitions
| Configuration | Description |
|---|---|
source | Project source configuration. (Declared but not currently consumed by the build.) |
mcp | Settings which apply to Model Context Protocol (MCP) servers. |
server | Development server settings. (Declared but not currently consumed — the dev server reads host/port from the CLI.) |
source| Configuration | Description |
|---|---|
platform | Platform which holds this project's source ("git", "github", "gitlab", "bitbucket", any). |
project | Project name or path. |
subpath | Subpath for this project, as applicable. |
mcp| Configuration | Description |
|---|---|
resources | Additional MCP resources. (Declared but not currently consumed — only registerElide and advice are honored.) |
registerElide | Whether to register Elide as an MCP tool. |
advice | Whether to register project advice with MCP. |
resources {
new Dev.McpResource {
# some resource config
}
}| Configuration | Description |
|---|---|
path | Path to the file. |
name | Resource name. |
description | Resource description. |
mimeType | Mime type to explicitly set; one is detected if not provided. |
server | Configuration | Description |
|---|---|
host | Host to listen on. |
port | Port to listen on. |
Toolchain
Toolchain settings let you configure which Elide engine version to use.
toolchain {
engines {
["elide"] = ">1.0.0"
}
}Artifacts
Elide can produce a variety of artifacts that can be placed into your project. These are declared as key-value pairs inside artifact configuration.
artifacts {
["some-artifact"] = {
# some artifact
}
}| Type | Description |
|---|---|
Jvm.Jar | Describes a JAR output artifact. |
Jvm.SourceJar | Describes a sources JAR artifact that packages source files. |
Jvm.JavadocJar | Describes a Javadoc JAR artifact that generates and packages documentation. |
NativeImage.NativeImage | Describes a Native Image artifact within an Elide project. |
Web.StaticSite | Declares a static website as an artifact. |
Container.ContainerImage | Describes a container image built from JVM or native output (see Containers). |
Jvm.Jar,
import "elide:Jvm.pkl" as Jvm
artifacts {
["some-jar"] = new Jvm.Jar {
# some config here
}
}When you want to use a source in an artifact, you have to use them by name that are already declared by in project metadata. For example, you can use main in artifact sources, if they are declared in metadata.
Jvm.Jar| Configuration | Description |
|---|---|
name | Filename for the resulting JAR. |
sources | Which source set to build this JAR from. |
resources | Which resources to add to the JAR (key-value pair of name to path). |
manifest | Keys and values to include in the JAR's manifest. |
manifestFile | Manifest file path. |
excludes | Patterns to exclude. |
options | Options for the JAR. |
option| Option | Description |
|---|---|
compress | Whether to apply compression. |
defaultManifestProperties | Whether to add default manifest properties. |
entrypoint | Main entrypoint for the JAR, if applicable. |
Jvm.SourceJar| Configuration | Description |
|---|---|
sources | Which source set to build this JAR from. |
classifier | Classifier for the JAR. |
excludes | Patterns to exclude from the sources JAR. |
includes | Patterns to include in the sources JAR. |
Jvm.JavadocJar| Configuration | Description |
|---|---|
sources | Which source set to build this JAR from. |
NativeImage.NativeImage| Configuration | Description |
|---|---|
from | Artifacts from which to build the Native Image. |
name | Name of the output artifact (binary or library); computed if omitted. |
entrypoint | Entrypoint class for the Native Image. |
type | Type of image to produce: binary or library. |
moduleName | JPMS module of the entrypoint class. (Declared but not currently consumed — the entrypoint is taken from entrypoint / jvm.main.) |
options | Native Image compiler options for this artifact. |
Web.StaticSite| Configuration | Description |
|---|---|
srcs | Path to the root source directory for the site. |
domain | Production domain for this site. (Declared but not currently consumed by the build.) |
preview | Preview domain for this site. (Declared but not currently consumed by the build.) |
prefix | Web prefix where this site is mounted; considered for links and assets. Must end with a slash. |
assets | Public web path for assets. (Declared but not currently consumed by the build.) |
stylesheets | Stylesheets to add to all pages. |
scripts | Scripts to add to all pages. |
rewriteLinks | Rewrite links when rendering markdown documents. |
hosting | Static site host. (Declared but not currently consumed by the build.) |
Web
This configuration describes settings which apply in web-based environments; these settings configure how Elide builds and serves web applications, and related resources like images, stylesheets, and JavaScript.| Configuration | Description |
|---|---|
css | Settings to apply to CSS processing and serving. |
minifyHtml | Whether to minify generated HTML (default true). |
browsers | Browser support. (Not currently consumed — CSS targeting uses css.targets.) |
css| Configuration | Description |
|---|---|
minify | Whether to enable minification of CSS code. |
targets | Target platforms (browsers) to consider when rendering/building CSS. |
import "elide:Web.pkl" as Web
web {
css {
targets {
new Web.CssTarget {
# some config
}
}
}
}target| Configuration | Description |
|---|---|
browser | The name of the browser type to target("chrome", "firefox", "safari", "edge", "opera", String). |
version | The version of the browser to target. |
Elide Lockfile
Elide lockfile contains information about project metadata as well as a resolved dependency graph. It allows for faster elide build as unmodified dependency list will be skipped and resolved dependency graph will be used