Install Elide, create a project, then run, test and build it.
Install
macOS, Linux or WSL:
curl -sSL --tlsv1.2 elide.sh | bashWindows (PowerShell):
& ([scriptblock]::Create((irm https://elide.sh/install.ps1)))Open a new terminal and check the install:
elide --versionHomebrew, containers, release channels and the Python component: Installation.
Create a project
mkdir hello && cd hello
elide init --plain --skip-defaults --template ktjvm| File | Contents |
|---|---|
elide.pkl | The project manifest: its name and the JVM entrypoint. |
src/ | A main function that prints Hello Elide!. |
src/ | A 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.tsHello from TypeScript!Python needs the Python component (elide setup python):
# hello.py
print("Hello from Python!")elide python hello.pyHello from Python!Kotlin and Java files run the same way:
// hello.kt
fun main() {
println("Hello from Kotlin!")
}elide run hello.ktHello 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 xts 42 --flag xThe 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 npmnpm packages install into node_modules, and npm also reads package.json. elide install does not install pypi
packages. See Dependencies.
Test
elide testcom.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 buildOutputs and build state go in .dev/. elide build --inspect lists the tasks and their options; see
Build Tasks.
Next steps
- Languages: JavaScript and TypeScript, Python, Java and Kotlin, WebAssembly.
- Toolchain: building, testing, formatting and packaging.
- Project setup: scripts, workspaces and pinning the Elide version.
- Development Server:
elide devserves a directory or server script with page reload. - Code Samples: one-file examples with their expected output.