Skip to content

Getting started

Install Elide, create a project with elide init, run TypeScript, Python and Kotlin files, add Maven and npm dependencies, then test and build.

On this page

Install Elide, create a project, then run, test and build it.

Install

macOS, Linux or WSL:

curl -sSL --tlsv1.2 elide.sh | bash

Windows (PowerShell):

& ([scriptblock]::Create((irm https://elide.sh/install.ps1)))

Open a new terminal and check the install:

elide --version

Homebrew, containers, release channels and the Python component: Installation.

Create a project

mkdir hello && cd hello
elide init --plain --skip-defaults --template ktjvm
FileContents
elide.pklThe project manifest: its name and the JVM entrypoint.
src/main/com/example/Hello.ktA main function that prints Hello Elide!.
src/test/com/example/HelloTest.ktA kotlin.test test for the greeting.
amends "elide:project.pkl"

name = "Sample Project"

jvm {
  main = "com.example.HelloKt"
}

elide init --templates lists the other templates: java, web-simple, web-demo and workspace. Without flags, elide init opens an editor for the template’s parameters. For an existing Java or Kotlin project, run elide adopt in it (Adopt an Existing Project).

Run a file

Source files run directly, in a project or not. TypeScript needs no compile step:

// hello.ts
const name: string = "TypeScript";
console.log(`Hello from ${name}!`);
elide run hello.ts
Hello from TypeScript!
0:09 / 0:09

Python needs the Python component (elide setup python):

# hello.py
print("Hello from Python!")
elide python hello.py
Hello from Python!

Kotlin and Java files run the same way:

// hello.kt
fun main() {
  println("Hello from Kotlin!")
}
elide run hello.kt
Hello from Kotlin!

In the project, elide run with no file builds and runs jvm.main, which prints Hello Elide!.

Executable scripts

Start a file with #!/usr/bin/env elide and mark it executable. Arguments reach process.argv or sys.argv:

#!/usr/bin/env elide
const n: number = 42;
console.log(`ts ${n}`, process.argv.slice(2).join(" "));
chmod +x hello.ts
./hello.ts --flag x
ts 42 --flag x

The same line works for .js, .mjs and .py files. A file without an extension runs as JavaScript.

Add a dependency

Declare packages in elide.pkl:

dependencies {
  maven {
    packages { "com.google.guava:guava:33.4.8-jre" }
  }
  npm {
    packages { "zod@3.25.76" }
  }
}
elide install                         # Maven
elide install --ecosystems=maven,npm  # Maven and npm

npm packages install into node_modules, and npm also reads package.json. elide install does not install pypi packages. See Dependencies.

Test

elide test
com.example.HelloTest
✓ testGreeting() [15ms]

 1 pass
 0 skip
 0 fail
Ran one test across one file. (0.67s)

elide test also runs JavaScript and TypeScript node:test files; see Testing.

Build

elide build

Outputs and build state go in .dev/. elide build --inspect lists the tasks and their options; see Build Tasks.

Next steps

Was this page helpful?