Skip to content

Project setup

Set up an Elide project with elide.pkl: elide init templates, named scripts, dependencies, workspaces, and pinning the Elide version.

On this page

A project is a directory with an elide.pkl. Outputs, dependencies, reports and build state go in .dev/. Run commands from the project directory, or pass -p PATH.

elide init --templates   # java, ktjvm, web-simple, web-demo, workspace

Create a project without prompts

elide init opens an editor in a terminal. In scripts and CI, pass --plain --skip-defaults, a template and its parameters as name=value:

elide init --template java --parameters          # list parameters and blocks
elide init --template java --parameters --json   # the same, as JSON
elide init --plain --skip-defaults --skip-run --template java \
  project_name=greeter package=dev.acme greeting="Hi there" tests=false
elide.pkl
src/main/dev/acme/Hello.java
ArgumentEffect
NAME=VALUE or NAME VALUESets a parameter; omitted parameters take their defaults.
BLOCK=true, BLOCK=falseTurns an optional block on or off: tests (test sources), mcp (.mcp.json).
--skip-runDoes not run Elide after generating files.
--overwriteReplaces existing files.
InputResult
No terminal, without --plain --skip-defaultsExit 2: `elide init` needs an interactive terminal.
A value that fails validationExit 2: Parameter "package" value "1bad" validation failed with error: "Not a valid Java package name."
A block value other than true/falseExit 2: Could not parse block "tests" value "maybe" as boolean, it must be true or false
An unknown nameWarning No parameter or block "colour" exists, value "red" will be ignored; exit 0

Create a JVM project

amends "elide:project.pkl"

name = "hello"

jvm {
  main = "sample.HelloKt"
}

src/main/kotlin/sample/Hello.kt:

package sample

fun main() {
  println("Hello from Kotlin")
}
elide install
elide build
elide run

src/main/kotlin needs no sources block; see Source Sets.

0:23 / 0:23

elide build --inspect lists the tasks and their options; see Build Tasks.

Add a script

scripts {
  ["greet"] = "echo hello"
}
elide run greet

Scripts run under /bin/sh. elide run NAME picks the first match: a file, then elide.pkl scripts, then package.json or pyproject.toml scripts, then node_modules/.bin.

Add dependencies

Declare Maven, npm and PyPI packages under dependencies; elide install resolves Maven and npm packages, not PyPI (Python packages). See Dependencies and the reference.

Create a workspace

A workspace root lists member projects and builds them as one task graph. elide init --template workspace creates one. See Workspaces.

Inspect a project

elide project info                 # resolved source sets, dependencies, artifacts
elide project advice               # usage advice for coding agents
elide project export               # the resolved manifest as JSON
elide project export --format=pom  # or intellij
elide classpath                    # the main compile classpath, `:`-separated
elide classpath test:runtime       # [<source-set>:]<usage>

-f flags change the export. Formats: Project export formats. Classpath usages: Source Sets.

Pin the Elide version

elide use 1.6.0               # write .elideversion and install that version
elide use 1.6.0 --no-install  # only write the file

toolchain.engines in elide.pkl lists accepted versions; see Toolchain.

Was this page helpful?